How to improve performance of objects and patches


#1

Hey there,
I am trying io improve the performance of my polyphonic synthesizer project which is full of customized objects...
I wonder what is worth a try to improve the performance. I used many uint8_t types of variables to store ccNumbers and all midi data, I also used uint8_t for every iterator variable which is in that range.
The next thing is that I have many shifts to get the 8bit midi integer to 32bit value:

octaveFaderValue = attr_synthControlTable.array[attr_ref.PARAMS->source1Octave.tIndex];
level = attr_synthControlTable.array[attr_ref.PARAMS->source5Level.tIndex] << (27-7);
tune = attr_synthControlTable.array[attr_ref.PARAMS->source1Tune.tIndex] << (27-7);
attack = (attr_synthControlTable.array[attr_ref.PARAMS->source5Attack.tIndex] << (27-7)) - (1<<26)<<1;
decay = (attr_synthControlTable.array[attr_ref.PARAMS->source5Decay.tIndex] << (27-7)) - (1<<26)<<1;
sustain = attr_synthControlTable.array[attr_ref.PARAMS->source5Sustain.tIndex] << (27-7);
glideTime = (attr_synthControlTable.array[attr_ref.PARAMS->source1GlideTime.tIndex] << (27-7)) - (1<<26)<<1;
glideOffset = ((attr_synthControlTable.array[attr_ref.PARAMS->source1GlideOffset.tIndex] << (27-7)) - (1<<26)<<1);

I also have many math utitlity objects combined to control modulation sources for filter vca and so on.

What do think is worth the effort to increase performance ?
This is the patch at the moment (it is work in progress)
controller30.axp (203.9 KB)

-Flub


#2

About the variable type (8bit vs. 16 etc), maybe https://sebiik.github.io/community.axoloti.com.backup/t/variable-types-their-range-their-sram-consumption/4941 will be useful.

Have you checked whether using send/receive objects uses more sram than using cables?


#3

I will check this tomorrow but i actually dont know how to see the sram consumption. Does the sram consumption really affect the performance of the patch?