> teletype : code exchange

Also please excuse my ignorance re: coding, there are probably reasons why some of these suggestions are nonsense, I’m just spitballing what I think could be cool haha

Amazing suggestions.
The flip-flop triggering “bug” is indeed known.
Regarding audio rate triggering, is it something that TT can really handle ?

1 Like

Ya I just tried making an oscillator with one of the cv outs but really it doesn’t track anywhere close to fast enough to do wavetables. Can get a pretty wicked phasey square wave though. For the most part good enough for all I can see myself using it for anyways.

Maybe one day somebody will port the teletype code over to an aleph so I don’t have to learn how to do crazy dsp programming heh

1 Like

so it records notes from Rene when receiving trigger #8? great idea. and got me thinking about doing a script that would serve as a sequencer controller / recorder. so it would output clock and reset which you would connect to your sequencer (giving you direct knob pitch control), one trigger would record the whole sequence by making it step through each value while recording it, another trigger would play it back at the speed determined by the knob, and other triggers could do something interesting to the sequence, shift it, swap notes around etc.

Yes, you could do that with Rene by temporarily putting it in snake mode and then using L 1 16 TR. Pulse and then tying to a script like mine. I made it manual because I wanted to be able to load all 4 sets of 16 notes from Rene into the 4 patterns in TT. The 4 sets in Rene can (for now) only be changed manually.
I do think sitting a Rene next to TT would offer best of both worlds in many situations. I spent much of yesterday experimenting with earthsea and thus far I think I prefer playing Rene by hand…

i like this idea not just because you can use knobs to program teletype sequences, but also because you could use it to cue new sequences, if you can pre-listen to the sequencer output you can program another sequence while TT is playing the current one, then get TT to read the sequence into a new bank and switch on the fly.

i also like it because it’s a not immediately obvious application of TT but one that shows how powerful it can be.

Yes, there is no reason TT can’t read a new pattern while accessing another one.

TT Quantizer, first draft.

I was thinking, as previously discussed, of creating an array of notes to summon via a pattern when it occurred to me that we already have a perfectly good chromatic quantizer in TT via X DIV QT In N 1 N 1…

All notes in the chromatic scale are related to C, and all the C notes are divisible by 12. So we can isolate the notes we don’t want using the MOD function.

Here is the very simple first draft. Made using earthsea.
DELs added because of earthsea position latency vs edge.

This is really just one long script with the delayed bits at the front. Joined by trigs, in V2 we can join more elegantly.

Scale is C minor with added D. The scale I use 1/2 the time. C, D, Eb, F, G, Bb. Note that an all rounded up or down version could be made. This version rounds down the lower notes in the scale and rounds up the higher ones.

No I or M scripts.

1
DEL 65 : X DIV QT IN N 1 N 1
DEL 65 : Y MOD X 12
DEL 65 : TR.PULSE A

2
IF EQ Y 1 : X SUB X 1
ELIF EQ Y 4 : X SUB X 1
ELIF EQ Y 6 : X SUB X 1
ELIF EQ Y 8 : X SUB X 1
ELSE : X
TR.PULSE B

3
IF EQ Y 9 : X ADD X 1
IF EQ Y 11 : X ADD X 1
ELSE : X
CV 1 N X
TR.PULSE C

5 Likes

I’ve been using something slightly different for quantization with a Pattern for the scale data. Rather than quantizing to N 1 (semitones), you quantize to a fraction of an octave. eg. for traditional seven note scales you can use:

Y DIV V 1 7 // Y is a 1/7 of a volt, hence 7 divisions per octave
X DIV QT IN Y Y // X outputs the scale tone for pattern lookup
CV 1 N P.I X // Send the value from the pattern to CV 1

Then you’ll need the active pattern to be a list of N values, eg 0,2,4,5,7,9,11 for major quantizer. This opens up a lot of flexibility for having different scales in different patterns etc. Also frees up a lot of lines for other code. Furthermore, you can change the DIV V 1 7 to a different number in order to quantize to non-7-tone scales (eg. 8step wholetone).

14 Likes

So you would then access a pattern where 0-6 were the notes for the first octave, 7-13 for the second octave, etc?

Exactly. Otherwise you could get fancy and use a MOD & WRAP to add octaves arithmetically, rather than having to fill the whole pattern with multiple octaves.

1 Like

so this ^ got me thinking that the remote commands simply get translated into numeric parameters for the II command. and if that’s the case then perhaps the opposite would also be true - II with any valid number within the defined range should also work.

this turned out to be the case indeed, i tried it and it worked. what this means is now a neat hack is possible where you can store II commands (using their numeric equivalents) in a pattern. and then you can do something like:

II P.NEXT P.NEXT

you need to include P.NEXT twice because you also want to store the parameter for each command (sequence should be parameter, command, parameter, command etc). it’s not possible to access specific index this way as II P 0 P 1 copies the value from P 1 to P 0, but you can use it with P.PUSH and P.POP so this essentially gives you another stack (actually, up to 4 more stacks) for II commands. if you use it this way push the command first and then push the parameter. oh, and to find the ‘machine code’ for a command switch to Live mode and execute it without II, it’ll show the number you’re looking for.

now consider you can also run it in a loop like this L 1 32 : II P.NEXT P.NEXT (can confirm it works) so now you can execute up to 32 II commands with one line! not sure how useful this would be (one use case would be storing initialization sequence for multiple trilogy modules in a pattern and executing it as one command), but kind of a cool hack.

6 Likes

Here are the scripts i’ve used for this

1: // drum patterns generation

P.N 0 // this selects the first pattern
P.L 16 // sets pattern length to 16
L 0 15 : P I RAND 4 // fills each step with 0,1,2,3 or 4

2: // generate 4 different triggers from the pattern generated in script 1

P.N 0
P.NEXT // reads the next pattern step each time the script is triggered
IF EQ P.HERE 1 : TR.PULSE A // if the current value is 1, trig out of output A
IF EQ P.HERE 2 : TR.PULSE B // if the current value is 2, trig out of output B
IF EQ P.HERE 3 : TR.PULSE C // etc…
IF EQ P.HERE 4 : TR.PULSE D

3 : // triggers rolls (generated by the M script)

X RRAND 200 450 // variable X takes a value between 200 and 450
MUTE 2 // mutes script 2 (so kills the normal pattern as long it’s muted)
M RRAND 5 50 // gives the Metro (M) script a rate between 5 and 50 milliseconds. Used to ‘retrigger’ the current hit in a loop.
M.ACT 1 // activates the Metro script
DEL X : M.ACT 0 // after X milliseconds, shuts up the M script. So X is in fact the length of the roll
DEL X : UNMUTE 2 // after the roll, go back to the normal pattern play.

4 : // Mutate the pitch CV for the melodies. The Pitch CV, generated elsewhere, goes into the IN of Teletype.

P.N 1 // selects pattern 2 (already filled with the values 0,5,7,9)
P.L 4 // sets the pattern length to 4
CV 1 IN // mirrors the CV coming to the IN to the CV 1, going out output 1
PROB 1 : CV.OFF 1 N P RAND 4 // one time out of 100, adds an offset to the pitch CV (transposition) which is a value in semi-tones (thus the ‘N’) randomly chosen between 0,5,7 and 9.
PROB 10 : CV 2 VV RAND 1000 // 1 time out of 10, CV 2 takes a random value between 0 an 10V. This moves the ‘big knob’ of Frames, controlling several sound parameters. Note that in the Init script, this CV is slewed a lot (takes 16 seconds to reach the new position).

M : // generate rolls (when it’s activated by script 3)
IF EQ P.HERE 1 : TR.PULSE A // triggers out A (at a rate between 5 and 50 ms, see script 3)
IF EQ P.HERE 2 : TR.PULSE B // etc…
IF EQ P.HERE 3 : TR.PULSE C
IF EQ P.HERE 4 : TR.PULSE D

I : // initial values
TR.TIME A 1 // triggers out of A will be 1 ms long
TR.TIME B 1
TR.TIME C 1
TR.TIME D 1
CV.SLEW 1 0 // no slew for CV 1 (pitch output)
CV.SLEW 2 16000 // 16 second slew for CV 2 (slow sound morphing)

15 Likes

Hi,

Programs used:

Notepad, Emacs, Sublime Text 2.

Hardware:

Teletype, Targus SD card reader. 8gig Toshiba SD card.

Here is what I’m trying to do.

Take code copied from the forum (such as the above post) and save it into a text file that Teletype can read off of an SD card. (Yes, I am rearranging the code to be proper form)

I’ve used both Brian’s .txt scenes in the following and works flawlessly with the SD card read/write copied on Teletype from an SD card…

http://monome.org/docs/modular/teletype/scenes-1.0/

Problem is, I cannot copy whatever on the forum and reorganize so it looks exactly like Brian’s code format it in say Emacs or Sublime Text 2 and it still does not work.

What i’ve noticed is the code is one continuous line in the above 1.0 scenes whereas copy and paste on forums formatting is not the same in Notepad and Notepad only.

So question is, what is the secret to formatting different within text editors in order to get it to work where I can just copy and paste into a text editor and send it to an SD card for the Teletype to read.

Also, what is the difference between files tt##s.txt and tt##.txt flies on the SD or what is their purpose.

Thanks

1 Like

yes, i think there might be issues with how various text editors format, for example, how line feeds work. i’ll need to do more investigation on this. best practice when sharing a scene is to attach a teletype-saved .txt file.

tt##s.txt is the “saved” flash state from your TT. without the “s” files are read and copied to flash. so it allows a read of TT’s memory and writing to it with different processes.

hi there,
i’m shure it’s something pretty simple but i’m still starting to write my lines :smile:
i want to control the slew of a tracker channel with the CV input with this line:

1
(…)
CV.SLEW X IN

but the input has too much range and i’d like to limit it, for this i’m dealing with the boundaries section of teletype studies and not getting it
trying to write:

I
X MAX 0 1 or LIM X V 0 V 1

i’m lost, have too much to learn…

BTW, merry xmas to everyone!!

try SCALE

X SCALE 0 V 10 0 V 1 IN

this sets X to the input knob scaled from 0-10v to 0-1v

keep in mind this is also the same as just dividing by 10

X DIV IN 10

then set your CV.SLEW:

CV.SLEW 1 X
1 Like

thanks tehn, DIV works perfect

Hi there,

I’d like to set up teletype to work like an analog shift register:

it functions as a cascading sample and hold / switch.

On each clock trigger, a new sampled signal takes the first output, bumping down the previous sampled signal to the next output and so on.

What do ya think?

It should be dead easy :
main idea would be :

CV 4 CV 3
CV 3 CV 2
CV 2 CV 1
CV 1 IN

8 Likes