> teletype: grid # code exchange



@EqualTemperament suggested using SCENE op as a way to extend scripts - dedicate one scene to setting up your grid controls and then call it from the main scene.


Wow! Why did I never think of this? That will open up lots of possibilities. Thanks!!


This post (Teletype 3.+ feature requests and discussion) gave me a MS EXCEL flashback. Not exactly the same as a norm dist OP with mean and std, but you can calculate it outside and provide it as a discrete lookup table.

edit: One thing I have to fix is not every $1 trig provides a value.

edit 2: need to fix output binning, skews to right.

Edit 3: I think I fixed it. Also using local K to free up global R at the expense of 1 line.

PN 0: LOOKUP DIST (/100)
$ 1: STEP BY 1
$ 2: STEP BY 1000

K RRAND 0 99
W <= J K: J + J P.NEXT
PN.+ 1 P.I 1

L 0 1000: $ 1


5	0	0	0
11	0	0	0
21	0	0	0
26	0	0	0
21	0	0	0
11	0	0	0
5	0	0	0


The code for Grid ops is extremely complicated to me at the moment, dunno if I’ll ever get my head around it.


Is it perhaps that there is so much available? (of course a good thing). When I first came across it I was a bit overwhelmed - and I’m not a coder. So I set myself some simple tasks - like light up each button going right to left and when all buttons are fully lit - clear and start again. Do the same for going up and then down; throw in a little random. Found it useful just to get the feel of it.


this study should be a good start: https://github.com/scanner-darkly/teletype/wiki/STARTING-SIMPLE


I’ve tried this technique with SCENE to extend scripts, but I’m not sure to understand how to implement it, it has to be called manually, is that correct ? If I call a SCENE from another one, it won’t execute the INIT script of this second SCENE ? Is it possible to provide an example of how to use this technique please ?


yeah, it doesn’t execute init when you use SCENE:

but i think there are several ways to work around that (disclaimer: i haven’t tried any of this, just brainstorming). let’s say scene 1 is your main scene and scene 2 is the grid controls setup.

the easiest solution is to manually execute the init script. so in scene 1 init you do whatever you need to setup in your main scene and then the last line does SCENE 2. at this point it loads scene 2, you press F10 (or use grid control to execute init if you have grid already connected), it does what it needs to do and then as the last step executes SCENE 1.

a variation of the above that could make it easier: in scene 2 you create an extra button somewhere that executes the init script, and in the init just before it switches back to scene 1 you hide the button so it’s not in the way. this way you don’t have to switch to grid control mode.

another option: do initialization in metro script in scene 2. so, scene 1 loads, the init script switches to scene 2, at the next metro execution it will create all the grid controls and switch to scene 1. in this case you have to make sure you don’t put SCENE 2 in your scene 1 metro, otherwise it’ll create an endless loop!


Thanks for your reply and this detailed explanation. I will try one of these solutions.


YEAH (+ 16 characters)


Just wondered whether there could be an option on this - either at firmware load or specialised word?


yeah, perhaps a separate op which could be marked as “experimental” similarly to M!. this thread is a better place for discussion: Teletype 3.+ feature requests and discussion do you want to post there?


trying to crowdsource this issue i’m having…

I’m new to TT and grid ops (and coding!) and with grid ops studies under my belt (yet still referencing), i wanted to check out the non-jf fugetta scene by @ghost. his script descriptions made it especially appealing as a beginner. I’m having an issue though and maybe someone has tried this out there.

i copied the scene a few times and had the same issue every time: no cv outs. are there lines i need to add to define cv values or variables? additionally, the 3 bottom right buttons (vertically) are wigging out a little, for lack of a better term, and the entire scene glitches out my grid to some extent. Is this because I’m running TT 3.0? would that have something to do with it?

any and all advice is greatly appreciated.


do you get triggers output but not CV? from what i can tell you shouldn’t have to do anything to enable CV.

no, running tt 3.0 shouldn’t cause anything like this. could you describe what you’re seeing a bit more? i’ll try to test the scene sometime next week as well.


Here’s what’s happening, apologies for the lack of quality in the clip. I’m getting trigger outs as you can see and hear, but no cv. The bottom right 3 buttons are flashing very fast (maybe related to the speed defined by the param knob, though I’m not quite sure). Those buttons are not toggled on. Strange.


thanks for the video! i’ll test the scene and report back (won’t be able to get to it until next week though)

just a quick look for now: i think you’re meant to initialize your own scale in pattern values 9-15 (pattern bank 0). this is likely why you’re not seeing CV change. enter some values there (they are in semitones).

flickering is likely caused by reinitializing some grid controls which shouldn’t be necessary but hard to tell from a quick glance, i’ll need to parse the scene.


Is there a way to display a fine meter type visualization kind of like a read-only fader at fine levels? I could use fader with type 4, but the inc/dec buttons obscure the lowest and highest leds.


Thanks, @scanner_darkly! I’ll give it a shot when I get home. @ghost, do you remember if this is something you did?


right now there is nothing like that, but you could replicate that with G.REC and G.LED. something like this (value we want to display is in variable A):

G.REC 0 Y / A 16 1 15 15
G.LED / A 16 Y % A 16

this is a horizontal version and it will use row Y - replace with whatever row you want. the max value you can display this way is 255, so you might need to scale A first too to bring it into the 0…255 range.


Yes you do need to also copy the pattern information as well as the scripts. P0 9-15 relate to scale notes as @scanner_darkly points out.

Fingers crossed that works! Sorry I’m not much more help. Out of the loop with Teletype right now…