> teletype : code exchange



you could use scale to get the Param value.

Y SCALE 0 16383 0 4 PRM

The above would scale the param knob to values 0-3 and store it in Y.


SCALE is perfick! :slight_smile:


Hello Dears,
I’m experimenting driving Kria with Teletype. Actually I’m on Ansible 1.5.0 and Teletype 2.0. There’s a way to sync Kria pattern? I’m setting

M 960 (which is 60*16)

KR.RES 0 0

But the reset occurs at random steps in Kria pattern. Any idea can I do this?


I don’t think that is possible, but just wanted to check:

Can one copy/cut/paste more than one line of code at the same time?

LIke shift-select 2 or 3 lines, copy and paste them in a different script?


20 characters of not yet. :slight_smile:



It seems like it would be a great workflow addition.
I find myself often wishing for that.

(Similarly, being able to comment out more than one line at the same time).


I’m new to Teletype, working through the studies, and have been trying to write clocked melodic patterns with rests. I guess the closest thing would be an SH-101 style sequencer (but all values entered via teletype keyboard into the tracker). In the pattern editor/tracker, I create the melody with 0 as the root note and -1 as the rest, since negative values don’t work for note assignments (I think?) This is what I came up with, starting with the default 4Track scene as a starting point. I’ve added comments here for readability, perhaps somebody will find this useful.

(triggered by input 1)

P.N 0  // set the pattern to the first one in the tracker
A P.NEXT  // advance, get the next value in the pattern, assign to variable A
IF GTE A 0: CV 1 N A   // If that value is greater than or equal to 0, set CV 1
IF GTE A 0: TR.PULSE 1  // If that value is greater than or equal to 0, pulse corresponding trigger

You can then adapt it for input 2/pattern 2

P.N 1
IF GTE A 0: CV 2 N A

Experienced Teletype users, let me know if I’m doing this backwards or weirdly. :rofl: With the remaining lines, I’m thinking of adding some IF conditions to slew depending on the note.


Hi, just gettng started with programmin the teletype and have a question.

I was able to use the W (while) command to a loop as follows:

X 2000
W GT X 0 : SC.CV 1 X; X - X 5

is there any way to do a while loop that spans miltiple lines? Or made a line have more characters than fit on the screen?

I want to do something like this (doesnt work as line is too long)

X 2000
W GT X 0 : SC.CV 1 RRAND 1 16000; X - X 5



Loops can’t span multiple lines, but you can call another script from within the loop, so you can do something like:

X 2000
W GT X 0: $ 2

SC.CV 1 RRAND 1 16000
X - X 5


That worked perfectly, thanks x2mirko
(So essential script 2 is acting like a block or a gosub if it were basic :slight_smile: )

This plays the subroutine extremely quickly (CV is basically noise), so I wanted to add a slight delay in script 2

I tried to make the following change:

X 20
W GT X 0: $ 2

DEL 10 : SC.CV 1 RRAND 1 16000
X - X 1

Which I expected to play for approx 200ms, as I thought this would loop script 2, 20 times and script 2 would run for about 10ms due to the DEL 10.
But it only seems to execute script 2 once when I put the DEL command in…
Any idea why? It appears the DEL prevents it returning to the calling script.


There’s no “sleep” command. DEL only delays the execution of the following statement, but executes the rest of the script - so it will queue up SC.CV1 RRAND 1 16000 to be executed 10 ms later, but keep running through the loop very fast. You are right that if you add delay, there seems to be only one change. I’m not sure how exactly the delay-system works if you queue up a whole lot of commands really fast. But in any case, this will not work as you expected.

I don’t know if there’s any clever way around this. I think there isn’t.

It might be a better approach to figure out a way to create a burst of triggers and use that to trigger the teletype script that sets a random value. For example, if you want to do it synced to a clock, but only for a certain time after a trigger came in, you could patch the clock to trigger input 1 and then do:

IF X : SC.CV 1 VV RAND 1000

X 1
DEL 2000: X 0

That way, for 2 seconds after receiving a trigger on trigger input 2, you send out random values on each clock pulse incoming at trigger input 1. You could also use M as the clock source instead of relying on an external clock.


Great, yes, looking at the problem a different way can often be the best solution!
(I am trying to get my head around the programming model of the teletype)
Thanks for the feedback


Just wanted to ask how people are utilising patterns? I’ve had some nice results from just filling with a scale and using that to randomly address multiple cv outs but the more I read about patterns and their operators the more their incredible depth strikes me. I’m only scratching the surface and would love some advice to help get more out of them. Is anyone using lots of a pattern c.>20 locations? Anyone using all 4 at once for something interesting? Anyone using pattern length and specifically push and pop for something they can’t imagine being easily possible any other way? Anyone finding interesting uses for patterns outside of addressing pitch?


I’m also keen to see some innovative uses of Patterns.

In one of my early TT Scenes (which I lost), I used the pattern pages to store randomly generated ‘maps’.

On one pattern page (or map), most of the cells were empty (zero) and numbers represented food for the Turtle. On another pattern page, most of the cells had numbers representing note values in a scale - and a small number of empty cells represented musical rests.

One variable was assigned a number representing the Turtles initial energy.

When the Turtle moved, it used energy. When it landed on a ‘food’ square, it stopped and ‘ate’ some of the food - so the number on the cell representing food went down - and the Turtle’s energy went up. Then its direction was slightly adjusted and it would move off again - playing the note value that had been on the same cell on the note page.

The Turtle’s speed was set by making the Metronome time value inversely proportional to the energy value. So that, when the Turtle was full of food, it travelled quickly and as it began to starve, its movement slowed.

When the Scene was run, the Turtle would travel around the pattern page, until it ran out of energy and most of the food was eaten.

Musically, the result was quite varied - some times the turtle would ‘play’ a long flurry of fast notes and then stop dead. Other times it would play a few notes and then manage to miss the food for a couple of bars before playing a few notes again, slowly coming to a halt.

By adjusting the ranges of the random numbers on the food map and the distribution of notes on the note map, it was possible to conduct the performance. (This could have been adjusted as the Scene ran - with an input from a controller adding food to keep the Turtle alive!)

Hope that makes sense! I lost the Scene because I didn’t back up. I should go back to it now because I think it could be done in a much more interesting way using the Grid page (but still using pattern pages to store the food and notes?)


Would this thread be the best place to post problems and queries regarding Teletype coding? I’ve been away for almost 2 years (touring my day job) but I’m easing my way back into the Teletype world. Much has changed… I’ve installed the Telex input and output modules and updated to 2.2. I’m sure I’ll have all sorts of questions, and hopefully some ideas to share…
First question - can L and I be safely used for different purposes within the same script?
For example - I want to use the INIT script set the trigger time for all 4 Telex outputs, and also to reset all patterns to index 0.


whenever L is used it will change the value of I, so if you store some temporary value in it it’ll get lost once L is executed. other than that it should be fine to use both multiple times.


Being that it’s not possible to use a variable to define M, how do you make M change over time/trigger in?


You can use a variable to change (M)etro - did you mean something else?


M.ACT N Where N is 0 for stopped or 1 for running.

To update/change the running speed you could put something in your metro script like M PRM then scale PRM to something usable.


i tried using drunk without success :frowning: