Forums > MaxMSP

turning files on and off

October 18, 2011 | 7:09 pm

At the moment if you turn one audio file on and then turn on the other they both play together. Anyone able to tweak attached patch so that;

when you turn one audio file on (which lights green LED) it turns the other audio file off (turning green LED off)?

cheers,

ben


October 18, 2011 | 9:49 pm

You can always use [print] to see what the objects you are using are outputting, in this case it is either a 1 or 0. You can then use a combination of [select] and [trigger] to stop the other instance of [splay~] in each case. If you’re not familiar with these objects then looking at their uses in the helpfiles should make everything a little bit clearer.


October 19, 2011 | 7:37 am

Since 1 is on and 0 is off, you can use a "== 0" object to produce the opposite (to turn one thing off when you turn the other on and vice versa). Here’s a simple example (on the left). But because a click will occur when you turn a sound off abruptly, you probably want to fade it out before you stop it, and fade the other sound in over the same amount of time, as in the example on the right.

– Pasted Max Patch, click to expand. –

Viewing 3 posts - 1 through 3 (of 3 total)