emmanuel63
Well-known member
Hello,
I am sorry to post this problem that might look basic for the most of you but i am stuck.
I am working with a simple wavetable synth. I try to find a generic way to change the instrument with pointers. Here is my faulty code :
I would like to be able to generalize this method for various objects. Thank you for helping.
Emmanuel
I am sorry to post this problem that might look basic for the most of you but i am stuck.
I am working with a simple wavetable synth. I try to find a generic way to change the instrument with pointers. Here is my faulty code :
Code:
int last_index;
const char *instrument[] = {
"bassoon",
"clarinet",
"distortiongt",
"epiano",
"flute",
"frenchhorn"
};
void wavetable_patch() {
int index = analogRead(A0) / 6;
if (index != last_index) {
wavetable.setInstrument(instrument[instrument_index]);
last_patch = patch;
}
}
I would like to be able to generalize this method for various objects. Thank you for helping.
Emmanuel