I’ve been doing a coding retreat the last 6 weeks and today learned how IF / ELSE is implemented at a machine level (well, in assembly). Made me reflect on how IF/ELIF/ELSE is implemented on teletype and how it’s actually super weird and powerful! Here’s a silly control structure script I just rambled at @tehn on email:

M:
IF 0 : this will never happen

2:
ELSE : do one thing

3:
ELSE : or another

After each METRO tick (use a slow speed), only the first of script2/3 will be triggered. If you trigger scripts 2/3 with independent rhythms i believe you’ll get some interesting phasing of one behaviour happening as it aligns with the metro, which will change over time. This lets you play with the relative phase of the METRO (or another trigger) and the inputs 2/3.

Point being - IF/ELIF/ELSE in teletype allow you to create control structures that don’t have to logically flow through as a single block. It’s more like an ‘ARM’ flag which you can take advantage of with control voltages!

@sam: FYI, had this epiphany while implementing my own forth! The dream lives on…

7 Likes

Ah. Sorry. It is super weird. So I fixed it. Sorry.

That won’t work in 2.0.

(Although your post did make try a few examples out and decide that the ‘fixed’ behaviour isn’t quite perfect. I’ll post something in the beta thread.)

1 Like

Very simple script, but very useful to me for very slow movements in a pattern based on a counter influenced by an external event.

I :
T 0

1:
P.N 0
P.L 4
T ADD T 1
IF EQ T 8 : P.NEXT
CV 1 N P.HERE
IF EQ T 8 : T 0

3 Likes

in reference to:

In my sincere attempt to remain sub-104 hp, I wrote up a basic René-style (x,y) script to stave off my GAS. it randomly goes down a Pattern column (containing integer steps of a scale across a few octaves) and pulls each integer into a CV _ N expression.

For the video in that thread, CV 1 is driving Just Friends (Plume) and TR 1 is triggering a subset of N voices.

All this is in the 1 script.

1: X RAND 4; Y RAND 4 Z MUL X Y PN.I 0 Z CV 1 N PN.HERE 0 TR.P 1

From there, I added some performative elements like Sample + Hold (CV 2 [Dixie II+] sampling CV 1), clock jumbling and envelope crests (CV 4 to Cold Mac…? :grimacing:).

2: PROB 40: CV 2 CV 1 CV 2 N PN.NEXT 1 CV 4 V RAND 10 DEL 1000: CV 4 V RAND 3

3: M DIV M 3 DEL 1000: M 80

And then some neat offsets for CV 2 and a sorta-on beat secondary JF trigger.

4: CV.OFF 2 V 2 DEL MUL M 4: CV.OFF 2 0 DEL DIV M 3: TR.P 2

M script was basically pulsing TR 1.

love. this. module.

(edits: TR.PULSE -> TR.P)

14 Likes

In reference to: Composing with Teletype

TT sends:
CV 1 to midrange voice
CV 2 to lower voice
CV 3 to higher voice
CV 4 to Cold Mac Survey
TR 4 to 3 Sisters Low, tuned for kick resonance

TT receives:
2 from Cold Mac Right Out
3 from Cold Mac Follow Out
5 from Cold Mac Left Out
6 from Cold Mac Or Out

(Cold Mac Slope Out also patched to 3 Sis v/8)

sometimes, keyboard needs a swift F1-F8 swipe to reset.
CV 4 needs occasional CV 4 0 from live mode.

////

1
CV.SET 3 CV 1

2
PN.L RRAND 1 3 RAND 6
CV.OFF 1 V * TOSS 3

3
TR.P 4
DEL / M 4: TR.P * TOSS 4
DEL / M 3: TR.P * TOSS 4
DEL / M 2: TR.P 4
DEL M: TR.P * TOSS 4
DEL * M 2: TR.P * TOSS 4

4
CV 3 CV 2

5
PN.NEXT 1
CV 1 N PN.HERE 1
DEL / M 3: TR.P RRAND 1 3
DEL * M 2: TR.P RRAND 1 3
DEL * M 3: TR.P RRAND 1 3
CV.OFF 1 V TOSS

6
PN.NEXT 2
CV 2 N PN.HERE 2
CV.OFF 2 V TOSS

7
PN.NEXT 3
CV 3 N PN.HERE 3
CV.OFF 3 V TOSS

8
CV 4 VV RAND 1000

M

I
M * ME.PERIOD 8
L 0 7: ME.RES I
M.RESET
CV.SLEW 4 4000

P
0 0 3 7
0 3 7 5
0 7 5 10
0 22 2 0
0 24 0 0
0 0 0 0

this might not be the type of functional thing that this thread deserves, but just wanted to highlight that Cold Mac providing triggers into TT is a dream. triggering randomized pattern lengths, choosing new pitches, and pinging a filter all in one gesture is super fun!

18 Likes

(now that the teletype script repo is available, discussion on it, including requests for github access, has been moved to its own thread, to keep this thread focused on scripts and scene ideas. thanks to @emenel &co for getting the repo up and running.)

3 Likes

Is there a way to write,

PROB 50: do something ELSE: do this other thing

That I’m missing? I’ve been doing a weirder version, setting a variable to 0, then PROB 50: X 1 then IF/ELSE on the variable. If there isn’t a way to do what I’m suggesting, I’d love to see an ELSE added to PROB.

1 Like

Oh, BREAK might fix this for me,

PROB 50: #something; BREAK
#SOMETHING ELSE THAT WILL ONLY BE EXECUTED IF BREAK DOESN'T HAPPEN ABOVE.

Hurray for BREAK! I’m also very excited for WHILE.

4 Likes

You can try:

IF GT RAND 10 5: do something
ELSE: do something else
2 Likes

Please post an example if you use WHILE, as despite advancing it for completeness of the language, I have yet to find a really good example of its usage musically where LOOP would not suffice.

Hi. I know this has been discussed before. I was just wondering if there are any plans currently — perhaps in the form of an interactive tutorial, or better yet fully functioning software — to explore Teletype as software in a browser, or on a laptop or mobile device, like an iPad. Thanks.

1 Like

On a slight tangent from @disquiet’s post, I’ve been wondering how feasible it would be to implement Teletype as a VCVRack module.

2 Likes

^ Yes, this, yes. #20charactersorbust

1 Like

I’d love something like this just so I can work out TT scenes while I’m traveling. An emulator or something would be awesome.

5 Likes

That’s the word I was looking for: emulator. Yes, this. Thank you.

Or when I’m ahem working at my desk in my office on work things.

7 Likes

Teletype is mission-critical.

5 Likes

I couldn’t see this already posted so here goes. I wanted to make a quantiser for Just Type for which you could define the scale. I started off with @Galapagoose script way up this page but it needed some altering to make it account for various octaves. It was easier to sort this for a CV output as you could make use of CV.OFF but there is no equivalent in Just Type that doesn’t affect all 6 oscillators.

You can input your scale as N numbers in the first 7 slots of pattern 0. No need to repeat them up the scale.

CV input to IN
Trigger scrpit 1

I:
JF.MODE 1

1:
Y DIV V 1 7 // Splits the incoming CV into 7 tones per octave (volt)
X DIV QT IN Y Y // Gives the ‘tone number’ within the scale. Above 7 will be higher octaves
Z PN 0 MOD X 7 // Defines which note within the scale it’s on (1-7) and looks it up in the pattern
JF.NOTE N + Z * / X 7 12 V 8 // Combines the above - the note (1-7) and the offset in octaves (12)

The maths in that last line was really hard to get right! Need to get used to the ordering…

I wonder if there is another way which doesn’t use the 3 variables X Y & Z …?

5 Likes

Please please please forgive my stupidity but how do you access the + and * keys?

Shift = will access + and Shift 8 will access *