Teletype feature request: swing

Hi,

There are a couple of threads about adding swing timing to teletype. They work but waste a few variables, etc. adding a swing command for M would save bit of resources and allow easy addition to already created scripts. Also beneficial for live mode. I believe something like:

M.SWING

With either a raw millisecond number or percentage of M would be logical. If accepted, we could also talk about positive and negative swing.

Thanks.

No need to waste any variables: Unless you absolutely have to have the metronome itself swing, you can just do

M:
$ 1
DEL / * M 10 25: $ 1

where script 1 does the swinging action, e.g.

1: 
TR.P 1

you can fine adjust by adjusting the divider, i.e. 25 in the example above. 20 is straight rhythm (at twice the speed of M), anything below 20 is slowing the off beat down, anything above is speeding it up. You can of course also just do

M: 
$ 1
DEL / M 3: $ 1

but I like being able to adjust it in finer steps.

4 Likes

Wouldn’t this pulse output 1 twice per clock in either case?

Yes. The shuffled beat runs twice as fast as M. Usually, that’s not much of an issue (just turn M to half the speed you want the clock to be). If your use case requires you to have M itself swing, this will not help - that’s why I pointed that out in my post.

Ah. I see. I would definitely prefer M to swing.

if you don’t use FLIP for anything else you could do

IF FLIP: M a
ELSE: M b

alternatively:

EVERY 2: M a
OTHER: M b

if you on 2.3 beta you can also do it in one line: M ? FLIP a b

a fun thing to do would be to use PARAM knob to control the amount. let’s say T stores cycle length. then you could do:

I SCALE 0 V 10 0 / T 2 PARAM
M ? FLIP - T I + T I

edit: you also need to add M.RESET at the end to make it work.

3 Likes

Confusingly, this isn’t working for me.

M:
M ? FLIP 500 5000
A M
TR.P 1

I’m watching A, and it’s definitely flipping between 500 and 5000 – but the pulse and the change to A are still happening every 500 milliseconds, steadily.

ah yeah, i looked at the code and the way it works right now is a bit confusing. if you change the Metro rate from the Metro script itself, and you change it to a smaller value it will use the new rate, but if you change it to a higher value the change will only happen on the next clock.

there is a way to solve it - just reset the metro clock after changing the rate with M.RESET. i’ve just tested it and can confirm it works.

1 Like

Ok, thanks. I stand by my assertion that an M.SWING command would make this a lot easier!

Scanner mentioned the ? ops in a message to me, and I see it in use here. Looks like it condenses If Else function. I think I understand how it works, can’t find any documentation on it, though. Curious.

1 Like