Teletype haiku

is it meant to be `L 1 4`? unless you use ansible as a teletype expander in which case you can address 8 CV outputs with `CV x`.

you could also do `CV I V % O 4` and play with different increment values.

1 Like

I’d say `L 1 5` is an optimal starting point as it leaves one “cycle” of the loop out, and allows for the voltage values to dim a bit before the “cycle back” to the beginning. I hope it makes sense, it’s easier to see the effect in practice. Changing it to `L 1 4` makes it a shorter cycle and the movement isn’t as gentle, but it still works. Funnily enough an `L 1 6` makes the pattern stop, not sure why, the whole thing works in the same optical illusion way that car wheels can seem to go backwards while you’re on the road, some values make the pattern move backwards, so maybe `L 1 6` makes it stop.

Good point! Will try it out, seems like a fun thing to try.

1 Like

that’s because there are 6 possible values for `O` with your `O` settings, so a loop with 6 iterations will result in `O` having the same value at the end of the loop as it did before the loop.

Lil simple Haiku Jam that centers on a nice chord (arp) progession being switched a d with a bit of logic for octave jumps.

A single jf voice incrementally switches between 4 patterns of arps-- C, Eb G & Dm7. random seeded logic of the same incremental number determins whether the sequence will be transposed up by up to 3 octaves.

instruo Lúbadh, MAKEN0ISE Morphagene (in Time Lag Accumulation) and Mutable Instruments Clouds (Looping Delay) turn the single voice sequence into a thick melodic blanket.

``````
JF.MODE 1
O.MIN -1; O.MAX 3; O.INC 1

METRO

EVERY 8 A O; JF.VTR V 10
L 0 4: PN.START I 0
IF EQ O RND 3: JF.SHIFT V 1
ELIF RND 4: JF.SHIFT V O
ELSE: JF SHIFT V 0
JF.VOX 1 N PN.NEXT A V O

PATTERNS

0 4 7 2
4 7 11 5
7 11 14 9
12 16 19 12
``````
8 Likes

I’ve recently crafted a little Teletype poem I call the “Brain Age Theme Arpeggioid Generator” to learn how to use the Stack properly.

``````// M -----------------------
\$ 1                          // a clock

// 1 -----------------------
S: TR.P 1; CV 1 N DRUNK      // put a pulse and a CV on the stack
X ADD X 1                    // a typical counter
IF GT X 16: S.POP            // let the carnage begin !!
IF == X 32: S.CLR; X 0       // and stop it.
PROB 5: DRUNK RND 4          // reset DRUNK every once in a while
PROB 50: DRUNK; DRUNK; DRUNK // ( ^з^)ﾉ⌒♥*:･。.
``````

What this does is simple: quietly generate 16 stack commands to drive a voice, drop them all like a payload, rinse and repeat. Kinda like the speed-dial sounding arpeggio in the Brain Age theme, you know the one.

The second I tried the Studies out I instantly fell in love with Teletype and I’ve been slowly working my way to unlock its maximum potential. It really does have no limits as far as I’ve been able to toy with it.

11 Likes

Little morning Haiku routine!

Metro

``````A + 1 WRAP A 1 12
B + 1 WRAP B 1 9
IF EQ A B: C 1; M 200
ELSE: C 0; M RRND 190 200
TR.TIME 1 * A 10; TR.P 1 C
CV 1 QT.S N RRND A 24 0 7
``````

4 Likes

I’ve designed a small 4-verse haiku that’ll turn one of TT’s CV outs into a “Skewable Envelope Generator” (a la 4ms PEG) with some super-fast slewing.

``````// 1 ---------------------
PARAM.SCALE 0 Z; Z 500     // set Z to desired envelope length
X PARAM; Y ABS - X Z       // put PARAM on X and make Y its inverse, PARAM is now SKEW
CV.SLEW 4 X; CV 4 V 10     // arms slew to attack amount and begins rise
DEL X: CV.SLEW 4 Y; CV 4 0 // after attack is done, arm slew to release time and begin fall
``````

The working of this little script is as follows: First, set `PARAM`'s max value to an envelope length given by `Z` and make two inversely-related values from `PARAM` to be used as attack/decay times on `X` and `Y` (if one goes up, the other goes down). After this is done, set slew times to the attack/decay rates and switch voltages on/off on time.

This can be a really handy “oh s*** I need an envelope” kinda thing if you have the CV out to spare. You can delete the first line, set `Z` to a number and `X` to another number between `0` and the former if you don’t really want to use `PARAM`. Or h***, go crazy and use `IN`! The sky’s the limit on this script if you understand it.

10 Likes

Hey everyone, first post here and first published script with Teletype.

I don’t have a hardware version yet but I’m about to fix that next week by DIY-ing a Terminal.
I would never have fallen in love with this thing if it weren’t for the VCV rack plugin and all the awesome youtube videos and threads on Lines! Can’t wait to
try it with my hardware setup.

This script is kinda inspired by the sounds of standing in a grocery store and hearing all of the barcode scanners beeping in random-ish order but I decided to make it a bit more melodic with a Major 7th chord.
Nothing fancy, just really basic random notes quantized and random triggering of gates.

Anyway

Here’s a recording from VCV rack using 4 square waves through low pass gates

And here’s the code:

1

CV.SET R N.C 2 0 RRAND 1 7

PROB 60: TR.P RRAND 1 4

PROB 40: TR.P RRAND 1 4

#M

SCRIPT 1

#I

R.MAX 4

R.MIN 1

7 Likes

There’s this thing I like to do on Teletype that is clocking scripts with `M` set on a tempo (like a multiple of 120 BPM, for example), then multiplying that speed via probability and stuff.

``````// M --------------------
M BPM T                   // T is set to a specific BPM, let's imagine it's 120.
PROB 50: T * 120 RRND 1 4 // multiply tempo by a random integer up to 4, sometimes
\$ 1; TR.P 4               // idk, clock stuff
``````

This, while it creates some cool ratcheting and funky grooves, you can’t output anything steady off it due to master tempo manipulation. This problem would arise when using up a trigger output for clocking other things like delays and stuff (which is the driving force behind this haiku).

So, while we’re on the topic of clocking delays, some time ago I was doing something similar to this and tried to clock a Chronoblob 2. Needless to say, it was all over the place, so it called for an unsteady groove from a steady one.

Cue this single line:

``````EV X: \$ 1; X RRND 1 4 // yup, groovier than PROB 50:
``````

In the grand scheme of things, this is dastardly simple: every `X` times, change `X` and do stuff, not much else to it. But, my mind exploded. I could keep the groovy clocking within Teletype and have a typical clock keeping other things in steady check within a patch. I managed to have my cake and eat it too in terms of generative scripting and delay clocking. It was a revelation to me.

I bring this silly simple little stupid verse here to appreciate how simple things in programming can be so effective, and at times, even mind-expanding.

7 Likes

bytebeat haiku:

``````#1
A >> T - 9 ^ 1 & >> T 19 4
B + << T 4 >> & >> T 7 T 5
Z | & << T 1 | A B >> T 7
Z & Z XFF; T + T 1

#2
SCRIPT 1
CV 1 SCL 0 XFF 0 V 10 Z
``````

you will need to use vcvrack teletype to run it (as the vcvrack version can process inputs and outputs at audio rates). trigger script 2 using a square wave from an oscillator running at 8k and make sure to remove the DC offset with a high pass filter:

9 Likes

a bit of this then
something different so that
it’s the same but new

``````#M
CV.OFF 1 N 0; CV 2 V RND 4
IF > A 3: CV.OFF 1 N 12
CV 1 N.C 0 2 A; A % + A 1 X
TR.TIME 1 * / M 10 RRND 1 9
IF TOSS: TR.P 1; M RRND 9 999
IF == A 0: X RRND 1 9
``````

Plaits into Scan & Pan into Beads, with Mob of Emus adding modulation and Branches controlling the Seed; CV 2 is used to adjust Level.

(fingers crossed on the formatting)

10 Likes

For this new year’s day
A meng qi wing pinger sings
Of teletype chords

``````#M
TR.TIME 1 1; TR.P 1; M 200
CV 1 N.CS * 12 Y 4 A B
CV 2 N.CS 0 4 A 1
B + B RAND 3
EVERY RAND 4: Y % + 1 Y 2
EVERY 32: A P.NEXT
``````

The pattern should be filled with scale degrees, which control the chord sequence (here on the dorian mode in C). For this video, I used: 1, 5, 6, 3, 4, 1, 4, 5 (which I think is the Pachelbel Canon sequence. Maybe.). I’m feeding the two CVs to the wing pinger. The bass voice is self oscillating with maximum resonance, the higher arpeggio is also being pinged with the short trigger pulse into its audio input. This should work with any pair of low pass filters, but the wing pinger is beautifully easy to control hands on (and here I’m transposing octaves on the fly using the touch keyboard).

EDIT: whoops… I didn’t realise the scale degrees counted from zero, which explains why this chord sequence sounds so random. Doh! I put it down to a hangover from the night before

11 Likes

@nonverbalpoetry said to post this here ~

``````#1
A WRAP + A 1 0 15
L 1 4: \$ 2
``````
``````#2
IF BGET TI.PRM I A: TR.P I
``````

this gives you four 1-knob, 16-step rhythm generators. it steps through the bits of a number (txi knob) and triggers if the bit is 1. really interesting sound… it tends to have breaks and clusters, like the opposite of a euclidean rhythm
you can replace `TI.PRM I` with any number.

23 Likes

A double first time. My first Three Module Challenge, and also my first Teletype Haiku. Thanks to @scanner_darkly and @CiDE for helping me condensing my idea to 6 lines.

Here’s the script:

``````M:
EV X: \$ 1; X RRND 40 90
EV Y: \$ 2; Y RRND 15 100

I:
L 3 4: CV:SLEW I 1000; M 130

1:
L 3 4: CV I N PN - I 3 RND 4

2:
TR.TIME 1 RRND 400 900; TR.P 3
PROB 50: TR.TOG 4
``````

(I’ve just realized while typing this, that I forgot to change the TR.TIME 1, since I’m using TR 3 instead. Whoops)

10 Likes

`X` control the length of envelope; `PARAM` knob control the ratio of attack and decay
`CV 1` - CV out
`TR 1` - End of cycle trigger out

``````I:
X 500
TR.TIME 1 50

1:
Y PRM; Z - X Y
PARAM.SCALE 0 X
\$ ? > CV 1 0 2 3

2:
CV.SLEW 1 Z
CV.SET 1 V 10
CV 1 0
DEL - Z 50: TR.P 1
DEL Z: \$ 1

3:
CV.SLEW 1 Y
CV.SET 1 0
CV 1 V 10
DEL Y: \$ 1
``````
5 Likes

Teletype Sine Wave LFO

Here’s a way to generate a sine LFO on CV 1 that’s based on numerically integrating the 2nd-order differential equation for a spring, namely, y’’(t) = -y(t) with boundary conditions y(0) = 1, y’(0) = 0.

Some other features:

• The PARAM knob can be used to change the LFO frequency from roughly 5Hz down to roughly 0.2Hz.
• The variable `A` defines the amplitude of the LFO in centi-Volts (e.g., `A 500` makes the CV output go from 0V to 10V peak-to-peak
• The variable `B` defines an offset for the LFO in centi-Volts (e.g., if you want voltage to range from 1V to 9V, use `A 400; B 100`).

The Scripts

``````
# I
PARAM.SCALE 200 5000
A 500; B 0; Y 30; Z 0; \$ 1

# 1
T PARAM; J / T 20
Z - Z / Y 14; Y + Y / Z 14
CV 1 VV + / * + Y 30 A 30 B
DEL J: CV.SLEW 1 / J 2; \$ 1
``````

For those interested in how this works, there’s a brief explanation below after the video.

Explanation

So the core idea of this script is to numerically solve the differential equation y’’(t) = -y(t). Basically, this says that the rate of change of the rate of change y’’(t) at time t is -y(t), i.e., the voltage at time t.

This equations mean that if we take a small time step Δt we can approximate the rate of change y’(t) as:

y’(t + Δt) ≈ y’(t) + Δt y’’(t) = y’(t) - Δt y(t)

and we can also write the value of the voltage y(t) as:

y(t + Δt) ≈ y(t) + Δt y’(t).

We can express these updates in Teletype code like so:

``````Z - Z / Y K
Y + Y / Z K
``````

Where `Z` is y’(t), `Y` is y(t) and `K` is the reciprocal of the step size, i.e., Δt = 1/K.

That’s really the core of the script. The above integration can generate a sine (well, technically a cosine) with an amplitude of 1 at a fixed frequency. The rest of the script is for allowing the amplitude to be scaled up and for the frequency to be changed.

The frequency scaling is handled by a temporal recursion using `DEL` and a variable delay to implement different sized Δt. The rest of the complication is from having to handle lots of small updates when only fixed precision math is available.

Line-by-line

Initialization Script

``````PARAM.SCALE 200 5000
``````

Set the range of the knob from 200ms to 5000ms.

``````A 500; B 0; Y 30; Z 0; \$ 1
``````

Set the amplitude `A` to 5V, the offset `B` to 0V then initialise the boundary conditions for the differential equation: `Y` = y(0) = 30 and `Z` = y’(0) = 0. Then start Script 1.

The use of 30 here instead of one is one of several “magic numbers” that I had to tune by hand to work within the constraints of signed 16-bit integers and a CV output range of 0 to 16,384.

The value 30 is small enough to allow for a reasonably small amplitude LFO of 0.3V but large enough so that we can numerically integrate using only integers.

Script 1

``````T PARAM; J / T 20
``````

Read the knob value and use it as the period of the LFO in milliseconds. Compute a delay size `J` by diving the overall time per cycle by 20. This is another “magic number” that was chosen by calibration.

``````Z - Z / Y 14; Y + Y / Z 14
``````

This is the main integration loop as described in the pervious section. The 14 is yet another “magic number”. It relates to the earlier choice of 30 for the amplitude of the “base” sine wave. It is chosen to ensure that updates are not too large or small.

``````CV 1 VV + / * + Y 30 A 30 B
``````

This rescales the “base” sine wave in `Y` so that it has amplitude `A` and offset `B`. First, we compute `Y + 30` so we get a value in (0, 60) instead of (-30, 30). Then we scale up by `A / 30` (since the “base” wave has amplitude 30). Then we add the offset `B` before passing the resulting centi-Volts though the `VV` op.

``````DEL J: CV.SLEW 1 / J 2; \$ 1
``````

Finally, we pause for `J` milliseconds before updating the CV slew and then recursively calling Script 1. The slew here is chosen to be half the update time so that the “stepping” from the fact we are approximating the differential equation with integer updates is smoothed over.

29 Likes

A clock sync haiku:

``````IF ! M.ACT: M.ACT 1; \$ 9
M LAST \$; K 20; J - M K
IF >< K LAST 9 J: M.RESET
J / * 3 M 2
DEL J: M.ACT < LAST \$ - J K
``````

Runs the metronome at the same speed and phase as a clock input. Starts and stops with the external clock.

Breaking it down:
`IF ! M.ACT: M.ACT 1; \$ 9`
if the metronome is off, turn it on and fire it right away
`M LAST \$`
the classic method of syncing the period of your metro to the incoming clock (how long since this script was last triggered?) [n.b. - this is where you can put multipliers or dividers!]
`K 20; J - M K`
defining a +/-20ms window of time around the metro ticks where we expect a stable clock to continue landing
`IF >< K LAST 9 J: M.RESET`
if our clock and metronome are misaligned, re-sync the phase
`J / * 3 M 2`
how long shall we wait to see if the clock has stopped? (1.5 ticks)
`DEL J: M.ACT < LAST \$ - J K`
if there hasn’t been a clock trigger lately, stop the metronome

13 Likes

Fun little haiku for meshuggah style drum accompaniement for guitar chun practice
\m/(- x -)\m/

Live/ Init

``````L 1 4: TR.TIME I 20
M 150; SYNC -1
``````

METRO

``````A 0; X + 1 WRP X 0 15
B ER 2 RRND 5 7 X
EV 3: A 1
DEL.R ? A 3 B 80: TR.P 1
IF ER ? A 5 1 11 X: TR.P 2
DEL.R ? NE A B 2 1 80: TR.P 3
``````

VCV file on patchstorage

8 Likes

Hello everyone, my first post here. Hope it is okay to revive this thread. Posting here because a lot of your haiku inspired me to write this TT code.

You can hear an example of it here:

I was intrigued that very few eurorack modules offer random CV, based on statistical distributions. So I wrote a little script which uses a binomial, (resembling normal/gaussian but within a finite CV range rather than having infinite tails), that can then be skewed by taking the square or power of 3.

The binomial distribution can be compared to rolling multiple dice and adding the result, this gives a range of data in which the centered values have a higher probability of occuring. It is in some cases more useful than true random values, because values around a set CV value are more likely to occur and the further you stray from this centered value the less likely they occur, which gives a very natural CV modulation (I use it as a stepped modulation on the frequency of Xaoc Devices Kamieniec).

The skewed (power of 2 & 3) value is simply the added random result multiplied by itself. Skewed distributions are nice for CV modulation which may fall back to 0 very occasionally and may venture quite a bit above the set value with increasing uncertainty the further you venture (I use it as a slewed VCA-like mod on the fold parameter of Joranalogue Audio Design FLD6). Power of 3 is more skewed than power of 2.

Variable A determines how many random values are added to change the width of the distribution. I use values 3, 5, 7 and 9.
Variable B determines the power you apply to the added random value. 1 is binomial (symmetrical), 2 is chi squared (somewhat skewed), 3 is even more skewed.

For the code to work I used pattern data (I’m autistic and couldn’t cope with rounding errors for the binomial)

``````> P 0 1
> 0 0 0
> 1 1 945
> 2 9 11025
> 3 45 9261
``````

CODE

``````L 1 A: J + J RRND 1 / 945 A      // add A (3, 5, 7 or 9) random values; fixed range is A to 945 (3*5*7*9) for the sum
X SCL A 945 V 1 V -1 J; K 1      // scale it to the voltage of your liking; K must be 1 to move on... 2 lines is all you need for just binomial
L 1 B: K * K / J PN 0 B; Z K     // to keep the values in TT range when taking the power of 2 or 3, they have to be divided first using pattern data
Y SCL 0 PN 1 B V 0 VV 50 K       // you can now scale it considering the max value after multiplying, also using pattern data
TO.CV 1 X; CV.SLEW 1 T; CV 1 Y   // a stepped binomial random to TXo CV1 output
DEL T: CV 1 0; T J; J 0          // and a smoothed skewed AR envelope to TT CV1; and set the slewtime T to a range of A-945 seconds; reset J for next run
``````

[Edit: Please do inform me should you see a coding error or find an easier way.]

If you would use normal 6-sided dice the distributions look like this, top to bottom is 3, 5, 7 and 9 dice being rolled and then left to right are skewed data for that value to the power of 2 and 3. So the range remains the same, but the rate at which the probability decreases from the center value and how much it is skewed change. The TT script works the same but with multi-facetted dice for increased resolution.

31 Likes

definitely okay to revive this thread, and this is an incredible first post!

if you’re on discord, consider joining the teletype study group: Teletype Study Group

6 Likes