I am building a table based sequencer and I want to store the step values in a table.
I need 16 sequencers, so if I need to store 16 sequencer with 16 steps, you get 16X16= 256 index in a table needs to be used for it to work like this.
But I was thinking, that instead of storing each step of a sequence into it own index, where it take 16 indexes to store 16 steps, shouldn’t I be able to store the 16 bools for each step in one single index?
Like the same way that you can make 16 k-rate outputs of a single s-rate input:
outlet_k1 = inlet_s[o]
outlet_k2 = inlet_s
outlet_k3 = inlet_s
outlet_k4 = inlet_s
If I use a 16 bit table, I should be able to store the 16 bools in one index of a table, right?
I need to store some dial values in the same table, so probably going to use a 32 bit table for it, but I need all values to be stored in the same table. If I could limit the amount of index from 256 to just 16, by storing the 16 bools/steps in one single index, that would make it a lot simpler.
I have tried a few things the last couple of hours, but I can not get it working, I am not sure firstly how to get the input value stored to it’s own bit with a table/write and then secondly to play it back with a table/read.
Does anyone have an idea how to do this?
Did anyone already make such an object, that writes and reads bools from bits of an index in a table?
Here is some of what I have tried, where the 0 that is shifted << 1 is the step, in this case 0:
attr_table.array[ inlet_a & (1 << 0) ]=_SSAT(inletv ,28)>>attr_table.GAIN;
outlet_o= attr_table.array[_USAT( inleta & (1 << 0) ,attr_table.LENGTHPOW)]<<attr_table.GAIN;
That didn't work. It is probably too naive.....
I also tried:
(attr_table.array[ inlet_a & (1 << 0) ]=_SSAT(inletv ,28)>>attr_table.GAIN) & (1 << 0);
outlet_o= (attr_table.array[_USAT( inleta & (1 << 0) ,attr_table.LENGTHPOW)]<<attr_table.GAIN) & (1 << 0);
I tried more, but nothing worked and I don't remember all the things I tried, but that is 2 of the tests I made.
Here is the patch, for an easy start point and the 2 examples above:
Write to bits COMMUNITY 1.axp (19.9 KB)
Thanks in advance