Teletype: MARKOV SequencerS (TT+Txi)

Hi guys, I finished working on something i had in mind since TELETYPE Txi & Txo creation announcement (deep thanks to @bpcmusic for that…). I have been able to go further with the new 2.0 firmware BETA (so now thanks to @sam).

Markov Sequencer X5

Only Txi is required.

What it does: Generate random notes CV (+ associated trigger) influenced by Markov chains. The result is kind of a “controlled” random note generator. You can record a sequence and then make the TT play it (you will also be able to modify parts of it). I added other functions described bellow.

Notes are stocked in P.N 0. You can input 5 groups of notes (so first group will be from P.I 0 to 4, second one from P.I 5 to 9 etc…).

P.N 1 is for following note probabilities. It works like this:

0 Probability for note 1 to play note 1
0 Probability for note 1 to play note 2
0 Probability for note 1 to play note 3
0 Probability for note 1 to play note 4
0 Probability for note 1 to play note 5
0 Probability for note 2 to play note 1
0 Probability for note 2 to play note 2
0 Probability for note 2 to play note 3
0 Probability for note 2 to play note 4
0 Probability for note 2 to play note 5
0 Probability for note 3 to play note 1
0 Probability fro note 3 to play note 2

ETC…

You got to choose a value between 0 and 100 for each note (i already did something for the lazy ones). TT will successively read each value, throw dice, if the result is negative the note isn’t selected and TT it will jump to the next probability. If the result is positive it will jump to the new note.


INPUTS

The only thing you need to do is triggering PAGE 1 with a steady clock.


PARAM: Toggles RECORD when knob isn’t fully CCW. You can adjust loop length by modifying P.N 3 and P.N 4 (but they got to be the same length) .

TI.PARAM 1: Switches from RANDOM mode to LOOP mode (and play previously recorded sequence) when fully CCW.

TI.PARAM 2: Changes SCALE (5 positions so you up to 5 groups of 5 notes).

TI.PARAM 3: Adds variation to recorded pattern when in LOOP mode. There is 0% chances for variations to appear when fully CCW, 63% when full CW :yum:. You absolutely got to set back the knob fully CCW when in RANDOM mode.

TI.PARAM 4: Note apparition PROBABILITY when in RANDOM mode, 0% when fully CCW, 100% when full CW.


OUTPUTS

TR A: Note trigger
TR B is just a visual feedback of the recorded loop when in RANDOM mode.
TR D: Output a trigger at the beginning of the sequence (for sync duties)
CV 1: Note CV


I uploaded a short demo video on my instagram account:
https://www.instagram.com/p/BUXTcUrAaX1/?taken-by=martinmestres

MARKOV SEQUENCER V2

N1=0 4    N2=5 9   N3=10 14
N4=15 19  N5=20 25

PRM: RECORD
TI.P1: 1=MARKOV 0=SEQ
TI.P2: CHANGE P.N 0 SCALE 
  5 MAX : 0-4 5-9 10-14 ETC...
TI.P3: REQ VARIATION AMOUNT
TI.P4: MARKOV TRI PROBABILITY

TR 1 : TRIGGER 
CV 1: NOTE

TR 2 IS FOR VISUAL FEEDBACK 
ONLY (WHEN IN MARKOV MODE)



#1
IF ! TI.PRM 3: A >> TI.PRM 1 8
PROB RSH TI.PRM 3 8: A RAND 2
IF GT A 0: SCRIPT 2
IF EQ A 0: T 1
ELSE: T 2
L 6 7: SCRIPT I

#2
PROB / TI.PRM 4 163: SCRIPT 3
DEL 1: A 0
B QT TI.PRM 2 5

#3
P.N 0
SCRIPT 4
CV 1 N P.HERE
TR.PULSE 1
X - P.I B
O 0

#4
P.N 1
P.I MUL X 5
IF GT P.I 24: P.I / P.I B
SUB O 1
L 1 5: SCRIPT 5

#5
P.N 1
Y O
Z P.HERE
IF GT Y 0: P.I ADD P.I 1
P.N 0
PROB Z: P.I + - Y 1 B

#6
IF NZ >> PRM 8: D 1
ELSE: D 0
P.N 2
P.NEXT
IF == D 1: P.HERE TR 1
IF NZ P.HERE: TR.PULSE T

#7
P.N 3
P.NEXT
IF == D 1: P.HERE ADD X B
C P.HERE
IF == A 0: SCRIPT 8

#8
P.N 0
P.I C
CV 1 N P.HERE

#M
M 30
P.N 4
IF EQ P.I 0: TR.PULSE 4
TI.PRM.MAP 2 0 25

#I
O 0
O.MIN 0
O.MAX 5
M.ACT 1
L 1 4: TO.TR.TIME I 25
X P.I

#P
41	64	64	64
1	1	1	1
0	0	0	0
43	24	15	15

0	20	1	0
4	50	1	1
7	50	1	2
11	0	1	2
12	20	1	2
0	0	0	0
3	0	0	4
7	80	0	0
10	0	1	1
12	0	0	1
0	50	0	1
2	0	0	1
3	0	1	0
7	0	1	0
9	0	1	0
0	50	1	0
4	0	0	2
12	0	0	3
13	0	0	3
16	0	0	3
0	50	1	3
0	0	1	3
0	0	1	2
0	50	1	2
0	0	1	3
0	0	0	2
0	0	0	2
0	0	1	2
0	0	1	3
0	0	1	2
0	0	0	2
0	0	0	3
0	0	1	3
0	0	0	3
0	0	1	2
0	0	0	2
0	0	1	2
0	0	0	2
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	3
0	0	1	3
0	0	0	3
0	0	0	3
0	0	1	3
0	0	1	3
0	0	1	3
0	0	0	3
0	0	0	3
0	0	1	3
0	0	1	3
0	0	0	0
0	0	0	0
0	0	0	0

Let me know if you need other informations.
:slight_smile:


PS: You can download the file here:
tt00.txt (1.6 KB)

10 Likes

This is really, really fantastic! I can’t wait to get back to the states and explore it!!

Thanks so much for sharing!

1 Like

That looks awesome. I love the idea of getting Markov chains in there.

If I may…

L 6 7: SCRIPT I could be changed to SCRIPT 6; SCRIPT 7 (it’s more chars though)

In fact if you wanted to fit even more “script” in, you could make a lot of use of sub commands. (They work brilliantly with loops and if statements.)

Other tricks…, there are PN. versions of everything now, e.g. PN.NEXT 1, although I think for this script, it’s better done as you have with P.N early in each script.

Thank you for the tips, they are more than welcome! I will try to optimise the code later, every line saved means additional functions (using the clock divider of TO is tempting).

In fact if you wanted to fit even more “script” in, you could make a lot of use of sub commands. (They work brilliantly with loops and if statements.)

Sorry i don’t really understand what you mean, could you give me an little exemple plz?

Here is the original thread

It’s my favourite new feature in 2.0.

Basically, you can write multiple lines of code on one line, just separated with a ;.

So your script I can become:

O 0; O.MIN 0; O.MAX 5
M.ACT 1; X P.I
L 1 4: TO.TR.TIME I 25

Where things get more interesting…

Do multiple things in a single IF statement.

IF X: TR.P 1; TR.P 2

delays:

DEL 5: TR.P 1; TR.P 2

Loops can do multiple things too…

4 Likes

OMFG :astonished: My brain just exploded, how did i missed that addition… I can now add a tons of new functions, that is so cool.

3 Likes

Yeah, I really need to add a “what’s new in 2.0” style section to the beginning of the documentation…

5 Likes