Teletype haiku

three haiku for building complex sequences from a few notes.
in all of the following haiku sequence is output on trigger/CV 1, and CV 2 is a bonus random CV.
pattern values use semitones, if you want to use absolute values just remove N from CV 1 N.

fractal haiku [demo]

T % + T 1 4; A P T
EVERY 4: Y % + Y 1 4
EVERY 4: A + A P Y
EVERY 2: X % + X 1 4
EVERY 2: A + A P X
CV 1 N A; TR.P 1; CV 2 RND V 5

pattern bank 0 values 0-3 are used as the main sequence, but 2 additional counters running at half and quarter of the speed use the same values to transpose.


mini orca haiku [demo]

I 0; CV 2 RND V 5
EVERY PN 1 0: I + I 1
EVERY PN 1 1: I + I 2
EVERY PN 1 2: I + I 3
EVERY PN 1 3: I + I 4
CV 1 N P % I 8; TR.P 1

similar concept to orca - combining gates running at different ratios to determine which note out of 8 to play. pattern bank 0 values 0-7 are notes, pattern bank 1 values 0-3 are ratios. also try playing with numbers in lines 2-5!


probability sequencer haiku [demo]

A 0; I RND 100; T % + T 1 8
IF GT I 90: A 3
ELIF GT I 70: A 2
ELIF GT I 40: A 1
CV 1 N PN A T; TR.P 1
@X A; @Y T; @SHOW 1

pattern values 0-7 are the sequence, but bank is selected randomly, with bank 0 given 40% probability, bank 1 - 30% etc. turtle is used to show which note is being played.

27 Likes

A very humble “humaniser” with kria.

Send a noise source to IN. If you don’t have a noise source substitute RAND for IN on line 1 and ignore the command on #I script. If you don’t have Just Friends on envelope duties swap JF.VTR for TR.P 1 on line 3 and send that to your preferred EG. Amount of ‘human’ can be adjusted with IN.SCALE range.

#I
IN.SCALE 0 100

#1
Y IN; D RAND 5
Z SCL 0 V 10 0 120 KR.CV 1
DEL Y: JF.VTR 1 V D
DEL Y: CV 1 N Z

2 Likes

you could use the knob as an attenuator for the input:

IN.SCALE 0 SCL 0 V 10 0 100 PRM

(haven’t tried that, i think it should fit). you’ll need to move this line to script 1.

2 Likes

I tried this idea right after posting… and I think that oneliner is just a bit too long sadly.
My way was:

#I
PARAM.SCALE 0 100

#1
IN.SCALE 0 PRM

1 Like

^ this has the additional benefit of being more readable too!

2 Likes

A binary arithmetic based scale quantiser. Uses a single 12 bit number to represent which semitones are allowed and snaps a note to the nearest lower note in the scale. Makes it super easy to change scales and chords on the fly using a single integer. So, for example, 1709 is a minor scale, 1 is just octaves, 137 is a minor triad etc. Here I have it quantising chaos in five lines of code:

#M 
X WRAP CHAOS 0 36
J BSET 0 % X 12; K 0
W EZ & J A: J RSH J 1
L 0 11: K ? BGET J I I K
X + * / X 12 12 K; CV 1 N X

The first line simply generates a stream of numbers, which can be changed with CHAOS.ALG and CHAOS.R on the fly. X is the note to be quantised. The next line strips out the octave information and converts the note into a 1-hot binary representation. So, 000000000001 is the first note in a chromatic scale, 000000000010 is the second and so on. The third line is one I’m proud of! A contains the scale information you’re quantising to as a 12-bit binary number. The while loop shifts the note lower by one semitone until it hits a “legal” note. The bitwise and operator is doing the magic here. It will be zero until the single note and the scale coincide somewhere. The next line is a crazy hack to convert the binary note representation back into a semitone value. The last line then adds back in the octave and plays the note!

46 Likes

Incredible! My equivalent quantizer needed two scripts and some pattern data. This is going to be fantastically useful.

This made me chuckle since I nest like:
X + K * 12 / X 12
but that’s probably just me mentally parenthesizing. PEMDAS has no place in Poland…

4 Likes

Thank you!

I’ve been using a “two script plus pattern” quantiser for a while now too but needed something more compact and I wanted to replicate the functionality of Marbles, which allows you to gradually add in notes to the scale at the turn of the knob. This led me eventually to this scheme. It means you can fill a pattern with multiple scales/chords, with one number representing a whole scale and then sequence through that slowly to make large scale musical changes. It’s really opened up much bigger compositional structures for me. Hope you find it useful too!

6 Likes

This is absolutely wonderful @SimonKirby

are these numbers sequences of semitones? so 1709 means C#GCA? Sorry if it’s a dumb question…

here you’re using the chaos generator to feed the x variable, but it’s possible to swap the chaos generator for other means to generate notes to be quantised, right? I’m thinking of signals from other modules of the system via the Input jack, for example.

Congratulations!

1 Like

That is both brilliant and beautiful! Very nice, @SimonKirby!

1 Like

No such thing as a dumb question! I’m using binary to store the whole scale in a single number, so a minor triad would be represented in binary as 000010001001 for example. The last 1 represents the first semitone (e.g. C), the fourth from last represents the fourth semitone (E flat) and the eighth from last represents the eighth semitone (G). This chord can therefore be represented as 10001001, which is 137 in decimal. 1709 in binary is 11010101101, which (if I’ve got my scales right!) represents a harmonic minor scale (C D E flat F G A B flat) reading right to left.

Hope this makes sense! All the numbers from 1 (just octaves) to 4095 (111111111111 in binary, and therefore all the notes!) are possible.

Yep! I’m going to try plugging an LFO into the IN jack next. Just replace CHAOS with IN. Although it might be better to use SCALE rather than WRAP in this case, like:

X SCALE 0 16383 0 36 IN

Or you could get X out of a sequence stored in the tracker with: X P O for example.

9 Likes

What a brilliant idea to store scale intervals in one binary value. Gamechanger!

2 Likes

thanks @SimonKirby. I got it! :slight_smile:

Looking forward to try this.

1 Like

Very new to Teletype, so pardon what might be a silly question: are “J” and “K” simply variables being set in the script? I’m having a hard time finding them in the list of commands

Yes, these are local variables that are being set in the script. “Local” here means that they can be used (and be different) in each script. This is in contrast with “global” variables like A or X etc., which are shared across all scripts. I think they may have been added in one of the later versions of the teletype firmware, but I’m not sure.

1 Like

Awesome work! I’ve used binary patterns and bit shifting for rhythmic patterns but never realized that they could also be used for quantization. Can’t wait to try this one out!

Also, I was unaware of the fact that you can mount the TT upside down. Might be an option for my current setup, although it would probably take a while to memorize the fliüüed layout of the inputs/outputs.

1 Like

I believe when you DEVICE.FLIP it reorders these so that the jack ordering remains the same left-to-right.

1 Like

yep, it will reorder inputs/outputs accordingly.

2 Likes

Perfect! I saw DEVICE.FLIP being mentioned in the changelog but didn’t have any idea what it does. I feel like I’m discovering something new about the Teletype on an almost daily basis, thanks to this forum and all the talented people involved in the firmware development :slightly_smiling_face:

Now I just have to figure out if it’s really worth flipping the TT and thus having to re-connect all the fiddly i2c stuff again :sweat_smile:

Flip your teletype! It’s so much better for anything other that a flat-on-the-table setup. I don’t know why you’d have it any other way. Though sometimes I feel like I’m the only one rocking it flipped!

(I should say, it takes a bit of getting used to having the param knob upside down… I probably ought to realign mine so the marker points where I’m expecting it to.)

2 Likes