Woah… you’re absolutely right! I didn’t notice that with the metro rate (and A values) I was using, but now I’ve gone back and tried some testing and it can get really slow. That’s extremely puzzling. As you say, as long as at least some of the first 12 bits of A are on, then the while loop should terminate quickly, but I’m finding it can basically make the teletype pretty unresponsive for sparse bit patterns. This is very very odd. I’ve tested big while loops and for loops in the metro script and you can have them looping into the thousands without much in the way of delay.

Can anyone else round here figure out what the problem is?

1 Like

I was getting some pretty sick grooves last night just running a sequence while manually toggling between A 137 and A 1412 and letting the lag do its thing :laughing:

But the Teletype was basically locked up :face_with_raised_eyebrow:

OK - I’ve got it! The issue is that I was always assuming that you’d have the root note of the scale active. This is equivalent to having the first bit set to 1. Sure enough, it’s fine for any odd number of A. Even numbers can cause the bug because you might end up having the target note lower than any note in the scale… the teletype shifts that down and eventually hits zero and presumably keeps shifting pointlessly until it gives up at some point!

To put it another way, this quantiser is looking for the note in the scale lower than the one you’re quantising. If there is no such thing it locks up!

3 Likes

Oh I think I figured it out! And damn you just beat me to it lol

Someone was talking about adding ring-shift OPs to carry the bits that fall off the bottom back to the top…

1 Like

Incidentally, I’m kind of regretting not making the first line of the haiku:

PARAM.SCALE 0 48; X PARAM.

It’s surprisingly expressive playing that teletype dial like it’s a harp! (You’ll probably want a reasonably fast metro rate for this.)

7 Likes

W has a hard limit of 10000 repetitions to prevent accidentally causing infinite loops. depending what’s in the loop it can still cause slowness or unresponsiveness.

1 Like
Summary

I’m curious, loking this over, I’m wondering if there are other pages to this whole set up… I’m REALLY new to the teletype and am a bit confused. I’ve tried implementing your code and x only bounces between two numbers instead of a scale.

Now that I have used my teletype a bit further, I’m concerned something might be wrong with it. As I impliment some of this code, I get only flickers between two notes at all times… Is there something I’m missing? Here is an image of the M page:

Here’s a quick video do X is returning based upon A’s value:

https://llllllll.co/uploads/default/original/3X/8/8/885c13e926f2bd06fdfbe34de9dad8609be6ce2f.MOV

Having done some more testing, it is odd, but specifically this line seems to lock up my teletype:

X WRAP CHAOS 0 36

If I change this number, I begin to get greater range of scales. Any thoughts on why this might be locking it up?

Hi! The chaos operator in Teletype generates series of numbers based on one of several mathematical procedures and a parameter that changes the way the procedure works. Depending on the algorithm used and the parameter, the sequence of numbers can be more or less random and sometimes go round in shorter or longer cycles. You can change the algorithm using CHAOS.ALG and the parameter using CHAOS.R

I don’t have my teletype to hand right now but you could try (at the live coding prompt) typing CHAOS.ALG 2 and CHAOS.R 5000 and see what happens…

Also remember to play around with different values of A for different scales (you need to make sure they are always odd numbers by the way). E.g.: A 1709

Another fun thing to try is to replace this line with: PARAM.SCALE 0 48; X PARAM and play the scales using the knob on the teletype. It’s best to do this with a fast metronome. E.g. M 100

3 Likes

Ok, amazing, thank you! I was totally unclear with CHAOS and was scratching my head why I was unable to achieve a similar result. Thanks for the response!

I’ve taken an interest in this wonderfully crafted code and for the whole idea of using binary in TT which I hadn’t yet got around to.
I was trying to work out a table for the decimal of various modes and chords and found this resource that I thought I would share. Its too much detail for me to work through completely now but I can confirm to others that the blue numbers for each scale are the decimal values (at least I have found the ones that I can calculate to confirm).
https://ianring.com/musictheory/scales/

5 Likes

Ooooh! Good find! I’m going to take some time out this weekend from grieving over my country’s election results to share some tables for scales and chord numbers to use with the haiku quantiser.

5 Likes

That would be fantastic! I started and then realised it was a task to big for my spare time just now.

I have a spreadsheet I’ve dedicated to the task but it’s barely fit for human consumption :slight_smile:image

6 Likes

Dog, this is clutch! I very much appreciate this and find the inclusion of how these numbers add up is sweet. Just for my own edification; what is the mathematical equation I use to convert the 1-0 based string in to the summed number at the bottom?

Each nth bit is worth 2^n-1, and they just get added up. Root is 1st bit.
e.g. =B13*1+B12*2+B11*4+B10*8+B9*16+B8*32+B7*64+B6*128+B5*256+B4*512+B3*1024+B2*2048

2 Likes

Okay, cool, and we count down, I assume, so, for instance, it B13 would be the top, and then moving down?

Nah those are Excel rows, so B13 is actually the bottom row. Root is just a 1 in cell B13. B13*1 = 1. Let’s say root is C. One semitone up is in cell B12. So if the scale contains a C#, you’d put a 1 in cell B12. B12*2 = 2. And so on.

This is great. I’ll share a “screen shot” of my work in progress. I had been using the =BIN2DEC formula in excel but it only calculates up to 10 bits so I found the others in the link I provide above.
I like your first principles approach because you can define a 12tet scale/chord and get the decimal. Going the other way seems difficult though.

3 Likes

You can also use Teletype itself to calculate the numbers for you. If you use this script the pattern of 1s and 0s in the first column of the tracker will be converted into a decimal number and stored in A. You can combine this with my haiku to make a quantiser that you can switch on and off semitones. (If you use the original haiku, make sure you have a 1 at the root note - I.e. first position in the pattern.)

#1
P.N 0; A 0
L 11 0: A + LSH A 1 P I
5 Likes

Thanks for sharing this! What a astonishing haiku.
I’m newbie to programming and tt, there are several questions regarding this script.
As my understanding (and questions):
Randomly set variable x as a value within 0 to 36
J BSET 0 % X 12 – How to understand BSET? ; Set K to 0
Do while J & A is 0?? ; J RSH J 1 – How to understand this

It would be great if you can translate the whole script in English for me to understand. Thanks!