# Teletype Challenge : Bartok Palindrome

Sorry, no code yet. Just problems in need of a solution.

I planned to participate in last week’s Disquiet Junto involving a musical palindrome. During research, I was reminded of Bartok’s palindrome in Music for Strings, Percussion, and Celesta (1936), 3rd Movement (Adagio). The xylophone part has an interesting 4 bar rhythmic pattern in a palindrome format.

As I thought through how to make use of this pattern, I thought about using Teletype to script out the pattern. And… problems ensued.

Wondering if anyone has a suggestion for how to approach scripting note divisions? The Bartok pattern has quarter, eighth, sixteenth, triplet-eighths, and triplet-sixteenth note values. I initially thought about placing the values in a TT pattern in millisecond values, but could figure out how to assign those to the M value.

I appreciate TT’s simplicity. Still, without nested/bracketed loop and decision structures, I’m at a loss how to solve this problem.

Any ideas?

EDIT Later:

After a couple days of talk and me mostly scratching my head, @tambouri came up with an appropriate solution. It makes of of TT’s ER operator, added to the mix by @sam Thi sis an ingenious solution to creating a quite complex rhythmic pattern in TT. I hope by placing it up top, it will encourage others to take a look at the ER operator.

Solution (only requires a trigger to jack 1 - a quite fast trigger to really hear the pattern.)

``````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          // the Euclidian Rhythm pattern statement
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

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``````
4 Likes

Sadly, I have absolutely nothing technical to offer, but I love the connection to Bartok–I adore Bartok.

This reminds me of his fifth string quartet, which is in effect a palindrome, if only in the macro, structural sense. “Arch” form as it is sometimes referred to.

It is a benchmark piece of music for me personally. Among the high points of human achievement. I was grateful to have heard it performed live last year at the LA Phil as part of their chamber series. Astonishing!

5 Likes

Envious!

(more characters)

Not at my teletype, but a few thoughts on alternate starting places

I haven’t investigated the rhythms mode in the just type beta, but per the instructions it seems this could perhaps be a logical application

More things I’ve not investigated, but the euclidean rhythm ops added to the 1.2 firmware might be useful here

If I have some time this eve I’ll give the Metro solution a swing

2 Likes

Thanks for this! I’d forgotten about the doc addendums. Will give this a thorough read thru this evening.

Put the notes durations (in ms) in a pattern and use DEL accessing those values ?

finding the smallest duration unit could be useful as well, since all of te duration would be multiples of it.

That was my idea also.

There are triplets and duplets in the Barton pattern. Hard to get to where needed with integer-based math?

@tambouri I spent some time TT’s eclidian rhythm operator last evening. Really fantastic for generating all sorts contrasting patterns. I will definitely continue to explore, but I was not able to generate triplet patterns.

If I understand correctly, triplets may not be a part of this system.

It depends.
If your smallest triplet value is 10ms, the smallest duplet value can be 15ms and there is no prob. Depends on the tempo you want to use, though.

I broke down the Barton pattern into ms values for each note length, with a base tempo of 60 BPM.

So a quarter note would be 1000ms. Triplet eighth note = 333 and triplet sixteenth = 166. For both triplet types, a bit of math fudging would be necessary to get on solid tempo. For the triplet eighths, we would need to add 1ms to 1 of the triplet parts. For triplet sixteenths, add 1 to 2 parts.

The pattern looks like:

``````1000
1000
500
500
333
334
333
250
250
167
166
167
250
250
250
250
167
166
167
250
250
333
334
333
500
500
1000
1000
``````

Now, how to actually get TT code designed to make this work… that’s the challenge.

3 Likes

Ok. I believe I’ve come up with Euclidean Rhythm operator (ER) statements that could work for all but the sixteenth notes in the Barton Palindrome pattern.

The smallest value is a sixteenth triplet, so I came up with ER patterns of 24 steps.

``````triplet sixteenth - 1, 24, 0
sixteenth - ?
triplet eighth - 2, 24, 0
eighth - 3, 24, 0
quarter - 6, 24, 0
``````

Still left with the sixteenth note being able to fit into the length of a bar comprised of 24 steps.

Edit: hmm… If I double the number of steps to 48, this may solve the problem. I’m not at TT, but will give this a thorough test later.

2 Likes

I didn’t have time to play with this last night, and now I’m back at my desk at work, but this is how I was thinking you could use the euclidean rhythm generator. Per my reading of the ER writeup and no actual testing on the teletype, so not unlikely that I’m missing something, but … hear me out

Using a clock 1/12 the length of the desired 1/4 note in your pattern the following could create triggers when the ER returns a 1. and you could shift through a pattern of fill settings every 1/8th of the piece which would be every 6 beats of the 1/12 clock

i believe ER FILL LENGTH STEP would work as follows

so a script might work something like this.

SCRIPT 1
P.N 0
X MOD ADD X 1 12 x counts 0-11
IF EZ MOD X 6 : P.NEXT move to the next pattern every 1/8note = 1/6 of the 12 count
IF ER P.HERE 12 X : TR.PULSE 1 execute a trigger if ER returns 1

So you would now choose a fill amt for every 1/8 of the piece. (1/8 as this seems to be the smallest scale that the division shifts). so you could put the following into Pattern 0 (split up into bars only to make it easier to see my thought process)

bar 1 - 1 1 0 0 0 0 1 1 1/4 note, 1/4 rest, 1/4 rest, 1/4 note
bar 2 - 1 1 2 2 3 3 4 6 1/4 note, 1/8 notes, 1/8t notes, 1/16 notes, 16t notes…
bar 3 - 4 4 6 4 3 3 2 2
bar 4 - 1 1 1 1 0

Repeat disclaimer, this is off the top of my head and likely has some issues. 1 thing I’m definitely unsure of is if ER 0 12 STEP would work to fill a pattern w/ no active steps to take into account the rests. And this doesn’t solve for duration yet

4 Likes

Very nice, @tambouri. You came directly to the 1 beat version of what it took me multiplepasses to get to.

Still required is some fancy pattern resetting to get the correct number of note values per full pattern, but that seems doable.

I fear for the squirrel running the clocking wheel, tho.

2 Likes

Im pretty certain that ER 0 12 works exactly as expected

1 Like

seeing a problem where the order of the commands I used are likely causing it to skip step 0 and advance before the first beat, maybe that’s cause this?

so maybe have a reset script and change up the order of the commands a little

SCRIPT 1 :
P.N 0
IF ER P.HERE 12 X : TR.PULSE 1
X MOD ADD X 1 12
IF EZ MOD X 6 : P.NEXT

SCRIPT 2 :
X 0
P.N 0
P.I 0

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

This way it should trigger the 1st step before moving to X = 1

1 Like

Nope - throws a ‘not enough parameters’ error

This line is a character too long it seems. Drat!

Solved by storing P.HERE in a var Z.

`````` P.N 0
Z P.HERE
IF ER Z 12 X : TR.PULSE A
....``````

I think @GoneCaving is stating that `ER 0 12 step` should always return a `0`. It does. (Or it should, if it doesn’t it’s a bug.)

The C source that underlies the op is here, you can see at the beginning of the `euclidean` function that it returns a `0` if `fill` is less than 1.

1 Like

Yep, that’s clearly what I meant. Post was from memory and without checking, but meant that a rest is certainly possible.

1 Like