It is currently April 19th, 2024, 6:17 am

Help with MeasureSpeaker and AnimatedGIF

Get help with creating, editing & fixing problems with skins
DvD
Posts: 15
Joined: November 23rd, 2019, 6:03 pm

Re: Help with MeasureSpeaker and AnimatedGIF

Post by DvD »

balala wrote: November 23rd, 2019, 9:18 pm Not sure I understood. You'd like to change the images of another skin from the above code?
Yes but not in that way xD
i have 2 skins of 2 gif
i want to put them in the code, but is like, the first gif is in front of the second
but in this case, when the computer make sound, the second gif pass in front of the first gif
that's the form that i think is possible to do xD
User avatar
Quell
Posts: 17
Joined: November 17th, 2019, 6:02 am

Re: Help with MeasureSpeaker and AnimatedGIF

Post by Quell »

Very immature and twisted :twisted: with this program.
Don't quote me on this.
The problem is sometimes with the measures.
For example, the program did not even realize the volume changed because it never tracked the change past the indicated mark.
If you are measuring zero to one hundred. Maybe try adding a measure like zero to one. Then add a measure one to one hundred. Could work.
Another idea I have is from another rainmeter skin.
The code simply relies on the plugin for sound like always.
Measure=Plugin
Plugin=Win7AudioPlugin
I used to not smoke in my bosses car if we slept together.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with MeasureSpeaker and AnimatedGIF

Post by eclectic-tech »

I don't think using only sound levels and 14 images will produce desirable results; it is going to be very "jittery" unless more images are used and a more robust audio monitoring... but here is a starting point.
assistelmo.gif
Assistant Elmo
Images are in the skin folder so editing is easier.
Volume will affect image change by controlling the RMSGain.
This only has 6 images, really need more for smoother animation.

Code: Select all

[Rainmeter]
Author=DvD
Update=75
OnRefreshAction=[!ZPos "0"]

[Metadata]
Skin name=ASISTANT
Version=1
License=Creative Commons Attribution-Noncommercial-Share Alike 3.0 License


-----------------------------

[MeasureSpeaker]
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=15
RMSDecay=50
RMSGain=([mVolume])
IfCondition=MeasureSpeaker = 0
IfTrueAction=[!SetOption Speaker ImageName "0.png"][!UpdateMeter *][!Redraw]
IfCondition2=(MeasureSpeaker >= 0.0) && (MeasureSpeaker < 0.1500)
IfTrueAction2=[!SetOption Speaker ImageName "1.png"][!UpdateMeter *][!Redraw]
IfCondition3=(MeasureSpeaker >= 0.1500) && (MeasureSpeaker < 0.3000)
IfTrueAction3=[!SetOption Speaker ImageName "2.png"][!UpdateMeter *][!Redraw]
IfCondition4=(MeasureSpeaker >= 0.3000) && (MeasureSpeaker < 0.5000)
IfTrueAction4=[!SetOption Speaker ImageName "3.png"][!UpdateMeter *][!Redraw]
IfCondition5=(MeasureSpeaker >= 0.5000) && (MeasureSpeaker < 0.7500)
IfTrueAction5=[!SetOption Speaker ImageName "4.png"][!UpdateMeter *][!Redraw]
IfCondition6=(MeasureSpeaker >= 0.7500) && (MeasureSpeaker <= 1)
IfTrueAction6=[!SetOption Speaker ImageName "5.png"][!UpdateMeter *][!Redraw]
DynamicVariables=1

-----------------------------
[Container]
Meter=Shape
Shape=Rectangle 10,50,400,400,200 

[Speaker]
Meter=Image
Container=Container

[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin

[mVolume]
Measure=Calc
Formula=MeasureWin7Audio*0.05+1
DynamicVariables=1
Package: 'AssistantElmo' Skin
You do not have the required permissions to view the files attached to this post.
DvD
Posts: 15
Joined: November 23rd, 2019, 6:03 pm

Re: Help with MeasureSpeaker and AnimatedGIF

Post by DvD »

eclectic-tech wrote: November 24th, 2019, 3:00 am I don't think using only sound levels and 14 images will produce desirable results; it is going to be very "jittery" unless more images are used and a more robust audio monitoring... but here is a starting point.
assistelmo.gif
Assistant Elmo
Images are in the skin folder so editing is easier.
Volume will affect image change by controlling the RMSGain.
This only has 6 images, really need more for smoother animation.

Code: Select all

[Rainmeter]
Author=DvD
Update=75
OnRefreshAction=[!ZPos "0"]

[Metadata]
Skin name=ASISTANT
Version=1
License=Creative Commons Attribution-Noncommercial-Share Alike 3.0 License


-----------------------------

[MeasureSpeaker]
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=15
RMSDecay=50
RMSGain=([mVolume])
IfCondition=MeasureSpeaker = 0
IfTrueAction=[!SetOption Speaker ImageName "0.png"][!UpdateMeter *][!Redraw]
IfCondition2=(MeasureSpeaker >= 0.0) && (MeasureSpeaker < 0.1500)
IfTrueAction2=[!SetOption Speaker ImageName "1.png"][!UpdateMeter *][!Redraw]
IfCondition3=(MeasureSpeaker >= 0.1500) && (MeasureSpeaker < 0.3000)
IfTrueAction3=[!SetOption Speaker ImageName "2.png"][!UpdateMeter *][!Redraw]
IfCondition4=(MeasureSpeaker >= 0.3000) && (MeasureSpeaker < 0.5000)
IfTrueAction4=[!SetOption Speaker ImageName "3.png"][!UpdateMeter *][!Redraw]
IfCondition5=(MeasureSpeaker >= 0.5000) && (MeasureSpeaker < 0.7500)
IfTrueAction5=[!SetOption Speaker ImageName "4.png"][!UpdateMeter *][!Redraw]
IfCondition6=(MeasureSpeaker >= 0.7500) && (MeasureSpeaker <= 1)
IfTrueAction6=[!SetOption Speaker ImageName "5.png"][!UpdateMeter *][!Redraw]
DynamicVariables=1

-----------------------------
[Container]
Meter=Shape
Shape=Rectangle 10,50,400,400,200 

[Speaker]
Meter=Image
Container=Container

[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin

[mVolume]
Measure=Calc
Formula=MeasureWin7Audio*0.05+1
DynamicVariables=1
Package: 'AssistantElmo' Skin
So, I was thinking about an easy way :0
I describe what a i have:
AsafataExample.PNG
I have this model with the normal code for the frames, i also have the same model but with the mouth opened
I think the easy way is put the two gif playing at the same time in the same position of the display but, the one with de mouth closed will be in front of the one with the mouth opened, i wanted to them swap places when the sound play :0 my asistant have a lot of frames (147) so im not sure to use the code that i used in the example (except if i can modify it for work with two diferent gif at the same time xD)
I dont know if im explaining good this idea xD
You do not have the required permissions to view the files attached to this post.
DvD
Posts: 15
Joined: November 23rd, 2019, 6:03 pm

Re: Help with MeasureSpeaker and AnimatedGIF

Post by DvD »

eclectic-tech wrote: November 24th, 2019, 3:00 am I don't think using only sound levels and 14 images will produce desirable results; it is going to be very "jittery" unless more images are used and a more robust audio monitoring... but here is a starting point.
assistelmo.gif
Assistant Elmo
Images are in the skin folder so editing is easier.
Volume will affect image change by controlling the RMSGain.
This only has 6 images, really need more for smoother animation.

Code: Select all

[Rainmeter]
Author=DvD
Update=75
OnRefreshAction=[!ZPos "0"]

[Metadata]
Skin name=ASISTANT
Version=1
License=Creative Commons Attribution-Noncommercial-Share Alike 3.0 License


-----------------------------

[MeasureSpeaker]
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=15
RMSDecay=50
RMSGain=([mVolume])
IfCondition=MeasureSpeaker = 0
IfTrueAction=[!SetOption Speaker ImageName "0.png"][!UpdateMeter *][!Redraw]
IfCondition2=(MeasureSpeaker >= 0.0) && (MeasureSpeaker < 0.1500)
IfTrueAction2=[!SetOption Speaker ImageName "1.png"][!UpdateMeter *][!Redraw]
IfCondition3=(MeasureSpeaker >= 0.1500) && (MeasureSpeaker < 0.3000)
IfTrueAction3=[!SetOption Speaker ImageName "2.png"][!UpdateMeter *][!Redraw]
IfCondition4=(MeasureSpeaker >= 0.3000) && (MeasureSpeaker < 0.5000)
IfTrueAction4=[!SetOption Speaker ImageName "3.png"][!UpdateMeter *][!Redraw]
IfCondition5=(MeasureSpeaker >= 0.5000) && (MeasureSpeaker < 0.7500)
IfTrueAction5=[!SetOption Speaker ImageName "4.png"][!UpdateMeter *][!Redraw]
IfCondition6=(MeasureSpeaker >= 0.7500) && (MeasureSpeaker <= 1)
IfTrueAction6=[!SetOption Speaker ImageName "5.png"][!UpdateMeter *][!Redraw]
DynamicVariables=1

-----------------------------
[Container]
Meter=Shape
Shape=Rectangle 10,50,400,400,200 

[Speaker]
Meter=Image
Container=Container

[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin

[mVolume]
Measure=Calc
Formula=MeasureWin7Audio*0.05+1
DynamicVariables=1
Package: 'AssistantElmo' Skin
Btw, your code works good :0 and in the way i will use the skin looks great xD
but my problem is because the code is short for my material of gif (147 of mouth closed and 147 of mouth opened)
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with MeasureSpeaker and AnimatedGIF

Post by eclectic-tech »

Okay, here is a better example skin 'AssistanStewardess' using just 2 images, but alternating them based on the audiolevel value.
It actually looks better than I thought :sly:
assiststeward.gif
You do not have the required permissions to view the files attached to this post.
DvD
Posts: 15
Joined: November 23rd, 2019, 6:03 pm

Re: Help with MeasureSpeaker and AnimatedGIF

Post by DvD »

eclectic-tech wrote: November 24th, 2019, 5:42 am Okay, here is a better example skin 'AssistanStewardess' using just 2 images, but alternating them based on the audiolevel value.
It actually looks better than I thought :sly:
assiststeward.gif
I still thinking, how can i use that with two gif xD
its possible play the gif 0-147 (or >=0 <=147) and if there is no sound, and when there is the sound level play the gif frames 148-296 (or >=148 <=296)
xD and i want to declare something like: if MeasureSpeaker 0-147 start with 3 (MeasureSpeaker 148-296 start with 151)
but in my point of view is more easy have two files folders with 0-147 of mouth opened and 0-147 of mouth closed, and just change between those two files folders
Im not sure how this works, sorry if I cant make something for an example D:
DvD
Posts: 15
Joined: November 23rd, 2019, 6:03 pm

Re: Help with MeasureSpeaker and AnimatedGIF

Post by DvD »

DvD wrote: November 24th, 2019, 2:30 pm I still thinking, how can i use that with two gif xD
its possible play the gif 0-147 (or >=0 <=147) and if there is no sound, and when there is the sound level play the gif frames 148-296 (or >=148 <=296)
xD and i want to declare something like: if MeasureSpeaker 0-147 start with 3 (MeasureSpeaker 148-296 start with 151)
but in my point of view is more easy have two files folders with 0-147 of mouth opened and 0-147 of mouth closed, and just change between those two files folders
Im not sure how this works, sorry if I cant make something for an example D:
Its like declare two differents group of images,insteada of the exact quantity of images :0?
I were checking something like this

Code: Select all

IfCondition6=(MeasureSpeaker >= 0.4500) && (MeasureSpeaker <= 1) && ([ImagenNumberCalc] >= 0 <=147)
IfCondition4=(MeasureSpeaker >= 0.2500) && (MeasureSpeaker < 0.3500) && ([ImagenNumberCalc] >=148 <=296)
something like this i think :0 but it doesn't work
DvD
Posts: 15
Joined: November 23rd, 2019, 6:03 pm

Re: Help with MeasureSpeaker and AnimatedGIF

Post by DvD »

eclectic-tech wrote: November 24th, 2019, 5:42 am Okay, here is a better example skin 'AssistanStewardess' using just 2 images, but alternating them based on the audiolevel value.
It actually looks better than I thought :sly:
assiststeward.gif
this is the full gif (I'm working in the mouth gif but is the same quantity of images 148)
https://drive.google.com/file/d/15e_EuwnRi72WLRpPvnxQ_HHw8Dgu0SCM/view?usp=sharing
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with MeasureSpeaker and AnimatedGIF

Post by eclectic-tech »

Look at this code, I use identical frames, but dimmed one when sound is silent.
assistsine.gif
After seeing it in action, replace the values with your image info. You would use your 2 image sets; mouth open for [MeterSpeaking] and mouth closed for [MeterSilent], and increase the loop measure EndValue to your max number of frames.

It uses a single loop measure to drive the animation, and will show/hide 2 images based on sound/no sound; the transition should be almost seamless since the same loop measure is driving both images.

You did not show your mouth open GIF, but hopefully, it has a moving mouth as well as the swaying stewardess.
This should get you pretty close to your desired result.
You do not have the required permissions to view the files attached to this post.