Thanks @scanner_darkly - BSET and BGET look super useful. I can see how I could potentially encode a whole 4 part rhythm with just 4 “magic numbers” stored in the pattern.
For example “King 1” looks like it could be encoded as four numbers: 2741 2741 813 813.
I’ve done some initial experiments around unpacking that kind of info into the grid. For example
L 0 15: G.BTN.V BGET I PN 0 0
seems to work ok in terms of unpacking the first part of the rhythm and with some adjusting for button id’s then the same can be done for the other parts - it starts to get tricky fitting everything into the line length tho!
It took me a while to get my head around the number limits in Teletype. I tried converting a binary number to an integer using a random conversion script that Google threw at me. A 16 beat rhythm might produce a decimal integer value like 37160, which is higher than the upper limit of a TT number storage type, which I guess is technically a “signed short”, rather than a “signed int”.
Once I realised that, then I found a more useful conversion site here:
Playing with that, I started to get my head around it more. if there is a beat on the very first note of a 16 note pattern, the decimal value will be negative.
A pattern like this: 0011010110101101 is encoded as 13741, while
a pattern like this: 1011010110101101 is encoded as -19027
This is stirring some memories of comp sci classes from a long time ago - hopefully my ramblings here have not confused the matter for anyone.
Hopefully I’ll have an updated version with more patterns embedded soon. The current version of the script is obviously much more friendly for every day editing, so I guess there’s pros and cons to both.