The way i’d tackle this is put the cumulative probability in the first column of the patterns, and the next column the Kria pattern to jump to. And then iterate down the rows. So it’s 30% jump to pattern 1, 60% pattern 2, 10% pattern 3. You’d have

30, 1
90, 2
100, 3

Draw X as a random [0,100], and iterate down the first column until the first col value exceeds the random draw, then pick the second col value from the preceding row.

You could then extend this to shift those two cols across one, and have the first column be the current playing Kria pattern, and then have different change probabilities for each currently playing pattern.

Implementation is left as an exercise for the reader :wink:

Given the original request of 50/35/15, would that translate to

PROB 50: KR.PAT 1; BREAK
PROB 70: KR.PAT 2; BREAK
KR.PAT 3

And can someone remind me how to format the code blocks? [ETA: Thanks @scanner_darkly!]

exactly!
for code blocks surround them with triple backticks

1 Like

Great. The only thing is - for this piece I need an IF before the PROB and TT wouldn’t let me do that. Maybe I can have a script for each possibility? Then IF x: Script x

you could do that or use RAND and include it in your IF condition:

IF && your_cond LT RAND 10 5: ...

since this likely won’t fit on one line you could do this instead:

I LT RAND 10 5
IF && I your_cond:

per the request of @misuba, the scene from my post in Latest tracks + videos

it’s a simple scene based on plaits’ chord mode. i don’t own a plaits but the manual kindly tells us what chords are available (i added sus2 at the end). i was externally using kria for root note sequencing (TT in), an attenuated lfo for chord quality (i only used minor triad, and minor 7, 9, 11) (TI.IN 1), and manually choosing voice distribution via PRM

As always, suggestions for refinement or if any glaring errors are present from quickly typing it out here, please let me know!

M: 
X >> TI.IN 1 10; A PN 0 X
B PN 1 X; C PN 2 X; D PN 3 X
IF < PRM V 2: C A; D B
ELIF < PRM V 6: D B
EVERY 9: CV 1 + V 1 RAND V 2

I: 
JF.MODE 1; JF.SHIFT N -2
JF.GOD 1; CV.SLEW 1 800

1:
TR.P 1
DEL 1: Z IN

2:
L 3 6: SCRIPT I

3:
JF.VOX 1 + Z N A V 3

4:
JF.VOX 2 + Z + 10 N B V 4

5:
JF.VOX 3 + Z N C V 4

6:
JF.VOX 4 + Z - N D 10 V 3

tracker:
0 0 12 12
0 0 7 7
0 5 7 12
0 3 7 12
0 3 7 10
0 3 10 14
0 3 10 17
0 4 9 14
0 4 7 14
0 4 7 11
0 4 7 12
0 2 7 12
8 Likes

If I understand you correctly, it sounds like you need a Markov matrix. Unfortunately it’s not straightforward to do in TT (come to think of it, I wonder how come no one has requested this feature yet). What I have done in the past is use the bottom portion of the tracker as a 4 x 4 matrix, where the 4 rows are your states, and the 4 columns are transition probabilities.
Alternatively, you can populate the rows with the next states (instead of their probability) and end up with a finite state machine.

1 Like

Well, I’ve managed to get it functioning as I wanted using a whole bunch of these, but it’s not elegant and it ties up 6 scripts. More to follow.

2 Likes

Thanks! I recall doing something along these lines when I was using TT everyday about 2 years ago but sadly my memory retention seems to be very poor. I need to keep better notes. I will research Markov Matrix.

Oh, sorry. I should have explained better:
A Markov matrix designates the probabilities of transitioning from the current state to any other state (or possibly staying in the current state). So if you’re in state k, you’ll refer to the k’th row of your matrix to figure out what to do next. The k’th row might be something like [ 0.1, 0.1, 0.2, 0.6] which means jump to state 1 with 10% chance, state 2 with 10%, state 3 with 20% and state 4 with 60%.
Entering the matrix in the tracker is straightforward. From there you’ll need a script that monitors your current state and decides where to go next according to the corresponding row of your matrix.
I hope this helps.

I reckon this ought to be possible using the patterns and two scripts. I might have a crack at it over the weekend.

This makes sense, thanks.
However, wouldn’t multiple PROB ops be needed for each lookup, anyway?
And moving forward… my current piece has 6 patterns in Kria and 3 in MP to move between which is already too much for the tracker to handle with only 3 columns. More complex pieces might be lurking…

Multiple probabilities is not too complicated. Say you’re in state Z. You can do something like:

X RAND 99
IF < X PN 0 Z: Z 0; do whatever else // switch state to 0 and do whatever you want there.
ELIF < X PN 1 Z: Z 1; ... // switch state to 1 ...
ELIF < X PN 2 Z: Z 2; ... // switch state to 2 ...
ELSE: Z 3; ...

PN j Z is the transition probability from state Z to state j.

I haven’t tried this, but I think it should work.

For more states, as long as from each state you only transition to 4 other states, you can still apply the above. Instead of a 4 x 4 matrix, you’ll have an N x 4 matrix.

EDIT: I just realized there is a bug in the snippet I wrote above. PM me if you want the details.

OK, that was easier, and simpler than I thought. One script. Here I’m setting A in lieu of KR.PAT for testing purposes. Col 0 in the patterns is the current state, col 1 is the cumulative probabilty of state transition, and col 2 the state you transition to. I’m using Y only to shorten the line length. This approach could easily be extended to have a second block of data to manage a second matrix.

#I
A 0

#1
X 0; Y A
Z RRAND 0 100
W < PN 0 X Y: X + X 1
W < PN 1 X Z: X + X 1
A PN 2 X

#P
8	8	6	0
1	1	1	1
0	0	0	0
63	63	63	63

0	30	1	0
0	60	2	0
0	100	3	0
1	50	1	0
1	100	2	0
2	100	3	0
3	60	0	0
3	100	1	0
3 Likes

I came up with a variation on your quantizer with a pattern note list, which handles octaves.

Y DIV V 1 4             // for a 4-note "scale"/chord
A DIV ADD VV 12 IN V 1  // A is the octave; a small offset added to make sure the shift is in the right place
Z MOD IN V 1            // look at the value within this specific octave
X DIV QT Z Y Y          // find pattern index
CV 1 ADD V A N PN 0 X   // look up note and add octave

The offset on line 2 might need to be adjusted depending on the scale or CV source; I determined it experimentally so it might vary.

I kind of want to try a “find the nearest pitch in the table” method, so if I set it for a blues scale and play a blues scale on a keyboard, I get what I expect instead of having notes shift out from under me. My first try was unsuccessful, but then I had only been playing with Teletype for about 2 hours at that point :smiley:

5 Likes

…and then it occurred to me on the way to work, I can use the same method but always have a scale length of 11, and just let the pattern do the mapping work. So that blues scale would be 0, 0, 3, 3, 5, 6, 7, 7, 10, 10, 12 (I think).

1 Like

didn’t want to pile up on TT-talk in the tracks thread, but I think individual ‘metronomes’ in the non-txo teletype setup can be done with recursive delays, right?

script 1:
TR.P 1
DEL 300: $ 1

script 2:
TR.P 2
DEL 310: $ 2

and in live, to kick it off:
$ 1; $ 2

6 Likes

True! Didn’t think of that.

I did something similar: i inserted a DEL 200: SCRIPT 1 and DEL 190: SCRIPT 2 at the end of script 1 and 2. Then i start them in sync by pressing f1 and f2 together (I don’t know why but it fucks the script pretty bad if i press f1 or f2 again when they’re looping, they start missing steps in the patterns and loosing the rythm).
Still i can’t insert differences smaller than 10ms between the two scripts so the phasing is still pretty fast!

I just finished something based on the M.U. Marbles. Suggestions of useful missing features are welcome :

tt13s.txt (1.7 KB)

In short:
PRM = clock speed
TI.PRM1 is a clock JITTER probability
TI.PRM2 fully CCW it creates random notes (with a V range defined by TI.PRM4). Turning the knob a bit CW will lock the notes and gradualy morph from random notes from the sequence to the locked one (once fully CW).
TI.PRM3 is the pattern Lenght (from 1 to 16 steps).
TI.PRM5 is the coin toss probability used to create TR 3 and 4 rhythms (with associated cv values linked to CV 1), be aware that the random/lock thing is global ( for TR 1 3 4 and CV 1 3 4).
Little add: once the sequence is locked you can play with the coin toss probability

GAME OF MARBLES
PRM: CLOCK FROM 0 TO 1000MS
TI.PRM 1: JITTER
TI.PRM 2: FCCW WRITE FCW READ
WITH GRADUAL INTERPOLATION
TI.PRM 3: P LENGHT 1 TO 16
TI.PRM 4: V RANGE
TI.PRM 5: COIN TOSS PROB



#1
I RSH TI.PRM 1 7
PROB I: Y RAND - X / X 9
PROB - 100 I: Y 0
DEL Y: SCRIPT 2
IF GT PN.I 0 A: PN.I 0 0

#2
Z RAND TI.PRM 4;
IF EZ D: CV 1 VV Z
TR.P 1; PN.NEXT 0;
IF EZ D: PN.HERE 0 Z
IF NZ D: SCRIPT 3
SCRIPT 4

#3
I 1
PROB - 100 / D 10: I 0
IF EQ I 0: PN.I 0 RAND A
T PN.HERE 0
CV 1 VV T;

#4
B 3; PN.NEXT 2;
PROB TI.PRM 5: B 4
IF EZ D: PN.HERE 2 B
IF EZ D: CV B CV 1
IF EZ D: TR.P B
IF NZ D: SCRIPT 5

#5
IF EQ PN.HERE 2 3: SCRIPT 6
ELSE: SCRIPT 7

#6
I 1
PROB - 100 / D 10: I 0
IF NZ I: TR.P PN.HERE 2
ELSE: TR.P B
CV 3 CV 1

#7
I 1
PROB - 100 / D 10: I 0
IF NZ I: TR.P PN.HERE 2
ELSE: TR.P B
CV 4 CV 1

#8

#M
IF EZ PN.I 2: TR.P 2
TI.PRM.MAP 1 0 12850
A >> TI.PRM 3 10
L 0 3: PN.END I A
X >> PRM 4; M X; D TI.PRM 2;
SCRIPT 1

#I
TI.PRM.MAP 4 0 800
TI.PRM.MAP 2 0 1000
TI.PRM.MAP 5 0 100
L 1 4: TR.TIME I 20
M 200; M.ACT 1
L 0 3: PN.I I 0

#P
64	64	64	64
1	1	1	1
0	0	0	0
15	15	15	15

197	0	3	0
1	0	3	0
72	0	3	0
378	0	3	0
365	0	3	0
158	0	3	0
170	0	3	0
328	0	4	0
347	0	3	0
166	0	3	0
207	0	4	0
46	0	3	0
232	0	3	0
212	0	4	0
43	0	4	0
159	0	4	0
67	0	3	0
158	0	3	0
265	0	3	0
204	0	3	0
317	0	3	0
26	0	3	0
62	0	3	0
2	0	3	0
58	0	3	0
66	0	3	0
314	0	3	0
240	0	3	0
156	0	3	0
28	0	3	0
285	0	3	0
162	0	3	0
100	0	3	0
284	0	3	0
169	0	3	0
137	0	3	0
271	0	3	0
233	0	3	0
300	0	3	0
276	0	3	0
141	0	3	0
111	0	3	0
246	0	3	0
27	0	3	0
309	0	3	0
258	0	3	0
243	0	3	0
300	0	3	0
242	0	3	0
42	0	3	0
264	0	3	0
258	0	3	0
229	0	3	0
251	0	3	0
164	0	3	0
214	0	3	0
458	0	3	0
46	0	3	0
341	0	3	0
295	0	3	0
334	0	3	0
501	0	3	0
317	0	3	0
336	0	3	0

Cheers :sunglasses:

21 Likes