How do I get a list of currently held midi notes?

Oct 7, 2012 at 12:17am

How do I get a list of currently held midi notes?

Title pretty much explains it. I’ve tried rigging the poly object and routing it so that it makes a list and zl.filters out any notes that are at less than 1 velocity, but this has too many problems and isn’t worth posting here.

This is what I want it to do: any time the object gets a midi note or set of midi notes, send it to the output as a list. Order doesn’t matter. The list’s size has to be the same as the number of notes currently held down. Velocity is disregarded, but it’s probably useful for deciding when the notes are going to be on the list.

#64637
Oct 7, 2012 at 12:55am

The [borax] object may be useful for this.

#233200
Oct 7, 2012 at 2:11am

I don’t think Borax will do the job here, it can’t easily give you a list of held notes and it cant deal with different midi channels.

Here are two examples one for collecting held note numbers and one for collecting held note number and midi channel which is really useful if you are using a controller which outputs multiple channels simultaneously. Don’t think I’ve ever used the bag object before or since this.

– Pasted Max Patch, click to expand. –
#233201
Oct 7, 2012 at 2:34am

dang, I was just putting the finishing touches on my rig using borax as you posted that! That setup you pasted is more attractive than mine though, and it will definitely be useful when I make the inevitable jump to multiple channels. Thank you very much.

#233202
Oct 7, 2012 at 3:05am

No worries, the multiple midi channel one is a bit hackish but it works fine. A more elegant solution would be to use Java or Java script.

I think I forgot to add a bang to the bag object in my first example, i’m sure you’ve worked it out but just bang it when you need the held notes out.

#233203
Oct 7, 2012 at 7:39am

I haven’t looked at leafcutter’s approach so this may be redundant and or inefficient:

– Pasted Max Patch, click to expand. –
#233204

You must be logged in to reply to this topic.