Any object more stable than if?

Dec 6, 2010 at 3:20pm

Any object more stable than if?

Hi all,
I’ve trying to trigger a recording using the if object, so as soon as I get input from the mic, if triggers a toggle that starts the recording, which toggle, triggers another toggle as soon as it goes off (with an ‘if $i1 == 0 then 1 else 0′) to start the playback.
My problem is that the second toggle goes crazy, and I think it happens because the if object receives values constantly from the mic, so it constantly sends bangs.
Is there any other object that can be used in such a way, but can be more reliable? Select also won’t work cause the value changes are very fast for it to catch.

Cheers,
Alex

#53758
Dec 6, 2010 at 3:33pm

Sounds like an ‘envelope follower’ might help you. Have a search, or there’s a nice one here:

http://cycling74.com/forums/topic.php?id=28761

#193355
Dec 6, 2010 at 5:22pm

Maybe the change object?

#193356
Dec 6, 2010 at 7:48pm

also maybe not a toggle, which flips when banged. try [led] or as mentioned, [change] will filter out repetitions.

you shouldn’t need [if] in most Max situations. in your case you can use [select] and bang out a 1 if it’s 0 and vice-versa, or even quicker, run the 1/0 through [!- 1] which will invert the values. if you’re using [change] the really-fast-sensing shouldn’t be a problem.

#193357
Dec 6, 2010 at 7:59pm

 
he could also include the functionality of [change] INTO his [if].
 

#193358
Dec 11, 2010 at 1:45am

Not sure if it’s fast enough, but try the external [pitch~].. Plug your audio in, and one of the outlets will bang whenever a peak in the sound occurs. So the first thing through the mic triggers it, then you could start recording and turn off the signal to pitch~.

#193359
Dec 15, 2010 at 4:42pm

so you say he shouldn’t need if in most situations, but is there a pressing reason not to use if statements?

#193360
Dec 15, 2010 at 5:18pm

Hello pucklermuskau,

It seems [if] is not very popular among maxers ; in most situations it can be replaced by [select], [split] and co, but sometimes it can’t ; so if you need it, or love it, use it ; IMHO it’s not very relevant to speak about efficiency unless you have hundreds [if] objects in your patch ; and unless somebody proves me that i’m wrong, [if] is *stable*.

#193361
Dec 15, 2010 at 5:42pm

I spent five years using if for simple routing before I discovered the split object….(hangs head in shame)

#193362
Dec 15, 2010 at 7:54pm

This sounds like something you should be doing in the signal domain. peakamp~ is a handy object (puts out a float). Also average~ or avg~, depending on the situation, are a good basis for envelop followers. thresh~ is another one.

mz

#193363
Jan 3, 2011 at 7:56pm

Guys, thank you all for your replies. I still haven’t really solved the problem, but it should be somewhere there. When I’ll deal with the patch seriously again, I’m sure all these tips will be really helpful.
Once again, thanks,
Alex

#193364
Jan 4, 2011 at 5:39am

Not really sure, but perhaps [togedge] will help.

#193365

You must be logged in to reply to this topic.