I put the code on github and make one small fix and adapted the names to be similar to the other filters.
https://github.com/PaulStoffregen/Audio
If anyone wants to give this a try, please grab the latest from github. If you're not familiar with using git, the simplest way is to just download the ZIP file and extract it in {Documents}/Arduino/libraries. Just keep in mind anything to put there overrides all the other locations, so remember to delete this test copy when you later want to use the audio library the Teensyduino installer puts into your copy of Arduino.
Since there aren't any test programs yet, I wrote this very simple program which drives the filter with bursts of a sawtooth waveform.
Code:
#include <Audio.h>
AudioSynthWaveform waveform1;
AudioFilterLadder filter1;
AudioOutputMQS mqs1;
AudioConnection patchCord1(waveform1, 0, filter1, 0);
AudioConnection patchCord2(filter1, 0, mqs1, 0);
AudioConnection patchCord3(filter1, 0, mqs1, 1);
void setup() {
AudioMemory(40);
filter1.resonance(1.0);
filter1.frequency(440);
waveform1.begin(WAVEFORM_SAWTOOTH);
waveform1.frequency(100);
}
void loop() {
waveform1.amplitude(0.9);
delay(500);
waveform1.amplitude(0);
delay(1500);
}
I'm not a synth guy, so I really don't know what this filter is supposed to sound like. But here's the output I see with my oscilloscope at the end of the sawtooth burst.
View attachment 23655
I'm not 100% confident it's really correct. As the test repeats every 2 seconds, the amount of 440 Hz superimposed on the sawtooth seems to vary quite a lot. Maybe later I'll try to capture a time-lapse video of my scope screen....
Really, I'm depending on everyone here with an ear for what the Moog sound is supposed to be to say whether they're happy with this, or if more work is needed before releasing it.
Also, still need a clear confirmation on the MIT license before this can be released.