I have to admit I'm very fresh to PD, and most probably I did not really understand all of the concepts.
My idea is to split a sequence of key events received on one midi channel to several (random or round-robin) midi channel numbers.
The problem occurs with the noteOff events - there I need to recall the (random) channel-number the noteOn event was sent.
I thought of a list with 128 elements for each note number. Thus setting the channel number when receiving a noteOn Event, and when reveiving the noteOff the channel is read back from the list end send out.
That's working "almost" fine - for one note. But unfortunately the tabwrite object is getting the channel number on its left "hot" inlet just before the note-number is set. Probably because the PD handles the events for outlets from right to left, on the right most outlet the channel appears first, issuing the table writing just before the note-number is set on the right input of 'tabwrite'.
I stretch my head with triggers, routing, spigots, delay, but I can't find a way to alter the order of the inputs to get it working.
Below first - is a simple patch illustrating my problem. When pressing down the first key, the list will show the channel is set for note-number 0 (zero) instead of, e.g,, 44,, pressing the second note, e.g., 48, will store the current channel at list element 44 instead of 48 - thus the channels are always stored for the previous key event.
The second parch below shows what I was working on - including some debugging number-boxes and bangs.
Any idea or hint is highly welcome - thanks a lot
Lou