The scripts @tambouri provided worked fine. I had to make a change for the long line and add an I script to define the pattern length.

Would it be more helpful to edit the top post to include the working code, or just enter it in a post at the bottom?

Thanks to all who helped in this. To me, this opens a lot of possibilities for handling rhythmic structures. Much better than relying on multiple clocking modules to get there. And… only 2 scripts. 6 scripts slots left open to handle the rest of a composition.

Amazing tools…

4 Likes

[quote=“carvingcode, post:21, topic:5188”]
Would it be more helpful to edit the top post to include the working code…?
[/quote]i think so

great topic

2 Likes

And perhaps add a link to this thread to the Teletype code exchange

1 Like

OK, before I transfer the code up top, would you all check this over to make sure it fits into your logic? What I tried to do is modify the scripts so that only one clocking source (jack #1) would be necessary. Do you see any problems?)

SCRIPT I (init):

P.L 32                        // Set pattern length

SCRIPT 1:

Y ADD Y 1
Z P.HERE                      // Get current pattern position
IF ER Z 12 X : TR.PULSE A     // Euclidian Pulse
X MOD ADD X 1 12              // Play out ER
IF EZ MOD X 6 : P.NEXT        // Move to next pattern position
IF EQ Y 24 : SCRIPT 2         // Reached end of pattern

SCRIPT 2:

X 0                           // Init
Y 0
P.N 0                         // Set working pattern
P.I 0                         // Set pattern to 1st position

PATTERN 0 : 
1 1 0 0 0 0 1 1 1 1 2 2 3 3 4 6 4 4 6 4 3 3 2 2 1 1 1 1 0 0 0 0
3 Likes

I’m curious about how you are using the Y value. It seems this might be resetting your pattern earlier than you are intending. As I’m reading it, Script 1 : Line 5 is advancing the pattern every 6 executions of the script, and Script 1 : Line 6 is resetting the pattern every 24 executions, so you would only be getting through the first 4 values in your pattern. You could simplify a bit and just rely on the pattern’s own looping capabilities and eliminate the need to use Y. The scene should work exclusively triggered by Script 1. My thought for Script 2 beyond getting it all in sync was that it seemed a fun addition to reset it at odd times and be helpful in testing, but it shouldn’t be necessary at the end of each loop. I wound up adding it to my init script so that the whole things starts in sync.

I do think script 1 should have a P.N 0 line. If you expanded your scene later and used more scripts and patterns, another script could call a different pattern and you could end up referring to P.HERE and P.NEXT of a different pattern.

I tried the early version out a couple nights back. If it’s any help here’s where I landed:

INIT :
SCRIPT 2                  // sets X and p.n 0 location
TR.TIME A 25              // just a value that worked for me

SCRIPT 1:

P.N 0
Z ER P.HERE 12 X          // this looked a little clearer to me
IF Z : TR.PULSE A
X MOD ADD X 1 12
IF EZ MOD X 6 : P.NEXT

SCRIPT 2:                 // for testing or playful resets

P.N 0
P.I 0
X 0

Thanks, @tambouri. I admit to not testing the Y var usage. The intent was to have the advance and reset be contained in one script.

I’ll take another look when I get back. TT is a great tool that I’m just beginning to learn. My coding experience has all been high level, so still wrapping my head around the single line methodology.

Gotcha, I do believe you should be good to go w/o the Y commands, the way the pattern commands work should make that redundant, but let me know if that doesn’t work for you

1 Like