trouble with custom sequencer
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).
Here’s the file.
I’m not 100% sure what you’re asking for but here is a patch that might help you. It stores values in the [coll] at the time index they appear and blocks all single value input (as if you were trying to recall data). If you want it to only remember the previous bar then you’ll need to trigger the "clear" message otherwise it will keep on storing on top of the existing contents. I hope it helps, if its not what you were looking for then apologies.
----------begin_max5_patcher---------- 867.3ocyXtsaaBCFG+ZxSgG61tJrw1P1jlzdA1KvzTEI3k5IvDANcospu6yG fbpKfahKrKBQ1ww7+6GemLOOKHbQ0VVSH3yfe.BBddVPfYJ8DAsiCBKy1trH qwrrPA6OUK9c3M1eRx1JMS2vJ.QcytNSt7dtX0c0rkR6lSH2FcC.Fi0eES0W QQ2FA9Y6e4WUBoHqjY1ruUyyJ51LwlRtnfIM2dz9Iq1HOcV8lzvexrIPj5dX mlma1Ukr+DB0ss1+t7w0Lq.CWjIVEdCHLD7S8JdY1L8katNrrtlKj8fETRKJ hMbAeobA9O4RjybARCu.idYUYIau8sypqYMLIf8.q9Qvhr5dr+jTiaAwPg4v Iy7i8o4K4kL.Wjy1ptBtmUy9POH.adzSM1NLZ9Tg.hOIPIOmCDURViKDHNd9 9rBPX7Tg.zkffEajxJwvY9H6x4chw4fI.esVmG2ehLelDSBVVv5MLt0FsQyX O+.D57Cv4vyBEqE3Sprrpnv5i2W98nnCxuS8bBNryjII5rjwTyq6yNc0j8P2 B9320+j1b0e2Zwfvub7hyuSceT18cYRYMWEUXaqHXGTCBYkKXFIEYlv7X3M+ vXiZS5yUDkR2mLgD4Wf6diFTxYAtoif2gvzUYRF.NryXWXJ1uMg4dXJL87Ni 9DHe0IZPrsdgtkLQzneOEeBjmJ.ELgCLI1jnJd9T0lND2e5pKBJkrllrUrWQ EZDfhAzj93Bx5jXBbH1dVSGeWEZz3D3rtlslIxApt3GFJ1hZI3opnOg5anLT IFHwXrTzzVhAmL5kXjZWBfJKxvzo8nLThewSr6MCdV5XbqulLImgNYq0QMCi lzDiiCbphXvNFvXzUXAWb5aHxXZ54OlQMUapW1sUcusEvdyKm0H4hLIWcdo8 KReRlCVz877bl3vCtoNL45JkGcqHNySLW0jt4iA0Dj91zDR4raZevlLHkraz UpVcF+AUKgNpDTm2YPMgGWI4he135l4hjzs9MhZRS.zPRBO5RBNjjROZQCJI n5DfD8wbrkdhw6F4Aw5Y+dHM1ntXSuDPr8UfcznTa4T6B0CtRq3jrEdwLP1i O4aodR7QOtG+mU+HIZbihfuCZhhOrj1AE3tVwF6RxZ3nBPJ4cnLKZtoM.6wE aiPHomvO0fWl8WvbOODj -----------end_max5_patcher-----------
That might solve the conflict I was experiencing, thank you. (Every time I post here I’m vaguely embarrassed by the ease of the solution, but I know it’s just that I need another set of eyes on the problem because I’m stuck looking at things one way.)