Primary sequencer with duration

D. Vyd
D. Vyd Member Posts: 21 Member

I keep running into this same problem and have never been able to solve it correctly. What is the proper way of using the built-in primary (not core) multiplex 16-step sequencer with variable step duration? I'm using song position —> modulo --> step position and then sending the output value back to modulo. That doesn't work right. It causes an event loop and once you solve that, the position jumps with the duration change. So…some kind of counter?

Tagged:

Answers

  • colB
    colB Member Posts: 953 Guru

    Looking at that module, I wouldn't be trying to use it for a sequencer that:

    A: needs to be addressable via modulo arithmetic on the song position

    and

    B: must allow variable step lengths.

    Obviously, any sane builder would do this in core ;).

    …if I was forced to do it using Primary, the first thing that comes to mind is to use iterators and event tables.

    Two tables

    one with entries per step for length, pitch and whatever else…

    the other would have an entry per song tick (or some division thereof), so e,g, a four tick step would take up four entries in this table. These entries would reference the first table… and maybe also have some bookkeeping stuff like step 'this is the first tick for this step…. or the third tick… that way it's easier to work out if we need to open a gate, or leave it be…

    Each time the sequence is edited, I would rebuild the second table, so that it keeps up with any changes to step lengths, or sequence length, during this process, I would recalculate the overall length. This tick length is the value to use for the modulo arithmetic (this seems like a heavyweight process, but it only happens when the sequence is edited, so it's really not costly if implemented correctly - probably can get most of it to occur on the GUI thread!)

    So to play back, its a pretty tight process, just a couple of table lookups. You just go songPos % numTicks, then use that as the index to the second table, you'll get back the step number (to lookup the first table for note value, velocity etc.), and how far through the current step you are.

    Stuff like this is much easier to build an maintain in core, but definitely feasible in Primary. Not sure how you would do it with a 'multiplex 16-step sequencer' though.

    There will be other - possibly better - ways to achieve the same result for sure.

  • D. Vyd
    D. Vyd Member Posts: 21 Member
    edited October 4

    Thanks @colB. I've tried a few more approaches. This setup based on Basic Sequencers in Reaktor (youtube.com) seems to work, but I need to add the MIDI out and also send the note off events, perhaps delaying the pitch based on the duration output…

  • colB
    colB Member Posts: 953 Guru

    That's a different thing. No requirement for song position. A basic trigger driven sequencer like that is relatively simple. Just count the triggers per step.

    I assumed the song position was a requirement - you wouldn't be using that unless it was essential ;-)

Back To Top