If/Then Toggle Problems

nicholassagan's icon

I'm trying to get an if-then powered toggle to act as a midi trigger for a set note. The problem is that no matter what number is set, the toggle will reset it to the arguments set in the if-thens. The only work around I can figure is to have a message set to the note I want. This method is more inconvenient because the patcher that this is a part of is HUGE and I need the notes to be more dynamic. Otherwise it will get even larger...

So does anyone have any suggestions as to how to keep the number set AND use the toggle as a midi trigger??

Max Patch
Copy patch and select New From Clipboard in Max.

Arvid Tomayko's icon

I'm not understanding yet, but the first thing that pops into my head would be to use trigger to specify the order of actions so you can store values in an int object or message box first, then bang them out if certain conditions are met… but I am too tired right now to actually understand what you are trying to do.

nicholassagan's icon

maybe the bigger picture will help to clarify. this patch uses silhouettes to control midi events. this specific version sends a bang to midiout to play a note. (unfortunately you have to reset it after each note). the problem is that if the note (through Rewire) has a high attack setting, then a bang is insufficient for the note to reach full value. i was thinking that a toggle might do the trick. if an object is in the silhouette then the note is played and held, if not it releases the note.

Max Patch
Copy patch and select New From Clipboard in Max.

tassock's icon

I think you're looking for 'togedge'. That will convert toggle to bang.

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I'm a little unclear about the problem, but this addresses a couple interpretations of what the problem might be: