Teletype unexpected behavior? (programming a clock divider)

Just made a small script for a clock divider.

EVERY 8: TR.PULSE 1
EVERY 16: TR.PULSE 2
EVERY 32: TR.PULSE 3
EVERY 64: TR.PULSE 4

For some reason, it was made in script 3.
Clocking it from input port 3 gave strange results, clocks did not come out of the 4 gate outputs synchronously as expected.
Copied the script to all scripts (1 to 8).
All outputs run synchronously when clocked from their respective gate inputs, except for input 3.

I and M scripts are empty.
I am running firmware 2.2 (8CBC031)

Any ideas?

Best,
Pascal

1 Like

Just checked with an oscilloscope and a faster script:

EVERY 2: TR.PULSE 1
EVERY 4: TR.PULSE 2
EVERY 8: TR.PULSE 3
EVERY 16: TR.PULSE 4

Outputs 2, 3, 4 run synchronously, but output 1 is 180° out of phase, this looks like a bug…
Could anyone replicate this and report please?

you’re reporting different possible problems: one with input, another with output. first narrow down that TR3 input is working. use a simpler script.

what is your trigger input source? have you tried simply triggering with the F1-F8 keys rather than an trigger input?

re: output, also test with F keys. try a simpler script, just TR.PULSE all four without the EVERY.

this will help you narrow down where the issue is

just TR.PULSE all four works well from input 3 as well as F3

as soon as the commands every x are added per line, things start to desynchronize…only happens with input 3 …

what’s your trigger source? have you tried a different trigger source?

no trigger source problem…

just figured out that it also happens on other input channels…

started with a fresh scene and programmed the scripts before triggering anything:
all works fine now :slight_smile:

so one should be aware of the fact that every time the scripts get triggered, the “every” counters are being incremented even if not used,
so if you program “every x” and want to sync everything up, no trigs should be applied before writing these scripts!

2 Likes

Each EVERY is incremented every time it is parsed, irrespective of whether there is anything after the colon.

Don’t forget you can use SYNC to get your EVERYs lined up (or not) at any point.

2 Likes

Hi Rikrak thanks!

Just adding
EVERY 16: SYNC 0
at the end of the script does the trick,

only the first run of the script stays out of sync if programmed with trigs present, but I can live with that:)

Best,
Pascal

1 Like

I assume you can’t put the sync at the top?

yes you can, but it won’t be executed until run 16 of the script…

could do something like this to sync everything externally or via live mode:
by using a variable (eg X) to sync and change the variable to 1 when sync is needed:

W X: SYNC 0
X 0
EVERY 2: TR.PULSE 1
EVERY 4: TR.PULSE 2
EVERY 8: TR.PULSE 3
EVERY 16: TR.PULSE 4

works fine, but needs a variable

Twenty characters of deleting to avoid confusion