Hey Guys,
I've been hacking around with some code that relied on an external library called PWMDACSynth.
I have removed all the function that the library provided from the main code by removing all references to those functions and then deleting the functions from the external library.
Each time I have done this I have re-uploaded the sketch to test it works and all is well so far.
Now, I have ended up with just a single class left in the library that I would like to move back into the main sketch.
here is the entire contents of that external library as it stands now, so you can see there is just one class:
class PWMDACSynth {
protected:
static PROGMEM const byte maxVolumeSineWavetable[];
public:
PWMDACSynth();
// MIDI lib compatible methods
static void noteOff(byte channel, byte pitch, byte velocity
static void noteOn(byte channel, byte pitch, byte velocity);
// Utility
static byte musicalMod12(char);
static byte musicalMod7(char);
static byte log2(unsigned int);
static int musicalConstrain12(int note, int min_note, int max_note) {
if( max_note < note ) {
note = max_note - musicalMod12(max_note - note);
}
else if( min_note > note ) {
note = min_note + musicalMod12(note - min_note);
}
return note;
}
};
However, whenever I paste this into my main sketch, it then wont compile.
Of course the first error is "redefinition of class 'PWMDACSynth'
So I remove the line that includes the library from my main sketch.
WHen I do so I get a strange error that I cannot seem to get around.
expected initializer before '*' token.
Anybody have an ideas where I'm going wrong here??
Appreciate the help!
Brad