> teletype: grid # code exchange

Thank you! Glad you like it. XD
I finally got a real Omnichord recently, just find the chromatic layout of the origin is so convinient. I didn’t realize that when making this script and thought normal halt-tone layout is better. The origin’s chords use different voicing to keep all chords are at about the same range, it sounds super smooth when playing. What a clever design.

1 Like

This is brilliant, thank you so much! It’s a perfect learning experience to see a scene with the same result but making a lot more efficient use of the code. I had no idea that the I variable could be “passed along” between scripts — I thought it was local to each line, let alone each script!

1 Like

Glad to hear you found my version useful. There are so many ways to do things in Teletype, it’s a fun exercise to try to think of different ways of achieving the same or similar results as another script.

1 Like

Hi there. I’m back to TT after a few years. A bit rusty…
I’m trying to populate a pattern with midi notes incoming close together.
If the script was not running during the previous 1000ms, erase the pattern, and add notes from index 0.

Any help ?

EDIT : I managed to register and append incoming notes. But fast incoming notes (like hitting a chord) are not registered. Is there a timing limit for incoming notes to be recognized ?
The code above lets me monitor the notes being added to the pattern :

I : MI.$ 1 1

1: 
IF GT LAST 1 1000: O 0
P O MI.LN

It’s been a while since I’ve written a MIDI scene, but IIRC Teletype does not iterate through MIDI events for you. MI.$ will be called once no matter how many notes have been played since the last iteration of Teletype’s event loop. You have to iterate through the notes themselves from within MI.$ with L 1 MI.LN: .... In practice, this means that you usually have to throw away two scripts just to iterate separately through the note-on and note-off events.

This feature is the most frustrating part of MIDI handling on Teletype, and I don’t really understand why it behaves this way. I’m sure the devs tried an implementation that calls MI.$ once per note, and discarded that idea. Perhaps it resulted in missed notes?

1 Like

teletype checks MIDI events every 25ms. even with frequency this high (which is actually higher than teletype checking for new keyboard events or reading AD converters) in my testing some events would get dropped, especially if you try to play chords or move several knobs at once. storing MIDI events in a buffer and providing ops to iterate over that buffer was the only way to avoid having dropped events.

so in your script 1 you need to do L 1 MI.NL: P O MI.N

there is a reason the iterated op versions use shorter names so that in a lot of cases you can just use a simple loop.

you can assign both events to the same script and check the latest event type with MI.LE.

[this thread is a better place for MIDI op related questions: Teletype MIDI IN ops]

2 Likes

Are you guaranteed that the script will be called at least once for each event type?

the way it works:

  • it checks for new MIDI events in the main event loop
  • when any MIDI events arrive, they are placed into a buffer that can hold up to 10 events. there are separate buffers for note on, note off and cc
  • every 25 ms a timer handler will check if there are any events in the buffer and will call a script assigned to the event type. each script is called only once even if it’s assigned to multiple event types

if you have other questions related to MIDI ops let’s continue in the dedicated thread linked above.

2 Likes

Love this a lot! But I dont’t have 2 JFs, changed the code a tiny bit for using with JF and W/synth
GENTLE ANTAGONISM W:JF.txt (1.1 KB)

7 Likes

Hello everyone!
I’ve had teletype for a few weeks and have had tons of fun building a group of physics based scenes, with visualization via the grid. The first one I made is a bouncing ball simulator, designed for pairing with Just Friends. There isn’t too much user input to it but this was made less of a interactive tool and more of a random rhythm and melody generator.

The concept is relatively simple: there are 6 travelers that spawn with random position and velocity vectors in 2 dimensional space. When a traveler collides with a wall, it generates a note (via JF.VOX) with a random pitch from a user entered scale and random velocity. Parameter knob can be adjusted to “activate” up to 6 travelers (one for each channel of JF in synth mode). Pressing a key on the grid will change the bounding box of the travelers, adjusting the bottom right corner of the rectangle (0,0 always being the top left). I also included some smooth random CV outputs for modulation of other modules in your rack.

Some notes about the scene:

  1. I know the “bouncing ball” concept has been done a few times, I wanted to explore the implementation of the concept in the teletype ecosystem. I also have not seen anyone implement it using oblique angles, only 45 degree increments.

  2. Because I am quantizing the traveler positions to display on the grid, sometimes the path will look like it’s meandering. I knew implementing some kind of anti-aliasing algorithm would completely side track the project so I left it as is.

  3. I ran out of room multiple times and had to refactor some of the scripts multiple times to get it to fit. I sacrificed scripts 7 and 8 to implement a nested loop to create a trailing effect on travelers. I think it was worth it because it looks cool ¯\ _ (ツ) _ /¯.

  4. A keen eye will see that the buttons are declared every time M runs. I couldn’t figure out how to squeeze it into init so thats where it lives. I didn’t see a big performance hit so I left it as is.

  5. If you don’t have a Just Friends the script can easily adapted to use the CV/TR outputs on Teletype. I’ll leave that as an exercise to the reader :slight_smile:

  6. I would put some future refinement ideas down, however I don’t think there’s room for anything else in the scene without sacrificing any of the existing features.

I don’t have a demo video posted anywhere, I can upload something if anyone would like. Please try it out and let me know what you think!

BOUNCE

BOUNCE 6
JF MODE: TRANSIENT/SOUND
HIT GRID KEY TO LIMIT BOUNDS
OF EXPLORATION. INCREASE
PARAM FOR MORE FRIENDS.
CVS OUTPUT SMOOTH RANDOM
VOLTAGE FOR MODULATION

#1
PN 0 A + PN 0 A PN 2 A
PN 1 A + PN 1 A PN 3 A
IF > PN 0 A X: $ 3
IF < PN 0 A 0: $ 4
IF > PN 1 A Y: $ 5
IF < PN 1 A 0: $ 6

#2
G.BTX 1 0 0 1 1 0 0 0 16 8
L 0 15: C I; $ 7
I / PN 0 A 100; J / PN 1 A 100
G.LED I J 15

#3
I - PN 0 A X
PN 0 A - X I
J + A 6; PN 2 J * PN 2 J -1
J PN 0 RRAND 10 17
K V RRAND 1 5; I + A 1
JF.VOX I N J K

#4
PN 0 A * PN 0 A -1
J + A 6; I + A 1
PN 2 J * PN 2 J -1
J PN 0 RRAND 10 17
K V RRAND 1 5; I + A 1
JF.VOX I N J K

#5
I - PN 1 A Y
PN 1 A - Y I
J + A 6; PN 3 J * PN 3 J -1
J PN 0 RRAND 10 17
K V RRAND 1 5; I + A 1
JF.VOX I N J K

#6
PN 1 A * PN 1 A -1
J + A 6; I + A 1
PN 3 J * PN 3 J -1
J PN 0 RRAND 10 17
K V RRAND 1 5; I + A 1
JF.VOX I N J K

#7
L 0 7: D I; $ 8
L 1 4: CV.SLEW I 5000
EVERY 1000: CV 1 RAND V 8
EVERY 500: CV 2 RAND V 8
EVERY 600: CV 3 RAND V 8
EVERY 700: CV 4 RAND V 8

#8
J G.LED C D
IF > J 0: J - J 1; G.LED C D J
X * G.BTNX 100; X + X 99
Y * G.BTNY 100; Y + Y 99

#M
B - PRM 1; JF.SHIFT V -1
L 6 11: J - I 6; PN 2 J PN 2 I
L 0 5: PN 2 I / PN 2 I PRM
L 6 11: J - I 6; PN 3 J PN 3 I
L 0 5: PN 3 I / PN 3 I PRM
L 0 B: A I; $ 1; $ 2

#I
M 100; PARAM.SCALE 1 6
L 0 5: PN 0 I RAND 1599
L 0 5: PN 1 I RAND 799
L 6 11: PN 2 I RRAND -200 200
L 6 11: PN 3 I RRAND -100 100
JF.RMODE 1; JF.MODE 1

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

33	69	30	-1
23	4	14	-15
25	59	11	-7
99	51	32	12
29	44	21	6
51	76	7	12
0	0	181	-6
0	0	88	-92
0	0	68	-44
0	0	192	74
0	0	129	40
2	0	45	73
4	0	0	0
7	0	0	0
9	0	0	0
11	0	0	0
14	0	0	0
16	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
0	0	0	0
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

BOUNCE.txt (2.3 KB)

11 Likes

great work, added it to the codex!

1 Like

plockable trigger sequencer: Teletype concepts and thoughts - #38 by scanner_darkly

8 Likes

so glad you’re enjoying it! I only read this now, great work on changing the script! I actually already prepared it but then didn’t manage to post it so thank you for the help. I’m releasing a slightly different version soon btw (hopefully today)

2 Likes

I only very recently got a TT and JF. Really intrigued by GA but alas, I don’t have a second JF or a W/.

Would it be possible to modify it for 1 JF by allocating 3 or 4 JF voices to the Chord side and the remaining voices to the harmony side?

Edit: Sorry, that’s not a request but more of a general pondering as I try to get my head around the TT/JF relationship and possibilities.

2 Likes

Continuing the discussion from > teletype: grid # code exchange:

Hi, I procrastinated this release for quite a long time, you know life etc. but here is Gentle Antagonism v1.1!
it now “only” require 1x Just friends + 1x W/Synth to work efficiently. I realised that very few people own two JFs so the script was quite prohibitive.
Also: I removed the random multiplier on the metro because I felt that was disturbing when playing live and added a nice visual feedback for the loopers activity. the interface remains unaltered.

Main features:

  • Just Friends + W/ implementation
  • 2x 4oct quantised keyabords
  • 2x pattern recorder & lopper
  • loop enable toggle per looper
  • loop length control per looper
  • master scale selector
  • Antagonist enable toggle
  • NEW looper visualiser

(note that the Antagonist has to be on for the looper to work)
The antagonist works as before, playing 4 notes on the keyboard every now and then.

ok that’s it!

GA_V1.1.txt (2.2 KB)

8 Likes

Inspired by your trigger sequencer to adapt it into an alternative version that drops p-locking in favor of some randomization control and euclidean rhythm generation. FYI this version does not have controls for the model, you’ll need to set that directly on the EX.

PARAM controls tempo, and Script 4 is a reset. I’ve also added a clock pulse on TR 1.
Grid Setup as Follows:

Upper 4 rows are just a visualizer for the trigger patterns on voices 1-4.
Bottom row is a series of 16 buttons in groups of 4, for 4 “control pages” for each voice. Holding a button down will show 3 faders. Each page has the following controls (below description is buttons left to right, faders top to bottom)
1: Euclidean length, euclidean fill, pattern rotation (1-16). Setting length to 1 will mute the voice entirely.
2: Timbre, Color, randomization (all 0-1023). Randomization is bipolar around the “center” set by the other two controls and works on both simultaneously.
2: AR Rise, AR Fall, randomization (0-15). Randomization is bipolar and works only on AR Fall. Note the Init script automatically enables AR VCA.
3: Octave, note (in semitones), AR envelope FM (0-15). A good place to start when setting up.

All values are kept in the pattern page in case you want to save a preset.

ER-BRAIDS.txt (2.1 KB)

2 Likes

very nice - and great to see the concepts modded or serving as inspiration, that was exactly the goal!

1 Like

@scanner_darkly Hey! I was wondering if the tilt osc messages sent by one of the older grid models has ever been implemented in teletype grid ops or code? Is there a way i can DIY getting tilt x/y messages from an old grid into teletype?

2 Likes

should be doable in theory but not currently supported. not sure it would be super useful with teletype since you’d need to do something like polling for values from a super fast metro in order to get higher precision.

1 Like

maybe someone can help.

I want to output the first four pattern values (P0-3) at CV1-4, when i press a button. The button has the index -64

Not sure, if my grid code implementation is wrong or my loop implementation:

IF EQ G.BTNI -64: 
L 1 4: CV I VV P - I 1

any pointers are appreciated