Another option is to encode rhythms in binary. A single variable will give you a 16-step rhythm, and you don’t even need to store the current step anywhere. For instance:

1010100101010000 = 43344

And then on each step, check the leftmost bit and rotate left.

1:
B BGET A 16
A ADD B LSH A 1
IF B: $2

(Code not tested, just theory.)

26 Likes

wow THIS is BRILLIANT

As an addendum to this, have you figured out a way to make LSH, RSH ops that wrap around?

Another neat tip is the O+C hemisphere applet has a sequencer that utilizes a similar bit sequencer for 4 steps at a time that you can manipulate with the turn of a knob.

wow i had no idea about this functionality! i’ve also been wondering about how to use rests and ties in TT sequences.

1 Like

I’ve never looked at the Teletype firmware, so nope. Combining an ADD (or a binary OR) and an LSH was my workaround for lack of a rotating shift.

1 Like

You can also just use one of the patterns to store step length: Pattern 0 holds note values, Pattern 1 holds step length in ticks of M, then do this in M:

P.N 1
IF GTE O P.HERE: Y 1; O 0
IF NZ Y: P.NEXT; P.N 0
IF NZ Y: CV 1 N P.NEXT; Y 0

I’m not entirely happy with this, maybe it could be done more elegantly. One could get rid of lines 1 and 3 by requiring that the patterns for step length and note values have to be of equal length (and then just access the second pattern via PN using the index from the first pattern), but I thought it’d be nicer if you could specify rhythm and notes independently if you wanted.

Thanks for all the awesome input folks.

The best I’d come up with was something like “magic numbers”, but kept in a separate pattern. Nothing wrong with that, but also didn’t want to take up that second pattern if necessary.

Love the binary idea as well. I may try tinkering with that tonight!

Is it possible to use patterns to call scripts? I’m not sure what this would look like, I’m guessing a M script that calls the SCRIPT with P.NEXT every so many ticks?

It should be! SCRIPT P.NEXT should call the script with number determined by the value of the pattern. I don’t know what will happen if you try and call it with a number outside 1–8, though

1 Like

I would actually be interested in implementing a variable that does this all for you if there’s interest.

Set would set the variable to a 16 or 32 bit binary string.

Get would return a 1 or 0 then perform a left/right shift and wrap on the string.

so I’m on day one with the TT and I think I’m getting the hang of most of it, however I don’t believe I’m thinking like the TT yet.

For example I’m using the M script to call other scripts say 1,2,3,4 one per voice (kick, snare, hat, synth).

M Script:

X ADD X 1
X WRAP X 1 16

an example for SCRIPT 1:

IF EQ X 1: TR.P 1
IF EQ X 3: TR.P 1
IF EQ X 11: TR.P 1
TR.TIME 1 500

I suppose this is ok for a 16 step pattern, but once I step outside to say 64 steps, going line by line will not work. I guess I could use OR however that only doubles my specified steps. There could be some MOD usage as well I haven’t gone there. My initial thoughts here are that this is a place for a pattern with 1, 3, 11, 17, 19, 27…

I think I should also move “globals” such as the TR.TIME 1 500 to the M script or I script?

From there I’m not immediately seeing how to activate the pulse based on the pattern…and I’m not even sure if this is the correct mode of thinking. I know I need to do something different because I’m hitting the 6 lines per script quickly.

It’s not very clear what you are trying to achieve. If you could explain what you want the Scene to do, we can help you get there. It’s likely that you will be able to get there in far fewer lines.

and that is another thing, right now my first thought is to use scenes as parts of the composition. Scene 1 is maybe the intro, Scene 2 a variating basic set of sequences for drums and voices etc. I’m not sure if this is the correct thinking as well. in this kind of thinking it almost seems like I would want/need to sequence the scenes…

in the example I posted I’m using SCRIPT 1 as a basic kick pattern, but I’m wanting to expand it out across 64 steps or maybe even 128

Have you looked at using the Pattern page to store your sequences? Also look into the ER euclidean rhythm op!

It seems like you may be thinking too linear and not enough algorithmic.

1 Like

That is where I’m hung up atm. I could fill up say pattern 0 with 1, 3, 11, 17, 19, 27…, the steps I want the kick to activate on, pseudo code might be:

if the current tick (x) is equal to the value in the current index, trigger the pulse, then increment to the next index ?

I have not checked ER rhythms in a bit, I had explored them a little with Tidal but never got the semi precise results im hoping for :frowning:

My suggestion is to assign the total length of the pattern first. Then write to the pattern the onsets (1, 3, 11) to their position in the pattern (0, 2, 10) [base 0]. Either as a 1 or 0 or CV value.

1 Like

I was going to suggest something like that – or what adrianf said, just use 0 and 1 in patterns and go forward every step. You’re limited by step length, but it’s easier to edit.

Alternately, as long as you keep your patterns to 16 bits, you can encode rhythms in binary:

IF BGET 1029 X: TR.P 1

Where’d 1029 come from? It’s bits 1, 3, and 11 set (unless I’m wrong and it’s 0, 2 and 10). You can use TT’s live mode to figure out the value:

A 0
BSET A 1
BSET A 3
BSET A 11
4 Likes

20 characters of :exploding_head:

2 Likes

Have you tried to encode a pattern to binary yet? Seems like a good way to record a quantized version of a live pattern for play back later.

I just tried it, and this works nicely:

M:
X WRAP + X 1 0 15
IF STATE 1: A BSET A X
IF BGET A X: TR.P 1

You can reset with an A 0 in live mode (or assign another script to do that, or add an IF STATE 2: A 0).

6 Likes