Consumption of Memorory #UnO2


Jack Fenton
 

Does a sting like "Hello" consume 5 bytes of memory in the Uno Foorpedal or are they converted to 1 byte tokens before loading them on the FCB-1010

Right now I'm using a lot of strings and ran out of memory on my configuration. I'm thinking if they do not covert to tokens, I can save memory by having them integers.

Also, if I have multiple presets with the same code, it seems to consume more memory

SendMidi  Nord  CntrlChange 0 0 
Snedmidi Nord CntrlChange 32 0 // The value here might change with each preset since I have 5 banks on this device.
SendMidi Nord ProgChange 3 // this is the only thing that currently changes with the preset

I'm wondering if I do this only once as a trigger and then have instead each preset call the same trigger instead with different values of the Program Chaage and CC 32 it might consume less memory. I would not use the trigger directly with any footswitch, however would call it with different values for each.

These would be seen as my "Favorites "  Fav1-FavX



ossandust
 

A compiled setup doesn't contain any strings, since the FCB1010 doesn't use the string values. During compilation all possible values of a string variable are listed and converted to a 10-bit index  (a string variable can contain up to 1024 possible values). So the length of the string is not relevant for the setup size. 
It's not easy to calculate which approach will take most memory, you'll just need to try it out. A trigger is a good way to group commands which are often reused, but if the trigger only contains 2 MIDI commands and you always have to combine the "SendTrigger" command with some extra variable initialization code, it will take more memory than simply specifying the SendMIDI commands in the presets.


Jack Fenton
 

Thanks, I'll play around with it to see what I can do to reduce memory. I only have 3 banks but most of my presets/triggers look to see what device is selected before applying the correct MIDI output. So a lot of case statements and in some instances, nested case statements within my triggers and presets. I had to eliminate the banks MSB LSB CCs in order to make things fit.

Basically, I use a pedal to select which device I want to talk to, then use the same presets/triggers for both devices.  In some cases I assign pedal functions for each device with some of the pedals which is the nested case statements.