ez fix for double bang

richhop's icon

Hi, I've made a little fix for my patch and logic seems fine in my mind, but works but is a step behind itself for some reason.

I'm triggering a chord with one midi note, midi in goes to select but double bangs when key is pressed, so I've tried to only allow it through when the velocity is over 0 and flushes when velocity reaches 0. It works as intended with one bug, for some reason when you press a different note it plays the same chord, when you press again it updates, not sure why it's happening.

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

`

Anyone know a fix for this?

brendan mccloskey's icon

Hi
I glanced at your patch, without trying too hard to interpret the algorithm; two things occur to me, from the vague mists of time; remember that when note number and velocity are paired, velocity comes first AFAIR, Also, look at [onebang].

HTH

Brendan

richhop's icon

Wicked thanks just tried with one bang and works with onebang after the select for some reason, and passing the note value straight to select, but using an if out of velocity to trigger the gate on onebang if it's non zero. The exact same logic I made my patch with, not sure why it works this way round. Thank you very much for steering me in the right direction!

richhop's icon

Seems like such a dirty fix using a shed load of onebangs:

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

`

Maybe it's just me, but I really don't think this is most effective way of doing things, I thought I had a sexy method in my OP. Not too keen on using a million different objects to do the same thing, that's why I tried to reduce it to the two if statements in the original patch I posted and do the calculation to get rig of the extra bang before going in to select. If you do it after the select you have to repeat objects that do the exact same process, like in the patch above which seems an obtuse way to solve this problem.

Vjacobs's icon

Hello,

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

this little patch only checks for note-ons (=velocity > 0). Maybe this helps...

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

Here's another variation, using [swap]... Like Brendan mentioned your chords are sounding one step behind because the velocity is triggering your [if] before the noteon value reaches the if statement.
Also I'm not sure your [select] is setup correctly. Did you intend for [coll V Dom] to be triggered by the "input doesn't match" outlet of [select]?

richhop's icon

Thank you so much guys, that's brilliant, two simple and elegant solutions, you've saved me so many wires and objects! "velocity is triggering your [if] before the noteon value reaches the if statement." - these are the kind of bugs that I find difficult to unravel, hopefully I'll be zen with it one day! Thank you so much for you help :)

..and of course you are right Rick, I made a silly mistake in that patch out of select, my bad!

btw is there any particular reason the names in the coll have quotation marks? Does that have a specific effect?

EDIT- "remember that when note number and velocity are paired, velocity comes first " re-read that statement, now face palming.

Rick's icon

Without the quotes coll attempts to load V or I7 etc.. instead of V Dom or I7 Major. It doesn't recognize the space as part of the name.

Jonah Bitautas's icon

It's been awhile since there's been any responses here and wanted to update this thread with a much easier solve that's less messy in case anyone hits this thread via search engine.

If you place a `stripnote` object between `notein` and the next step in your signal path (which would most likely be `mtof`). That will remove the double bang that happens when you press your MIDI key (on bang) and release (off bang).

Hope this helps someone looking for this answer!