A few issues here. First off, this doens’t make much sense:
gaWritePointer = phasor(1)
tablew(ga1,gaWritePointer,giTable,1)
gaWritePointer = phasor(1)
tablew(ga2,gaWritePointer,giTable,2)
You write ga1
to the table, and then immediately after that you overwrite the value of ga1
with ga2
? Also, there is no ixmode
of 2, although in this case it still works as expected because any non-0 value will cause normalisation of table length.
That code is also the problem with the repitching. You should set your phasor freq to match the size of the buffer. If you are only reading half a second long table, your phasor frequency should be two because you will be filling the buffer twice every second. Or you can just use this type of formula, which will allow you to change the buffer size to whatever you like without having to mess with the phasor frequency again:
gaWritePointer = phasor(sr/ftlen(giTable))
tablew(ga2,gaWritePointer,giTable,1)
You might try one of the compression opcodes to sort this. There are quite a few to choose from. I don’t have much experience with them myself, but they should be pretty straightforward. You could also modify tie the two slider together and when one is at its lowest, the other should be at its highest, but this wouldn’t allow users to have them both at max volume.