So the heart of my problem is that I need a dynamically sized array to hold note frequencies in a scale. The number of notes in a scale can vary (e.g. pentatonic vs major) and the number of octaves in that scale can vary (1 to 3). The worst case scenario is a Chromatic scale (12 notes) and 3 octaves for a total of 36 notes. Since each array element would be a 16-bit integer, that totals to 72 bytes.
I would like to be able to dynamically size the "ScaleNotes" array to hold a list of note frequencies, however I cannot use heap functions like malloc(), free(), realloc() to do so. I am using the MSP430G2553 LaunchPad and Energia.
If I cannot use a dynamically sized array, is there an alternative method such as using the stack to do this?
Thanks,
EB