Notifications
Clear all

[Closed] HELP with a sound Maxscript

I need a script that turn on animation when a sound is on and stop it when the sound is off
anybody?:rolleyes:

4 Replies

how is the sound defined? when is it ‘on’ and when is it ‘off’? etc. :rolleyes:

1 Reply
(@li13)
Joined: 1 year ago

Posts: 0

when the sound is on the animation start to work
and when the sound is off it’s stop
so the animation control by sound

that… doesn’t really answer my question. So I’ll just go with some of the scenarios of what you might be trying…

Setting up an Audio Controller on an object
You can assign an Audio Controller to an object by scripting. For example:


mySphere = Sphere()
mySphere.radius.controller = AudioFloat()

Unfortunately, however, its parameters are not accessible.
You may have better luck with some of the sound plugins out there.

You want an object to react, in realtime, to sound being recorded or played back on your computer
Here, again, you would need to use an Audio Controller, for which you can’t access the parameters. Even if you were to set up the controller in advance and save it for re-use, when you load the file it defaults back to having the realtime device disabled. This can be worked around using displayControlDialog and some UIAccessor bits and pieces, re-checking that checkbox, but you can see where this gets complex.

You want to set up a background audio file and match animation to its length
You can set up the background audio file as follows:


wavSound.filename = "c:\	emp\\sonar.wav"

You can then match one object’s animation to the length of that sound file:


mySphere = Sphere()
at time wavsound.start with animate on ( mySphere.radius = 1.0 )
at time wavsound.end with animate on ( mySphere.radius = 100.0 )

But without knowing exactly what it is you’re trying to do, all the above information may very well be useless to you

thank you for your answer
here is the file in max
that i want it to work with the sound
there is a flower that need to open when the sound is on
and will close when the sound is off
http://www.turboupload.com/files/get/ZPSZT7lfuj/flower06.max