Sequencing/Automating Large Blocks of Code?

I'm curious what the best ways might be to sequence blocks of code. I typically work like this:

do -- MAIN
  let bassPat = ...
  let mainPat = ...
  bpm ... 
  d1 ...
  d2 $ stack [ ...

This block usually gets quite large. I inevitably later copy and paste the whole block and modify it into an "INTRO" part, "OUTRO" part, etc. It's at this point that I'd like to start experimenting with song structure, in a repeatable way, without improvising it.

Is there a way to sequence these blocks of code? They don't seem to fit in well with the seqP world, do they? I'm curious if I'd have to rethink how I write these blocks if I want to later sequence them, or if there's a method for doing that currently.

Thanks all!

PS: Ideally I'd love a way to just throw these large do blocks into another container and say something like "play this first one for 55 cycles, then go onto the next one", etc.

I'm not sure how helpful this will be, but for the last marathon I was executing multiple large blocks of seqP and seqPLoop. I was attempting to replicate a fairly straightahead jazz form, along with intro/solos and outros.
I also found that vscode executes on these blocks far quicker than nvim - something to do with the tidal shell output I think, but vscode was far easier to be accurate with my timing.
Here's the code
Here's the video

Since then I've dug a lot more into the capabilities of ur which I have tended to use since (albeit sparingly, meticulously composing these tunes is not really what I'm enjoying tbh :stuck_out_tongue: )
Here's a large ur example (mostly thanks to @kit-christopher )

1 Like

To me, this sounds like the case for seqP where each pattern could be a composition of patterns through ur.

I think I have been doing something similar to yours in that I have a bunch of do blocks in which I define a bunch of patterns and I send their composition to an orbit. That is

-- rhythmic section
do
    let pats = ...
    d1 $ ur [...]

do
-- melodic section
   let morePats = ...
   d2 $ ur [...]

yet I have to code intro/outro myself, therefore it is not fully replicable.

What I have in mind (and I will try) is

do
    let pats     = [...]
        morePats = [...]
        intro    = ur [...]
        verse    = ur [...]
    d1 $ qtrigger 1 $ seqP [
        (0, 55, intro),
        (56, 142, verse),
        .... 
    ]
2 Likes

FWIW, I've been demoing some songs this month and recorded my rhythm tracks using tidal. Each part/sound/pattern had its own variable which I lined up in a stack like so:

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bass, synth]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassV, synthV]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassCH, synthCH]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassCH2, synthCH2]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassINT, synthINT]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassV, synthV]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassCH, synthCH]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassCH2, synthCH2]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassINT, synthINT]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bass, synth]

d1 $ stack [ feel, snare2, cbell, stick, kick2, hat, snr2, bassBR, synthBR]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassCH, synthCH]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassCH2, synthCH2]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassCHTAG, synthCHTAG]

d1 $ stack [ feel, snare2, cbell, stick, kick, hat, snr, bassCH, synthCH]

1 Like

Thanks @cleary . It was helpful to see how you laid out your seqP code. Your use of stacks makes it feel easier for me to modify my current code, so thanks for that.

@mattia.paterna -- I'd never thought to use ur in addition to seqP. interesting! trying to wrap my head around this approach...

Thanks @trvrxtr . That's essentially how I'm doing it now I think. It works well but relies on manually changing the block of code, yeah?

It occurs to me that I should just improvise these changes (as I currently am), as that's what Tidal is best at really. But I've always used Tidal as a studio tool so there are times that I'd like a repeatable structure as well. I feel like if this part is tackled then it's the best of both worlds.

2 Likes