one trick to save scripts when using grid ops is to assign the same script to multiple controls and then use G.BTNI or G.FDRI in a condition.

for your scene you could assign both prev/next buttons to the same script and then replace 7 and 8 with:

IF ! G.BTNV: BREAK
IF == G.BTNI 2: O - X + Z 1
ELSE: O.INC + Z 1
X O; Y + X Z
2 Likes

Thanks so much scanner_darkly!! My mind is slowly wrapping around this. I think I am getting it though. It says, If the button ID matches 2 decrement by Z, ELSE Increment by Z.

Would there then possibly be conflicts with the other buttons in my scene? I also have other buttons being used in the scene that I would guess might trigger the ELSE, since they are also not a matching ID.

Am I understanding it correctly?

Edit* Oh shoot. Scratch that. I get it. My other buttons aren’t associated to that script so there shouldn’t be a conflict. Thank you once again! I think this does it! All the best!

1 Like

yeah, the condition only works because there are only 2 buttons assigned to that script, if you had more you could use ELIF:

IF == G.BTNI 2: ...
ELIF == G.BTNI 3: ...
ELSE: ...

it doesn’t leave much space, so what you could do is:

I * G.BTNI G.BTNV
IF == I 2: ...
ELIF == I 3: ...
ELIF == I 4 ...

by storing it in a variable the conditions are shorter. and if it’s a release, G.BTNV will be zero, resulting in the variable being 0 regardless of what button was released, so you don’t need IF ! G.BTNV: BREAK line anymore (but you do need to change ELSE to another ELIF).

1 Like

I will be testing these ideas out tonight. Thanks again!!

Hey, I had a quick question about the Teletype. I’m hoping to use this now as my main sequencer, and I’m trying to learn a little about clock multiplying and adding something like 1/8 or 1/16 notes to my rhythms, especially when those hits can occur on the down beats.

So, to give you an example, every 1/4 or so, I am programming in some sustained notes on my Just Friends, This basically turns three of the voices in to sustained oscillators at defined notes. I’m then running the mixed audio to a LxD, and using the TR to hit the gate, passing the sound through. I get some great staccato chords as a result! But with this current system that I’ll write out.

Say, with the most basic, I have M 200 and in my M script, I place TR.P 1

Then, I get this (if each Dash is considered a 16th note and the X is a pulse)

X - - - X - - - X - - - X - - -

Say, on one of my TR pulses, like TR.P 2 I wanted a rhythm such as this;

X - X - X - X X X - X -

Or even just

X - X - X - X - X - X

Would there be some easy math methods of doing this?

If I understand you correctly, you have M running at a steady rate, right? So you have two options, run slow and use for DEL to inject faster events (DEL / M 2: TR.P 1) or run fast and skip the sub divisions you don’t need. I tend to run fast and only occasionally use DEL, mostly because it doesn’t mix with other PREs.

I’m always maintaining T in M (last line: T + 1 T), making sure T is 0 on first run (in I: T 0). With this and provided your M is running at 16th notes your rhythms could be written:

IF ! % T 4: TR.P 1
IF BGET 1493 % T 12: TR.P 2
IF ! % T 2: TR.P 2
4 Likes

Okay, this is helpful! This has raised two questions for me mainly because I feel an obnoxious need to 100% understand these things; how does BGET work in line 2? Is this to create some offset as to when the notes hit, potentially on down beats beats?

https://monome.org/docs/teletype/manual/#maths

BGET x y get bit y in value x

EDIT: So your rhythm is like this in binary: 1010 1011 1010 (spaces added for readability). Remember T is a counter is 0 on first pass, 1 on next pass etc. “% T 12” makes it wrap around (modulo) 12 so it goes 0 1 2 3 4…10 11 0 1 2 etc.

If you “pack” (actually convert) your binary rhythm into an integer it becomes 1493 (when you can convert from binary to int without a calculator, you really should take a break from the teletype!!!). So “BGET 1493 0” always returns 1 because the first bit in 1493 is set (1 in your binary rhythm), “BGET 1493 1” always returns 0 because the second bit in 1493 is unset (0 in your binary rhythm). But you’re calling BGET with a counter running from 0 to 11, that is inspecting a new bit on every pass.

There are “simpler” ways of doing this, but this is quite compact, in that you can compress a 16 step rhythm into one integer. Hope that helps…

5 Likes

This is really cool. This works well because I could create binary setups I enjoy and use other mathematics to either switch between them, scroll through them or generate occasionally random ones.

Thanks for this tip and the awesome explanation!

Exactly! Also math on T is fun (local or global), same with the other operand to modulo (12 in the above example).

And random can be conditional (add random number (0-3) to T if snare was hit two times within 5 M cycles).

1 Like

This is interesting! Could you share a bit how you would write this out? Your work on the TT has been a big inspiration for wanting to get more in to it. Seeing how well it could handle quantized music along with ambient has drawn me more and more to it.

I actually really really want to make a little toy calculator which simply converts XOX binary beats to decimal and back :laughing:

1 Like

on windows 10 you can switch calculator to programmer mode and use it to convert between binary and decimal. there are also many online conversion sites, but not sure how safe those are.

It was just an idea that popped into my sick mind. I’ll leave it as an exercise how to implement it. :grin:

1 Like

Topic: Variable J and K are fixed to 0.
I have installed Teletype v3.2. Right before I have written some variations like this in the $M: J % WRP + J Z 0 3 4 to understand different phrases effect.
J and K are now fixed to 0. Even if I change and reload other scences or repowering teletype again. If I type in live mode or trigger this from a script: J + J 1, J wouldnt change from 0 to 1. Cant see my mistake. Any hints for me what I`ve misunderstood or done?

Did what you’re doing work on an earlier version of the firmware? Could the problem be that J and K are local to each script? Changes to J in one script will have no effect on J in other scripts, or in live mode.

To debug scripts that use local variables, sometimes I just write the local value to one of the global variables by adding (e.g.) A J at the end of the script.

2 Likes

Never tried this on earlier version. Even if I write J 1 in lets say $3 or in live mode and then trigger $3 or simply write in live mode J, Teletype would not say 1. It says still J 0. Quite curious at first sight… and J is nowhere else used in the scene. Will review tomorrow and try a completely blank scene or perhaps try an earlier firmware / reinstall 3.2. I hoped that I have simply missed something obvious.

as @synthetivv said it’s expected - variables I, J and K are local to each script. this is on purpose - this way you can store up to 3 values in each script without tying global variables or worrying about accidentally overwriting them in a different script.

1 Like

Thank you! Yes must be this „local“ behaviour. Didn’t know that also K and J are local. But even in live mode it seems that they can’t be changed… which lead me completely to this trap :slight_smile:

that’s because live mode has its own execution context, so they would be local to it too (not sure if you set J in live mode if it retains it though - it’s possible live mode gets a new execution context each time you execute something).

1 Like