> teletype : code exchange

Not sure I ever explicitly thanked you for taking the time to write this up. Nice primer!

For anyone following along, teletype 1.1 allows for a little refinement, as you can use the SCRIPT op to trigger 2 doing away with the need to self patch. Which is to say:

TR.PULSE 1 — sends a pulse out of trigger OUTPUT 1 which is connected (self-patched) to INPUT 2 on teletype. (This is basically my way of extending this script beyond the 6 lines limit. The content of SCRPT 2 could have easily been sitting in SCRIPT 1.)

can become simply SCRIPT 2 and you can skip:

Connect trigger OUTPUT A to INPUT 2

Oh, and FWIW, this link has gone stale:

I set up the pattern as 24 steps, which is an equivalent of two identical bars from the “Clapping Music” (see here: http://www.music.mcgill.ca/~gary/306/week10/clapping.pdf

Here’s a fresh one:

http://earreader.nl/wp-content/uploads/2016/01/SteveReich-ClappingMusic.pdf

(Or take a trip in the wayback machine.)

:beers:

2 Likes

Not exactly a code quesiton but more about general handling:

I often get into situations where I have to insert an additional line in a script, e.g. for modifying/processing a variable before using it on something - is this possible somehow. By now I rewrite the whole script then…

Shift + Enter should do that if I’m not mistaken.

1 Like

Ah, it doubles the current line - yes, that works.

Thanks a lot!

it inserts whatever currently in the edit line, type something else to insert that instead.

many useful key commands in the key reference btw:

Adding a link to @scanner_darkly’s post on Orca-style sequencing using TT

2 Likes

couple of tips:

  • if you want to watch a variable live store it in one of the pattern values and use the tracker view (the downside is you would need to do this in every script that can modify the variable)

  • if you need to use both I and an offset I value in a loop you would normally do something like ADD I 5 for the offset value. but if you don’t have enough space you can sacrifice a line and store the offset value in O variable and use that instead as it will also autoincrement on each iteration.

and copying here from another thread;

  • there is a reference available on teletype itself for both keys and commands - just press F1 at any point and then use up and down arrows to scroll and [ and ] to switch between the different pages.

  • in the tracker view if you press CTRL it will store the knob position scaled to 0…31 into the current value.

6 Likes

I am struggling with the SCALE a b x y i command.

I am trying to scale X up from 0 - 122 to 0 - 255. (I know I could multiply it by 2 - I was doing something more complicated and it did not work out, now I try it isolated with simple numbers that can be shown on Arc as a kind of display).

I thought it could be done with this as with other commands that modify X:

X ADD X 1
X MOD X 122
X SCALE 0 122 0 255 X
CY.POS 1 X

But this gives me kind of random values.

Y SCALE 0 122 0 255 X
CY.POS 1 Y

does work though but needs Y as a second variable.

Is it meant like this or what do not understand here?

Currently I am on the new teletype firmware 2.0b3

X SCALE 0 122 0 255 X

this should work. but it likely isn’t what you want, since you expect X to be between 0…122, and then scale it to 0…255. so the second time the scrips get executed, X can be beyond 122 and gets scaled accordingly, so it grows and grows each time. (edit: the range doesn’t wrap)

Y SCALE 0 122 0 255 X
CY.POS 1 Y

didn’t check the line length, but you could omit Y by writing:

CY.POS 1 SCALE 0 122 0 255 X

Ah, of course you are right - thanks a lot!

What an educational way of being stupid…:laughing:

Actually I was trying to scale the measured TIME between trigger inputs for some kind of clock devision and it did not give me what I expected, haven’t checked the new shorter commands - maybe I fit in in a single line.

glad to help. don’t confuse knowledge with intelligence. asking questions is a quick and smart way to get smarter :slight_smile:

2 Likes

Here’s a really fun one: tt08s.txt (1.2 KB)

I call it “BOOLEAN BOUILLON”. It takes in four gates/triggers on ins 1-4. TR 1-4 are logic soup, CV 1-4 are rhythmic gates. Script 8 changes the active logic mode. Tracker mode edits the rhythm patterns.

The I script will activate up to 8 clock divided metros if you have at least one TXo connected.

You could speed up the M script if you need better accuracy. The M script currently updates the outputs every 50 ms.

6 Likes

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!

20 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