It is currently December 12th, 2019, 8:16 pm

Help with MeasureSpeaker and AnimatedGIF

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

Help with MeasureSpeaker and AnimatedGIF

DvD » November 23rd, 2019, 6:19 pm

I'm new and im using rainmeter for a school proyect, and i need to make the program for an animation of an assistant.
i have th gif xD i just need to program in way the gif change to moving the mouth when the computer is playing sounds etc
I have 2 gif, the first gif is the assistant with the mouth closed and second the assistant with mouth open, i just have some examples of how the gif work and how measurespeaker works
¿Someone can help me?
User avatar
balala
Rainmeter Sage
Posts: 9258
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with MeasureSpeaker and AnimatedGIF

balala » November 23rd, 2019, 7:02 pm

DvD wrote:
November 23rd, 2019, 6:19 pm
i need to make the program for an animation of an assistant.
i have th gif xD i just need to program in way the gif change to moving the mouth when the computer is playing sounds etc
I have 2 gif, the first gif is the assistant with the mouth closed and second the assistant with mouth open, i just have some examples of how the gif work and how measurespeaker works
¿Someone can help me?
Rainmeter can't handle animated gifs. You have to extract the frames of it then you can use those images into an Image meter.
Do you know how to achieve this? Here is a good description. If you don't succeed, please come back, uploading the images and you definitely will get assistance.
DvD
Posts: 15
Joined: November 23rd, 2019, 6:03 pm

Re: Help with MeasureSpeaker and AnimatedGIF

DvD » November 23rd, 2019, 7:30 pm

balala wrote:
November 23rd, 2019, 7:02 pm
Rainmeter can't handle animated gifs. You have to extract the frames of it then you can use those images into an Image meter.
Do you know how to achieve this? Here is a good description. If you don't succeed, please come back, uploading the images and you definitely will get assistance.
I know that, i have my frames for this, but I dont know how use the gif frames with the MeasureSpeaker, the gif frames work, but how i can use them to change gif or something similar to the other gif frames i have when the computer play sounds?
User avatar
balala
Rainmeter Sage
Posts: 9258
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with MeasureSpeaker and AnimatedGIF

balala » November 23rd, 2019, 7:40 pm

Let's go step by step.
DvD wrote:
November 23rd, 2019, 7:30 pm
i have my frames for this,
Does this mean you have extracted the frames of the animated gif?
What MeasureSpeaker is? Post it, please.
DvD
Posts: 15
Joined: November 23rd, 2019, 6:03 pm

Re: Help with MeasureSpeaker and AnimatedGIF

DvD » November 23rd, 2019, 7:50 pm

balala wrote:
November 23rd, 2019, 7:40 pm
Let's go step by step.

Does this mean you have extracted the frames of the animated gif?
What MeasureSpeaker is? Post it, please.

Code: Select all

[Rainmeter]
Author=DvD
Update=70
OnRefreshAction=!Execute [!ZPos "-1"][!Redraw]

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


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

[MeasureSpeaker]
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=18
RMSDecay=100
RMSGain=2.0
IfCondition=MeasureSpeaker = 0
IfTrueAction=[!SetOption Speaker ImageName "0.png"][!UpdateMeter *][!Redraw]
IfCondition2=(MeasureSpeaker >= 0) && (MeasureSpeaker < 0.1000)
IfTrueAction2=[!SetOption Speaker ImageName "1.png"][!UpdateMeter *][!Redraw]
IfCondition3=(MeasureSpeaker >= 0.1000) && (MeasureSpeaker < 0.2000)
IfTrueAction3=[!SetOption Speaker ImageName "2.png"][!UpdateMeter *][!Redraw]
IfCondition4=(MeasureSpeaker >= 0.2000) && (MeasureSpeaker < 0.3000)
IfTrueAction4=[!SetOption Speaker ImageName "3.png"][!UpdateMeter *][!Redraw]
IfCondition5=(MeasureSpeaker >= 0.3000) && (MeasureSpeaker < 0.4000)
IfTrueAction5=[!SetOption Speaker ImageName "4.png"][!UpdateMeter *][!Redraw]
IfCondition6=(MeasureSpeaker >= 0.4000) && (MeasureSpeaker < 0.5000)
IfTrueAction6=[!SetOption Speaker ImageName "5.png"][!UpdateMeter *][!Redraw]
IfCondition7=(MeasureSpeaker >= 0.5000) && (MeasureSpeaker < 0.5700)
IfTrueAction7=[!SetOption Speaker ImageName "6.png"][!UpdateMeter *][!Redraw]
IfCondition8=(MeasureSpeaker >= 0.5700) && (MeasureSpeaker < 0.6400)
IfTrueAction8=[!SetOption Speaker ImageName "7.png"][!UpdateMeter *][!Redraw]
IfCondition9=(MeasureSpeaker >= 0.6400) && (MeasureSpeaker < 0.7000)
IfTrueAction9=[!SetOption Speaker ImageName "8.png"][!UpdateMeter *][!Redraw]
IfCondition10=(MeasureSpeaker >= 0.7000) && (MeasureSpeaker < 0.7500)
IfTrueAction10=[!SetOption Speaker ImageName "9.png"][!UpdateMeter *][!Redraw]
IfCondition11=(MeasureSpeaker >= 0.7500) && (MeasureSpeaker < 0.8000)
IfTrueAction11=[!SetOption Speaker ImageName "10.png"][!UpdateMeter *][!Redraw]
IfCondition12=(MeasureSpeaker >= 0.8000) && (MeasureSpeaker < 0.8500)
IfTrueAction12=[!SetOption Speaker ImageName "11.png"][!UpdateMeter *][!Redraw]
IfCondition13=(MeasureSpeaker >= 0.8500) && (MeasureSpeaker < 0.9000)
IfTrueAction13=[!SetOption Speaker ImageName "12.png"][!UpdateMeter *][!Redraw]
IfCondition14=(MeasureSpeaker >= 0.9000) && (MeasureSpeaker < 0.9500)
IfTrueAction14=[!SetOption Speaker ImageName "13.png"][!UpdateMeter *][!Redraw]
IfCondition15=(MeasureSpeaker >= 0.9500) && (MeasureSpeaker < 0.9999)
IfTrueAction15=[!SetOption Speaker ImageName "14.png"][!UpdateMeter *][!Redraw]

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

[Speaker]
Meter=Image

Y=0
ImagePath=Anim
Hidden=[MeasureState]
DynamicVariables=1
when i was searching for commands to make images moves with sound i found this example but in my case are more images to put in the command xD (by the way, i dont know how put a codebox here)
Last edited by balala on November 23rd, 2019, 7:54 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are you posting code snippets. It's the </> button.
User avatar
balala
Rainmeter Sage
Posts: 9258
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with MeasureSpeaker and AnimatedGIF

balala » November 23rd, 2019, 8:50 pm

DvD wrote:
November 23rd, 2019, 7:50 pm
when i was searching for commands to make images moves with sound i found this example but in my case are more images to put in the command xD (by the way, i dont know how put a codebox here)
The above code was copied probably from an visualizer skin. This is ok and it should even work if the images are named as 0.png - 14.png and are located into the Anim subfolder of the config which contains the above code as a .ini file. For experimenting I recommend you to:
  • Remove (comment out) the Hidden and DynamicVariables options.
  • There is not needed to update all meters on every change, just the [Speaker], because only its ImageName option is changed through the !SetOption bangs.
  • Another usual recommendation is to move all images (in fact the Anim folder) into the @Resources folder. It's a general requirement to have all resources into the @Resources folder.
  • Don't use the !Execute bang, because it has been deprecated long time ago.
  • The Author option, although a while ago belonged to the [Rainmeter] section, has been moved to [Metadata]. I also moved it.
With all this, here is the updated code:

Code: Select all

[Rainmeter]
Update=70
OnRefreshAction=[!ZPos "-1"][!Redraw]

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

[MeasureSpeaker]
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=18
RMSDecay=100
RMSGain=2.0
IfCondition=(MeasureSpeaker=0)
IfTrueAction=[!SetOption Speaker ImageName "0.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition2=((MeasureSpeaker>=0)&&(MeasureSpeaker<0.1000))
IfTrueAction2=[!SetOption Speaker ImageName "1.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition3=((MeasureSpeaker>=0.1000)&&(MeasureSpeaker<0.2000))
IfTrueAction3=[!SetOption Speaker ImageName "2.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition4=((MeasureSpeaker>=0.2000)&&(MeasureSpeaker<0.3000))
IfTrueAction4=[!SetOption Speaker ImageName "3.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition5=((MeasureSpeaker>=0.3000)&&(MeasureSpeaker<0.4000))
IfTrueAction5=[!SetOption Speaker ImageName "4.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition6=((MeasureSpeaker>=0.4000)&&(MeasureSpeaker<0.5000))
IfTrueAction6=[!SetOption Speaker ImageName "5.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition7=((MeasureSpeaker>=0.5000)&&(MeasureSpeaker<0.5700))
IfTrueAction7=[!SetOption Speaker ImageName "6.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition8=((MeasureSpeaker>=0.5700)&&(MeasureSpeaker<0.6400))
IfTrueAction8=[!SetOption Speaker ImageName "7.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition9=((MeasureSpeaker>=0.6400)&&(MeasureSpeaker<0.7000))
IfTrueAction9=[!SetOption Speaker ImageName "8.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition10=((MeasureSpeaker>=0.7000)&&(MeasureSpeaker<0.7500))
IfTrueAction10=[!SetOption Speaker ImageName "9.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition11=((MeasureSpeaker>=0.7500)&&(MeasureSpeaker<0.8000))
IfTrueAction11=[!SetOption Speaker ImageName "10.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition12=((MeasureSpeaker>=0.8000)&&(MeasureSpeaker<0.8500))
IfTrueAction12=[!SetOption Speaker ImageName "11.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition13=((MeasureSpeaker>=0.8500)&&(MeasureSpeaker<0.9000))
IfTrueAction13=[!SetOption Speaker ImageName "12.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition14=((MeasureSpeaker>=0.9000)&&(MeasureSpeaker<0.9500))
IfTrueAction14=[!SetOption Speaker ImageName "13.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition15=((MeasureSpeaker>=0.9500)&&(MeasureSpeaker<0.9999))
IfTrueAction15=[!SetOption Speaker ImageName "14.png"][!UpdateMeter "Speaker"][!Redraw]

[Speaker]
Meter=Image
Y=0
ImagePath=#@#Anim
;Hidden=[MeasureState]
;DynamicVariables=1
Take care to have the Anim folder into @Resources, otherwise the skin won't work.
If you can't get this to work, please pack the whole config (which contains the 0.png - 14.png images as well) and upload it, to can check.
DvD
Posts: 15
Joined: November 23rd, 2019, 6:03 pm

Re: Help with MeasureSpeaker and AnimatedGIF

DvD » November 23rd, 2019, 9:12 pm

balala wrote:
November 23rd, 2019, 8:50 pm
The above code was copied probably from an visualizer skin. This is ok and it should even work if the images are named as 0.png - 14.png and are located into the Anim subfolder of the config which contains the above code as a .ini file. For experimenting I recommend you to:
  • Remove (comment out) the Hidden and DynamicVariables options.
  • There is not needed to update all meters on every change, just the [Speaker], because only its ImageName option is changed through the !SetOption bangs.
  • Another usual recommendation is to move all images (in fact the Anim folder) into the @Resources folder. It's a general requirement to have all resources into the @Resources folder.
  • Don't use the !Execute bang, because it has been deprecated long time ago.
  • The Author option, although a while ago belonged to the [Rainmeter] section, has been moved to [Metadata]. I also moved it.
With all this, here is the updated code:

Code: Select all

[Rainmeter]
Update=70
OnRefreshAction=[!ZPos "-1"][!Redraw]

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

[MeasureSpeaker]
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=18
RMSDecay=100
RMSGain=2.0
IfCondition=(MeasureSpeaker=0)
IfTrueAction=[!SetOption Speaker ImageName "0.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition2=((MeasureSpeaker>=0)&&(MeasureSpeaker<0.1000))
IfTrueAction2=[!SetOption Speaker ImageName "1.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition3=((MeasureSpeaker>=0.1000)&&(MeasureSpeaker<0.2000))
IfTrueAction3=[!SetOption Speaker ImageName "2.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition4=((MeasureSpeaker>=0.2000)&&(MeasureSpeaker<0.3000))
IfTrueAction4=[!SetOption Speaker ImageName "3.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition5=((MeasureSpeaker>=0.3000)&&(MeasureSpeaker<0.4000))
IfTrueAction5=[!SetOption Speaker ImageName "4.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition6=((MeasureSpeaker>=0.4000)&&(MeasureSpeaker<0.5000))
IfTrueAction6=[!SetOption Speaker ImageName "5.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition7=((MeasureSpeaker>=0.5000)&&(MeasureSpeaker<0.5700))
IfTrueAction7=[!SetOption Speaker ImageName "6.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition8=((MeasureSpeaker>=0.5700)&&(MeasureSpeaker<0.6400))
IfTrueAction8=[!SetOption Speaker ImageName "7.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition9=((MeasureSpeaker>=0.6400)&&(MeasureSpeaker<0.7000))
IfTrueAction9=[!SetOption Speaker ImageName "8.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition10=((MeasureSpeaker>=0.7000)&&(MeasureSpeaker<0.7500))
IfTrueAction10=[!SetOption Speaker ImageName "9.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition11=((MeasureSpeaker>=0.7500)&&(MeasureSpeaker<0.8000))
IfTrueAction11=[!SetOption Speaker ImageName "10.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition12=((MeasureSpeaker>=0.8000)&&(MeasureSpeaker<0.8500))
IfTrueAction12=[!SetOption Speaker ImageName "11.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition13=((MeasureSpeaker>=0.8500)&&(MeasureSpeaker<0.9000))
IfTrueAction13=[!SetOption Speaker ImageName "12.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition14=((MeasureSpeaker>=0.9000)&&(MeasureSpeaker<0.9500))
IfTrueAction14=[!SetOption Speaker ImageName "13.png"][!UpdateMeter "Speaker"][!Redraw]
IfCondition15=((MeasureSpeaker>=0.9500)&&(MeasureSpeaker<0.9999))
IfTrueAction15=[!SetOption Speaker ImageName "14.png"][!UpdateMeter "Speaker"][!Redraw]

[Speaker]
Meter=Image
Y=0
ImagePath=#@#Anim
;Hidden=[MeasureState]
;DynamicVariables=1
Take care to have the Anim folder into @Resources, otherwise the skin won't work.
If you can't get this to work, please pack the whole config (which contains the 0.png - 14.png images as well) and upload it, to can check.
It's posible, change position between 2 skins with this?
the condition is the sound, but i'm thinking to do this more easy, and just replace the position of the first gif and the second
mouth open and mouth close, but they are the same movements, only the mouth change :0
DvD
Posts: 15
Joined: November 23rd, 2019, 6:03 pm

Re: Help with MeasureSpeaker and AnimatedGIF

DvD » November 23rd, 2019, 9:16 pm

DvD wrote:
November 23rd, 2019, 9:12 pm
It's posible, change position between 2 skins with this?
the condition is the sound, but i'm thinking to do this more easy, and just replace the position of the first gif and the second
mouth open and mouth close, but they are the same movements, only the mouth change :0
by the way, that code works
User avatar
balala
Rainmeter Sage
Posts: 9258
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with MeasureSpeaker and AnimatedGIF

balala » November 23rd, 2019, 9:18 pm

DvD wrote:
November 23rd, 2019, 9:12 pm
It's posible, change position between 2 skins with this?
the condition is the sound, but i'm thinking to do this more easy, and just replace the position of the first gif and the second
mouth open and mouth close, but they are the same movements, only the mouth change :0
Not sure I understood. You'd like to change the images of another skin from the above code?
User avatar
balala
Rainmeter Sage
Posts: 9258
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with MeasureSpeaker and AnimatedGIF

balala » November 23rd, 2019, 9:18 pm

DvD wrote:
November 23rd, 2019, 9:16 pm
by the way, that code works
I'm glad. :thumbup: