[Sorted] zl weirdness
Posted: Sun Feb 14, 2010 7:36 am
I'm running into an oddity in my patch, surrounding the zl join object. Basically, I'm observing a button matrix and converting the xy coordinates into MIDI notes. I know this isn't a difficult task for most of you, but I thought there was no better way for me to learn than to dive right in.
Now, on to the oddity. The matrix I'm observing sends out a list in this format:
1 7 7 1 - Converts to MIDI note 63 on
0 7 7 1 - Converts to MIDI note 63 off
I've got the conversion part down, but I want to also trigger a velocity value with the note on data. To do this, along with the conversion, I route the list to an unpack so I can do what I wish with each individual value. The first number in the list above is the note on data. 1 = note on, 0 = note off. I send this from the appropriate outlet of the unpack to the left inlet of a select 1 object. The left outlet of the select 1 object is then routed to the left inlet of a message object (100). The left outlet of the 100 message is then sent to a zl join object, along with the right outlet of the select 1 object which is sending a 0.
In short, observing the output of the zl join should create a new list:
63 100 - note on
63 0 - note off
However, this is not the case. For some reason, the 0 is being triggered with the note on message (1), and the 100 is being triggered with the note off message (0). At first I thought it had something to do with the select object, but after observing the output at each stage, I found the switch taking place after the data is passed to the zl object.
What's even more strange is if I create separate unpack objects (one for the xy conversion and one for note on/off velocity value) the behavior goes back to normal, or at least what I expect to be the normal operation.
I could just accept this oddity and be happy with a working patch, but it's driving me crazy that the different routes are sending the exact same information and outputting different results.
Any ideas?
Now, on to the oddity. The matrix I'm observing sends out a list in this format:
1 7 7 1 - Converts to MIDI note 63 on
0 7 7 1 - Converts to MIDI note 63 off
I've got the conversion part down, but I want to also trigger a velocity value with the note on data. To do this, along with the conversion, I route the list to an unpack so I can do what I wish with each individual value. The first number in the list above is the note on data. 1 = note on, 0 = note off. I send this from the appropriate outlet of the unpack to the left inlet of a select 1 object. The left outlet of the select 1 object is then routed to the left inlet of a message object (100). The left outlet of the 100 message is then sent to a zl join object, along with the right outlet of the select 1 object which is sending a 0.
In short, observing the output of the zl join should create a new list:
63 100 - note on
63 0 - note off
However, this is not the case. For some reason, the 0 is being triggered with the note on message (1), and the 100 is being triggered with the note off message (0). At first I thought it had something to do with the select object, but after observing the output at each stage, I found the switch taking place after the data is passed to the zl object.
What's even more strange is if I create separate unpack objects (one for the xy conversion and one for note on/off velocity value) the behavior goes back to normal, or at least what I expect to be the normal operation.
I could just accept this oddity and be happy with a working patch, but it's driving me crazy that the different routes are sending the exact same information and outputting different results.
Any ideas?