PDA

View Full Version : HELP with a sound Maxscript


li1
12-01-2008, 08:58 AM
I need a script that turn on animation when a sound is on and stop it when the sound is off
anybody?:rolleyes:

ZeBoxx2
12-01-2008, 12:25 PM
how is the sound defined? when is it 'on' and when is it 'off'? etc. :rolleyes:

li1
12-01-2008, 01:06 PM
how is the sound defined? when is it 'on' and when is it 'off'? etc. :rolleyes:
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

ZeBoxx2
12-01-2008, 01:40 PM
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:\\temp\\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 :)

li1
12-01-2008, 02:45 PM
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:\\temp\\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

CGTalk Moderation
12-01-2008, 02:45 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.