I need help from the hive mind. For those of you familiar with Reaktor's Limelite 2, I'm trying to make something like the remix function in Max to use in conjunction with my hardware sequencer. What this means is that I want to always have the previous bar of MIDI notes in a buffer, and to be able to play back that bar in a non-linear order in sync with the hardware. It needs to be polyphonic. The hardware sequencer has a resolution of 48 ppq.
So...I've got the rtin 248 messages feeding a counter that is counting to 96, feeding a timer, to get the tempo. This seems to produce a more stable tempo than doing it by smaller intervals. This tempo is fed into a transport object.
That tempo is triggering a metro object counting 10 ticks, to match the resolution of the hardware sequencer. I'm counting 192 of these with a counter and using them as an address to pair with the incoming notes (via midiparser) and storing them in a coll.
Here are my problems:
I'm packing multiple notes into a list via a thresh object on the output of the parser, so that multiple notes at the same time index get correctly stored as "simultaneous". The contents of the thresh are fed into the second input of a pack; the first input is the output of my 1/192nd counter. I need to make sure that the contents of the pack are cleared after a note, though, so that event-free time intervals are written as blank (rather than a repeat of the events of the previous interval). I was trying to do this by having any output from the pack object also feed a series of zeroes message into the second input of the pack, but this is not working as I think it should.
That is, my understanding of the timing involved is this:
The output from the counter feeds the left input of the pack object. This triggers the output from the pack. This triggered output message should then feed out to each item connected to the pack output in a right-to-left order.
This does not seem to be what's happening. If I attach a print object to the pack output, the message that reaches the print object seems to depend on its placement. If it's to the left of the "0 0 0 0 0 0" message, the message the print object receives is "index 0 0 0 0 0 0", and if it's to the right of the message object, it receives the correct events (say, 42 64 127 36 127). But the "0 0 0 0 0 0" message is fed to the second input of the pack object; it should not be triggering any output. And even if it did trigger output, then both messages should be reaching the print object, but they are not. Only the "cleared" message is printing.
So, am I correct in thinking that is a glitch? That should not be happening, right?
Second, how do I get this working properly? Even when the coll object is in the right place, (so that the messages have the right contents), it still seems to drop a note every bar or two. I tried delaying the output of the "0 0 0 0 0 0" message a millisecond, but that didn't work.
Third, there's gotta be a better way.
(I'm not including my patch because I'm at work).