> teletype: grid # code exchange

teletype

#1

this is a thread to share and discuss scripts and scenes for teletype grid integration. as this thread grows hopefully very long i will maintain this index page to make finding specific things easier. and remember, you can use a lot of grid scenes without a grid!

we also have a dedicated thread for er-301 controller scenes on orthogonal devices forum

for non grid specific scripts see the > teletype : code exchange thread
for discussing the grid extension itself please use the main development thread
if you’re looking to start with something simple head over to grid teletype studies

when posting here please also consider adding it to the teletype code exchange github


Grid ops / integration
UX of Music Instruments & Tools
> teletype : code exchange
> teletype : code exchange
#2

to start things off some scripts / scenes posted in the development thread:

pong

Grid ops / integration [beta nov 23]
Grid ops / integration [beta nov 23]
Grid ops / integration [beta nov 23]

pattern canvas / music box

Grid ops / integration [beta nov 23]
Grid ops / integration [beta nov 23]

water circles

Grid ops / integration [beta nov 23]
Grid ops / integration [beta nov 23]

simon

Grid ops / integration [beta nov 23]

rain (meadowphysics remix)

Grid ops / integration [beta nov 23]
Grid ops / integration [beta nov 23]

mlr (no pattern recording)

Grid ops / integration [beta nov 23]


> teletype : code exchange
#3

This a fantastic. One general note about the Github repo – I’d love to see work in progress posted there, as well as “finished” scenes. It’s easy to update scripts, and we can even have people improving and tweaking each other’s work. Totally happy to see “unfinished” stuff in there, just indicate what state it’s in as part of the readme. (I’m going to cross-post this to the other TT code thread as well)


#4

So i did my first attempt to port René to Teletype and grid.
It’s just a starting point, but i thought i could share.

RENE

#1
@MOVE 1 0; TR.P 1; SCRIPT 6
P.N @X; P.I @Y; CV 1 N P.HERE

#2
@MOVE 0 1; TR.P 2; SCRIPT 6
P.N @X; CV 1 N P.HERE

#3

#4

#5

#6
Z ADD @X MUL @Y 4
L 0 15: G.BTN.L I 7
G.BTN.L Z 16

#7
@X % G.BTNI 4
@Y / G.BTNI 4

#8
G.BTX I 0 0 1 1 0 5 7 4 4

#M

#I
@F 0 0 3 3
@WRAP 1
L 0 15: SCRIPT 8
TR.TIME 1 5

#P
4 4 4 4
1 1 1 1
0 0 0 0
63 63 63 63

60 65 72 58
63 68 76 61
67 75 83 84
72 77 82 68
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

#G
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0


#5

These are l great. Would you consider putting these into the teletype Codex git repository?


#6

I think it needs a lot of improvement ! I am quite weak at coding…
I was posting here to discuss how to improve it.
One of the main question is : how to input cell values ?
What i had in mind :

  • toggle a ‘page’ with a button that would display the same 4x4 grid, with led intensity relative to the pattern value
  • then hold a button and turn the PARAM knob while holding.

Sounds cool doesn’t it ?

(no idea how !)


#7

yeah i think something very rené-esque could be done with grid where you would have 4x4 square of buttons on the left which would display the current value and allow you to change values by holding a button and turning the knob as you suggest, and on the right you’d have a 4x4 square displaying the current turtle position and pressing here would move the turtle to that position.

edit: as a starting point:

#I
G.BTX 0 0 0 2 2 0 0 1 4 4
G.BTX 16 8 0 2 2 1 0 2 4 4
@F 0 0 3 3
@WRAP 1
@SCRIPT 3

set up buttons, one group will be on the left side - these are to set values (done by script 1), the other group is on the right - this is to jump the turtle to a position (done by script 2). also define the fence and the script for the turtle.

#1
IF EZ G.BTNV: BREAK
X % G.BTNI 4; Y / G.BTNI 4
I SCALE 0 V 10 0 15 PARAM
PN X Y I
G.REC * X 2 * Y 2 2 2 I I

this will set the corresponding pattern value when a button in the left group is pressed. the knob value will be scaled to 0…16. we then draw a rectangle with the brightness set to the new value.

#2
@X % G.BTNI 4; @Y / G.BTNI 4
SCRIPT 3

this will set the turtle coordinates if a button in the right group is pressed, and it will display the current position by calling:

#3
G.REC 8 0 8 8 0 0
G.REC * 2 @X * 2 @Y 2 2 1 15

this script will draw a rectangle corresponding to the current turtle position. this will also get called when the turtle itself moves to a different cell. this is where you probably want to output a trigger and update a CV.

this will also need a script to display the current values initially and to move the turtle (or set it up to move by itself).


#8

What is S here ? A typo i guess ?
Also can you explain the use of I here ?


#9

New idea/starting point for a 16 step sequencer. It’s just me studying, maybe you guys feel more like i’m polluting the thread ?
Clock is script 5
Row 1 displays value
Row 2 sets value of the step above: press and move PARAM.

16STP

#1
IF EZ G.BTNV: BREAK
X - G.BTNI 64
I SCALE 0 V 10 0 127 PRM
IF GT G.BTNI 64:
P X I; G.BTN.L X / P X 8

#2

#3

#4

#5
G.REC 0 1 16 1 0 0
Y ADD Y 1; Y WRAP Y 0 15
G.LED Y 1 15
P.L 16; P.I Y; CV 1 N P.HERE
TR.P 1

#6

#7

#8

#M
SCRIPT 1

#I
G.BTX 0 0 0 1 1 0 1 1 16 1
G.BTX 64 0 1 1 1 0 10 2 16 1
M 10; M.ACT 1

#P
16 0 0 0
1 1 1 1
0 0 0 0
63 63 63 63

12 0 0 0
40 0 0 0
15 0 0 0
126 0 0 0
120 0 0 0
70 0 0 0
16 0 0 0
100 0 0 0
123 0 0 0
88 0 0 0
60 0 0 0
124 0 0 0
126 0 0 0
38 0 0 0
117 0 0 0
63 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
41 0 0 0

#G
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0


#10

I’ve made a simple Earthsea port using just a few lines:

I:
G.BTX 0 1 0 1 1 0 3 1 15 8 // Creates 15x8 buttons without latching

1:
Y - 7 / G.BTNI 15 //Creates a variable ‘Y’ which defines the row number - 0 at bottom, 7 at top.
CV 1 N + * Y 5 % G.BTNI 15 // This calculates the position on the x axis using MOD (%). It also creates an offset of 5 semitones for each row by multiplying the row number by 5. These 2 values are then added together to give the note.
TR 1 G.BTNV //Gate output

I’ve left the first column blank to add more features. Portamento should be easy, magic shapes less so!

@scanner_darkly this is so awesome, thank you for all the work you’ve put in. It’s amazing how much you can do with this with so few lines of code!


#11

yeah not sure where that S came from! i edited the post.

I SCALE 0 V 10 0 15 PARAM
this line takes the knob value, scales it down to 0…15 and saves it to I. the actual range might be 0…14 (or even 1…14) until @sliderule adds the calibration ops, so if this is what you get just change the line to I SCALE 0 V 10 0 16 PARAM

i often use this to set Metro rate with the knob: M! SCALE 0 V 10 500 20 PRM


#12

Ok i was just confused because i thought “I” was exclusive to the Loop process.

Off Topic : how do you paste code so it has this font and gry background ?


#13

Something i can’t figure out. Probably a dumb question :

I:
G.BTX 0 0 0 1 1 0 8 1 4 4
G.BTN 16 0 7 1 1 0 8 2
O.MAX 7; 0.WRAP 1
P.N 1; P.I 0

1:
P O G.BTNI

2:
P.N 1; P.I 0
O 0

This should fill consecutive pattern values with the button ids. But for some reason it writes it at button down AND up.
Any help ?


#14

I’d noticed this as well. Buttons trigger their respective script on both button down and up. I can think of some cases where this could be very useful but normally it’s a little annoying. I suspect @scanner_darkly had good reason for designing it like this?

Edit:
One way around this is to use this PRE in Script 1:

IF NZ G.BTNV:

That way it will only activate the script on the press down, when the buttons value is 1

Then ( in a different situation ), you could have alternative actions for button release using IF EZ G.BTNV. That’s actually pretty cool when you think about it! I take back my “it’s a little annoying” comment :slight_smile:


#15

Yeah, in fact it makes a lot of sense and solves a lot of questions i was wondering !


#16

I’ve got a coding question : how would you create 16 “radio groups” from left to right ? I feel like a need a loop within a loop but cannot get it work.

my guess was :

I:
L 0 15 : SCRIPT 8

8:
A MUL I 8
G.BTX A I 0 1 1 1 7 1 1 8

but it doesn’t work.

EDIT, found the answer in some code of the grid studies :

I:
L 0 15 : Y I; SCRIPT 8

8:
A MUL Y 8
G.BTX A Y 0 1 1 1 7 1 1 8

So the question is : Why can’t i just use I directly ?


#17

Then another feature request : could we have 16 GROUPS ? this will allow to make 16 radio groups.


#18

In markdown, typing a block surrounded by triple backticks gives you code formatting.

Code surrounded by ``` above and below

#19

So here is a version of Daemon to work with Just Type:

Step sequencer triggering 5 different notes from a chord.
Chords are stored in patterns, you can change these. The lowest row plays the root note one octave lower.
Chords can be switched using the lower buttons
There is a start stop button and script speed is taken from the Param knob

EDIT Now with added forward/reverse and chord editor mode - I’ve updated the code below

It is pretty much an extension of @scanner_darkly 's trigger sequencer study.

Next I’d like to try and add a grid based chord editor!

#1
G.BTN 96 9 7 1 1 1 4 3
G.GRP 3
G.BTN 97 14 7 1 1 1 4 4
G.GRP 5
G.FDR 4 11 7 2 1 0 2 1 0
G.GFDR.RN 5 -1 1; G.FDR.V 1

#2
G.BTN.SW G.BTNI
C - G.BTNI 80
L 0 3: G.FDR.V I PN - 3 I C

#3
M.ACT G.BTNV

#4
G.GRP.EN 0 - 1 G.BTN.V 97
G.GRP 4
G.FDX 0 0 1 16 1 0 2 5 1 4
G.GFDR.RN 4 0 15
G.GRP.EN 4 G.BTN.V 97
L 0 3: G.FDR.V I PN - 3 I C

#5
PN - 3 G.FDRI C G.FDRV

#6

#7
IF > Y 3: JF.NOTE N PN 0 C V 8
ELSE: B PN - 3 Y C
IF < Y 4: JF.NOTE N + B 12 V 8

#8
D + Z * 16 Y
G.BTN.L D 8
IF G.BTN.V D: SCRIPT 7
JF.MODE 1; JF.SHIFT V -1

#M
Z WRAP + Z G.FDR.V 4 0 15
G.GBTN.L 0 2 2
L 0 4: Y I; SCRIPT 8
M SCALE 0 16383 500 50 PARAM

#I
G.GRP 0
G.BTX 0 0 1 1 1 1 2 0 16 5
G.GRP 1
G.BTX 80 0 6 1 1 1 4 2 8 2
G.GRP 2
SCRIPT 1

#P
8 8 8 8
1 1 1 1
0 0 0 0
63 63 63 63

0 4 7 11
2 5 9 12
4 7 11 14
5 9 12 16
7 11 14 16
9 12 16 17
11 14 17 19
12 16 19 21


#20

Wow that’s simply beautiful. Definitely adding this scene to my Teletype :smiley: