gswitch2 behaving oddly

Adam's icon

I'm working on a patch for Push that will help me modify midi pitches as they come in so that I can select among lots of modes but use the same fingerings. For instance - modifying the E in a Cmaj scale to be Eb but fingered as an E. The end goal is to play bi-modally. I'm off to a pretty good start, but I'm encountering a weird behavior with gswitch2.

When it switches to the right side, it doesn't send out the pitch value I want. Instead, it waits until it goes to the left side and then changes the number up or down by one. I know that's not a terribly clear description, so here's the relevant section of the patch as it is so far. If someone can help, I'd really appreciate it.

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

Thanks,
Adam

Christopher Dobrian's icon

You have a message ordering bug in your patch. The pitch value goes to the right inlet of Gswitch before the conditional test result from the == object switches the outlet. Try using a t object to enforce the desired message order.

Adam's icon

Thanks very much. I used [t i i] before the [% 12] and it's working now.