It’s used here to prevent running scripts when a trigger is received to one of the input jacks. But the $ op ignores it. Probably both of these places should check the mute settings (or just move it inside the code for running any script) and if you wanted to only disable the input jacks you could set $.POL 0. Dunno if that explains the behavior you’re seeing but I think someone else asked recently about the $ op ignoring the mute settings.

3 Likes

Thank you for parsing the code (and sorry for not catching the recent ask about this, wasn’t able to find it, perhaps my word searches were not precisely correct).

I figured it was something like what you describe but couldn’t figure out why… is there a use case for $ op ignoring the mute state? I don’t see any issue with it being treated the same as trigger inputs, seems simpler that way… but maybe I’m missing something.

Also I don’t see $.POL on the list of ops. It sets the “polarity” of the script to 0? Or it’s telling the script to “not poll”? Are you saying this is a work around that would make it possible to disable input jacks but not $ calls if the mute state affects both, or is toggling this a work around for me in the absence of of the mute state affecting both (where toggling 0-1 has the effect of muting/unmuting the script regardless of whether it’s being called from). It seems like you’re saying the former, but it seems (in my head, in the absence of documentation) like this op would do the latter :stuck_out_tongue:

Per https://monome.org/docs/teletype/manual/

SCRIPT.POL / $.POL - get / set script polarity. 1 to fire on rising edges as usual, 2 for falling edges, 3 for both. indicated on live mode w/ mutes icon.

There is an open issue regarding the script mutes on github. I like the solution of POL.$ 0 for changing the reaction to external triggers! I’ll xpost on the 3.2 features thread.

1 Like

oh the manual, whoever would’ve thought to check there :laughing: (I’ve always looked at the pdf command reference, this manual thing seems like it might be useful :stuck_out_tongue_winking_eye: ) thanks again :slight_smile:

2 Likes

Hi! I forgot my txis back home so im using my 16n for parameter control but im running on a few problems.
Is there a way where i can do fader.scale (and then the number of the faders like 1 5 9 13) and then the range 0 to 4500?

I have found out i can do this i the faders are sequential meaning i can do
L 1 4: fader.scale I 0 4500 but most of the times the faders i want to scale are not next to each other ie fader 1 5 9 or 23.

Also seems like I have to do a FADER.CAL.MAX on the init script to get the fader in the right range? So i have to start with the faders all the way up and then run the I script or F10, then the faders scle correctly. Im i doing this right?

Thanks!

Mute breaks the connection between the trigger in jacks and the actual execution of scripts.

Example: I use the triggers to sense hi/lo on 1-8 and the code handles this as mute “something”.

IF STATE 1: BRK
SC.TR.P 1
1 Like

Yes csboling and desolationjones cleared it up for me—my confusion was entirely to do with the different treatment of internal vs external triggers.

Are you saying that by breaking the connection, you can use trigger input 1 to trigger ER-301, while simultaneously using $ 1 for something unrelated? Is this the use-case for not having internal/external trigger muting linked? It seems like the solution discussed above would allow the shortcut muting to stop the script from executing, while allowing you to reroute the trigger input using SCRIPT.POL unless I’m missing something… not sure if you’re disagreeing or just explaining, but it is an interesting example if I’m understanding correctly…

I have a addac manual latches next to my tt. It’s a module that sends high (5V?) on button press and low (0V) otherwise. Channels 2-8 are connected to trigger 2-8 on tt. I always mute the channels 2-8 in init.

If snare is generated on the 301 it’s always port 3 (main snare) or port 4 (alternate/extra/odd snare), and I always mute it with channel 2 on the manual latches. All rhythms are generated algorithmically in the tt. So supposed I have the snare in script by itself, the beginning of that script would be

IF STATE 2: BRK

Followed by whatever the snare generation is, ending somewhere with something like

SC.TR.P 3

These are just basic examples, sometimes things get a bit more involved, but the basic idea is always the same: mute the trigger ins, generate triggers internally, don’t trigger if the corresponding latches is sending high to trigger in.

If you wanna see it in action (scene + link to YouTube with a performance of the track), all my teletype code is on GitHub here: http://teletype.a773.dk

NB obviously this is just how I like to do things, the great thing about tt is each user gets to use it in a way that fits their music…

3 Likes

I am aware that I can do this on a triggered script 1 say;

IF EZ RRAND 1 10: $2
and then do some fills or something on script 2
… But how could I do the conditional in Script 1 , which would involve another Pre after the IF: pre?

this won’t do what I am asking for example, it will always trigger the DEL.G

IF EZ RRAND 1 10: TR.P 2 
DEL.G 4 M 1 2: TR.P 2

You could try inverting your first condition and use BREAK to end the script if true. This method works well when you need sequential conditionals.

I am noticing that your RRAND 1 10 will never equal zero. So instead RND 9 (generate a random number from 0 to 9) will work to give you a 90% chance of continuing the script:

IF NZ RND 9: BRK 
DEL.G 4 M 1 2: TR.P 2
2 Likes

you could also replace IF NZ RND 9: with PROB 90: (probability 0-100)

I think @desolationjones BRK approach is usually the best one, but sometimes it’s not ideal if you want to run further lines below the next. Occasionally a different approach using the ternary IF operator is possible, which lets you put a conditional right in the place where a value might be in your expression.

For example, DEL.G ? RND 9 1 4 M 1 2: TR.P 2 might work (although I suspect the line is too long in this case!)

The ? RND 9 1 4 parts checks if RND 9 evaluates as non-zero. If it does then the whole expression returns 1, otherwise it returns 4. So 90% of the time you’ll get one repeat and 10% of the time you’ll get 4.

If it is too long, you can always set a temporary variable with the number of repeats using the ternary if first and the use it in your delay.

sorry I tryped the script into the forum box from memory, and made a logic error there. You are correct. The BRK method I was aware of, but as @SimonKirby points out, sometimes its wasteful because I lose statement space in the script that is being broken out of

I think this may be a way of doing it? It assigns to local script variable, and uses the fact that TR.P n is zero , nothing is triggered

K EZ RND 4
DEL.G 4 M 1 2: TR.P * K 2

The number after the ..* K represents the trigger output to pulse

Alternatively, get more out of the assignment. Using the same RND and some logic shifting to fire the trigger out of different trigger outputs ( I have 8 with the Ansible connected )

K RND 8
DEL.G 8 M 1 2: TR.P * K NZ ~ K

i’ve been editing this post, as I edit the TT… so apologies if you are following it and keep seeing the scripts change :wink: slow live coding

here is the version I like best. I’ve been using the new DEL.G pre but it could be a DEL.X if you haven’t built the new version yet.

J 8; K RND J
EVERY K: TR.P K
IF NZ K: BRK
DEL.G 4 M 1 2: TR.P RND J

J relates to the probability and the number of trigger outputs available. I have 8 with the Ansible connected. I am enjoying this script playing all eight inputs of the ALM Squidsalmple with the Roland R8 kit

2 Likes

Hi! Can i set the range of non consecutive faders?
Like FADER.SCALE 1,5,9,13 0 4500 ?
So what im trying to do i set the scale of faders 1,5,9 and 13 from 0 to 4500.
Im running out of space so i wonder if there is a way to achieve this.
Thanks!

you could save fader indexes in a pattern bank and then use a loop to set the ones you want with one line.

Thanks @scanner_darkly thats what i thought of doing :slight_smile: but since the pattern needs to advance should i place this on the metro script?

FADER.SCALE 1 PN.NEXT 0 0 4500

or since you mention a loop then

L 1 4: FADER.SCALE 1 PN.NEXT 0 0 4500

Dont i need to place the I somewhere in the loop?

Thanks for your gratitude!

EDITED: wont fit on a single line :frowning:

use the FB.S alias.
also remove 1 after FADER.SCALE, should be something like this:

L 1 4: FB.S PN.NEXT 0 0 4500

Should i place that line on metro so p.next keeps advancing?

Thanks!

Figured it out, i placed it on the init script,

Thanks!

1 Like

How do you deal with division that result non integer values? I tried to slow down the
division. E.g by using 1.6 instead of 2. But
X / 4 3 results in 1
What would be a workaround for this example

I feel there’s a easy solution but I can’t see it