Easiest way to route dynamic lists
I'm creating a patch which will convert MIDI notes to the last played notes for being able to play tremolos with both hands. I want to be able to modify the keys which will trigger the last played note (or chord) from the interface (I'd like to have 1, 2 or 3 keys for the left hand as well as for the right hand, but I want to be able to change my set-up easily). Therefore, I need to find a way to route MIDI notes from a list that can vary in number of integers and in the integers themselves.
Ex : I select MIDI notes 0, 1, 2, 125, 126 and 127 for the "tremolo" keys. Every time the patch receives one of the notes it will play the last played note instead of the original.
How can I route these variables? I can't seem to find any object which routes dynamically...I've seen xroute from older threads but apparently not available for mac...
that sounds like a job for [split]
For some reason [zl stream] pops into my head.
That is not going to be that long list .
I would reserve up to 10 possible values,
use simple route object to replace values in use
and set rest of the route members to something like -1 - so they get ignored.
Passed velocity would then retrigger held notes.
zl.sect
@Bill 2 : yes, zl.stream is good for creating the list, but I'm looking for a way to compare this list to the played midi notes for either playing the dry note as-is or playing the last played note again.
@Source Audio : that's exactly what I did in the mean time (except with select and cycle for distributing the list to the select object) but I'd rather leave the possibility of having any number of keys if possible, plus I'm simply curious to know what to do in this situation in case I really do need a possibly infinite number of arguments in future situations. :)
@Double UG : zl.sect would've been perfect if it was doing the opposite, that is banging on input matching and outputting the non-matches, just like select object. I need to keep the "dry notes" values.
Since I definitely have only two splits to do, I decided to go with Roman's suggestion. This leaves me with the possibility of any number of keys triggering the tremolo and is also pretty elegant. Here's the patch in case you're curious (it's with M4L).
Thank you all for your help! :)
It is allways interesting and helpful to see all possible
solutions and compare them.
We all learn from that.
zl.sect would be a perfect companion with zl.filter
and more effective than 2 split objects, but I prefer route because of
separated stream of velocities, which might become important
depending on usage of split notes.
But at the end what counts is to have it work as it should
or at least how one imagines it should.
Here is a better splitter without route, passing
only notes:
I mistakenly thought you wanted to tremolo currently held notes,
the way you did it it is not possible to hold few keys,
do tremolo, change keys in between etc. because of stripnote.
But one can tremolo last collected notes even if no notes are held.
Aah, nice! The combination of zl.sect and zl.filter is the answer to my original question. This will be very useful to know. :)
And yes, for the tremolo triggering, I feel like it makes more sense to trigger the last played note (or chord, easily programmed with the thresh object) because that way I don't have to worry about keeping the keys pressed down for the tremolo notes to trigger (releasing them too early would make the "trigger keys" trigger nothing). Anyway, it seems to work perfectly fine, both for one notes or chords, but like you said it's good to see all possible solutions.
Cheers.