Forums > MaxMSP

trouble with custom sequencer

March 16, 2009 | 8:52 pm

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).


March 17, 2009 | 1:30 am

Here’s the file.


March 17, 2009 | 2:58 am

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.

lh

– Pasted Max Patch, click to expand. –

March 17, 2009 | 4:18 am

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.)


Viewing 4 posts - 1 through 4 (of 4 total)