> teletype: grid # code exchange

teletype

#122

Is that a relatively recent change? Because it’s directly contradicted by the docs. By Studies, at least.


#123

no, it’s always been this way. can you post a link to the study? it might just be a typo.


#125

From https://monome.org/docs/modular/teletype/studies-5/ :

Teletype has patterns which normal programming languages call arrays. You can think of a pattern as a fixed-length list of numbers.

  • Each pattern has 64 indexes (positions).
  • There are four patterns.
  • Patterns store the same data type as the rest of Teletype: -32384 to 32384.
  • Patterns are stored with the scene.

(Emphasis mine)

Been this way a long time I think…


#126

yeah, that’s definitely incorrect. numeric values in teletype have the full range of a 16 bit signed integer.


#127

One or two workarounds later and here we are:

ALTERED BEAST

7-ROW GATE SEQUENCER WITH
BONUS MELODY TRACK

TR 1 IN: CLOCK (DISABLE M)
PARAM: INTERNAL CLOCK

TOP 7 ROWS: TWIDDLE BITS
FOR OUTPUT TO TR 1-4 OUT
AND CV 1-3 OUT
(TR 1 OUT WILL PULSE)

BTM ROW 1-7: RANDOMIZE ROW
BTM ROW 9-12: SELECT BANK

HOLD BTM ROW 15 + BANK:
COPY CURRENT BANK TO IT

MELODY: PATTERN 4, CV 4



#1
D % + D 1 16
L 0 6: X I; SCRIPT 7
G.CLR; G.RCT D 0 D 6 0 -2

#2
B G.BTNX; C G.BTNY; P.N 0
C + C * G.FDR.V 0 7
IF G.BTNV: P C BSET P C B
ELSE: P C BCLR P C B

#3
IF G.BTNV: BREAK
T * G.FDR.V 0 7; C * A 7
L 0 6: PN 0 + C I PN 0 + T I
L 0 111: X I; SCRIPT 5

#4
C * G.FDR.V 0 7
B + G.BTNX C; P.N 0
IF ! G.BTNV: BREAK
P B RRAND 0 32767
IF TOSS: P B * P B -1
L 0 111: X I; SCRIPT 5

#5
Y / X 16; C % X 16
Y + Y * G.FDR.V 0 7
G.BTN.V X BGET PN 0 Y C

#6
T G.BTN.V 119
IF T: A G.FDRV
IF T: G.FDR.V 0 Z; BREAK
Z G.FDRV
L 0 111: X I; SCRIPT 5

#7
C G.FDR.V 0
T BGET PN 0 + * C 7 X D
IF && T == X 0: TR.P 1
IF && > X 0 < X 4: TR + X 1 T
IF > X 3: CV - X 3 V * 5 T
CV 4 N PN 3 D

#8

#M
M SCALE 0 V 10 500 50 PRM
SCRIPT 1

#I
G.GBX 1 0 0 0 1 1 1 0 2 16 7
G.GBX 2 112 0 7 1 1 0 4 4 7 1
G.GFD 3 0 8 7 4 1 0 9 6
L 0 111: X I; SCRIPT 5
G.GFDR.RN 3 0 3
G.BTN 119 15 7 1 1 0 4 3

#P
2	0	0	1
1	1	1	1
0	0	0	0
63	63	63	63

-1	0	0	2
-24187	0	0	0
26202	0	0	11
-16122	0	0	9
17993	0	0	7
-24991	0	0	0
353	0	0	6
8093	0	0	9
0	0	0	0
0	0	0	0
0	0	0	3
0	0	0	3
0	0	0	3
0	0	0	0
-1	0	0	0
13594	0	0	0
-31664	0	0	0
-16122	0	0	0
-14775	0	0	0
-21723	0	0	0
3104	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
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
1111111111111111
1010000110000101
0101101001100110
0110000010000011
1001001001100010
1000011001111001
1000011010000000
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

I would need one more script to get melody editing in, but at least you can prep the pattern beforehand… meh.


#128

I have a request - is it possible to make Ricochet now that the Chaos operators have been intrduced as that sequencer uses cellular automata?




#129

Yes, it looks totally feasible. I’d just store the x/y value of each ‘particle’ using a Pairing Function, along with its direction and update it all on each clock tick.

I’m away from my TT for a few days but I’ll certainly have a go when I’m back in front of it. Very inspiring.


#130

thankyou - it does seem a little bit like the pong sequencer but with the added chaos op


#131

@mlogger great idea! Looking forward to seeing what you come up with @burn


#132

I’ve been asked about the tt script I played “wanfeng” with. I guess it’s good to share it here.

It’s a grid fretboard for JT with 2 sliders controlling CVs, the horizonal slider would output voltages that form a pitch scale to play with. The top right corner is a button that change the JF.RUN value. Basic and playable. :waning_gibbous_moon:

BASIC JT + W/



#1
A N + * - 7 G.BTNY 5 G.BTNX
IF G.BTNV: G.CLR; CV 4 A
X - G.BTNX 1; Y - G.BTNY 1
IF G.BTNV: JF.NOTE A V 4
IF G.BTNV: G.REC X Y 3 3 0 0
TR 4 G.BTNV

#2
CV 1 G.FDR.V 1
CV 2 VV PN 1 G.FDR.N 2

#3
JF.RUN * G.BTN.V 1 V 4

#4

#5

#6

#7

#8

#M
CV 3 VV PN 1 RAND 15

#I
JF.MODE 1; JF.RMODE 1
G.BTX 100 0 0 1 1 0 4 1 15 7
G.BTN 1 15 0 1 1 1 7 3
G.FDR 1 15 1 1 7 3 5 2
G.FDR 2 0 7 15 1 2 5 2
JF.SHIFT V -2

#P
9	15	1	0
1	1	1	1
0	0	0	0
63	63	63	63

0	0	19	0
2	83	0	0
4	94	14	0
7	105	0	0
9	125	0	0
14	140	0	0
16	157	0	0
21	187	0	0
23	210	0	0
0	250	0	0
0	281	0	0
0	315	0	0
0	375	0	0
0	420	0	0
0	500	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
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
0110000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000

0	6	0	13	0	0	0	0	0	0	0	0	0	0	0	0
0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0

#133

excellent, thanks for posting it! added it to the code exchange page.


#136

Oops, will delete and repost.


#137

Here is a little isomorphic keyboard. Moving left to right moves up a half step. Moving top to bottom moves up a fifth. The param knob shifts the whole keyboard. I think there is either a bug in my firmware or a bug in my scene because shifting can cause the grid display to glitch out, although after pressing some keys it rectifies itself. EDIT: I use the metro script to “sample” the param knob—it would be cool to instead have a script that fires whenever the param knob changes. EDIT 2: I should mention pressing keys cycles through all 4 pairs of TR/CV outs—change the line X % + X 1 4 to use 1, 2, or 3 outs instead. EDIT 3: Fixed an issue when transposing with the param knob.

ISO

PARAM IS OFFSET
TR/CV PAIRS ARE NOTES



#1
IF EZ G.BTNV: BREAK
A % G.BTNI 16; B / G.BTNI 16
C + A * B 5; I + X 1
CV I N + C PARAM; TR.PULSE I
X % + X 1 4

#2

#3

#4

#5

#6

#7
B % Z 16; C / Z 16
D % + Y + B * C 5 12
T && < D 5 EZ % D 2
T || T && > D 4 NZ % D 2
G.BTN.L Z * T 8

#8
B % A 16; C / A 16
D % + Y + B * C 5 12
T && < D 5 EZ % D 2
T || T && > D 4 NZ % D 2
G.BTN A B C 1 1 0 * T 8 1

#M
IF EZ M.ACT: BREAK
M.ACT 0; Y PARAM
L 0 127: Z I; SCRIPT 7
M.ACT 1

#I
G.RST; PARAM.SCALE 0 127
Y PARAM
L 0 127: A I; SCRIPT 8
M 10; M.ACT 1

#P
64	0	0	0
1	1	1	1
0	0	0	0
63	63	63	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	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
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

#138

I’m sure this is probably covered somewhere but I can’t seem to find it. Many of the scripts above include a binary and (signed int?) matrix labeled as:

#G

What is this? Did grid ops introduce a new storage matrix somewhere? Can someone point me to more info?


#139

cool idea with using PARAM to transpose!

glitching is probably due to redefining buttons each time PARAM value changes. i would try changing it to define buttons once and then using a different formula to calculate a note. or try adding G.RST to metro and see if that helps.

also looks like you’re applying PARAM twice? once when defining buttons and then adding it to CV?

@EqualTemperament - #G section stores the states of grid buttons and faders, this way your scene’s grid state is saved with the scene (useful if you’re building a sequencer, for instance).


#140

Thanks! Still a little confused though. Is there a keystroke to access the numerical values on the Teletype? Or is this data encoded by actually using the grid or grid view?

For example if I wanted to try @MengQiMusic’s patch above where some of the G values are non-zero, where would these get entered?

#G
0110000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000000000000000

0	6	0	13	0	0	0	0	0	0	0	0	0	0	0	0
0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0

#141

@EqualTemperament The hash and digit are just headings in the txt file of the Scene dump, created when a USB drive is inserted into the Teletype. They are not part of a script.

The #G section is just a representation of the state of your Grid (or the TT grid page) when the Scene was saved.

The point of reproducing the listings in this format is that you can pop them in a text file and load them into your TT via a usb stick - without having to enter them in line-by-line.


#142

Got it. Thank you. I am just now realizing that the Teletype has a USB disk mode, and with that realization, it all makes a lot more sense!


#143

That’s it. I was just adding to my post to make that clear!

If you insert a usb drive and wait for a few seconds, the screen will display Write… all 32 Scenes get dumped.

If you have made a change to one and want to load it back in, you just need to remove the ‘s’ suffix from the filename. (I think. I’ve only done it once).


#144

Is it safe to eject the USB drive once the process completes without powering off Teletype?