One thing that might be handy to convert some aspect of a number into a rhythmic value, perhaps the teletype could benefit from an operator to return the status of each bit in the number.
Example:
A CHAOS
IF BIT 1 A: TR.P 1
IF BIT 2 A: TR.P 2
IF BIT 3 A: TR.P 3
IF BIT 4 A: TR.P 4
I understand that this could be done using existing syntax, but I think that the addition of cellular automata to teletype via the CHAOS operator calls for an easier way to access the bits of a value.
bitwise ops, you mean? we’ve discussed this in the past and i think it’s a good candidate. so BIT is a bitwise AND, with a helper shift on the first arg.
i’d be more up for a straight bitwise AND, it’d be more flexible. ie
AND* 3 X
returns the two rightmost bits of X. i’m not sure how to differentiate bitwise vs. logical (logical ops already exist for these).
As to bit indexing, I don’t know why I was thinking it should be 1-based. Working between two programming languages crosses my wires about conventions sometimes.
I’ll wait for @tehn to weigh in, but you’re probably right.
inverting all the bits makes most sense, when using bitwise ops i would likely treat values as 32 bit unsigned ints (say, as a way to pack 32 step trigger sequence into a pattern value).