TAG: wavetable

arduinOSC first release

Unfiltered PWM and the filter output (440 Hz sine wave)
arduinOSC is a library which transforms your arduino into a simple arbitrary waveform audio oscillator.
It is based upon the internal 16-bit programmable timer and generates audio using pulse width modulation (PWM) and an external low-pass filter (square waves don't even need the external filter).
I'm using a simple passive low-pass filter, but in the next days I'll try an active low-pass filter based solution.
The library includes a sine wave lookup table (LUT) and a user-definable lookup table which can be found in the file named "user_waveform.h" under arduinOSC folder: if you whish to change this waveform just edit the file and then delete "arduinOSC.o", so the next time you will compile your sketch the library will be rebuilt.
Square waves are generated without a LUT, and in the next version also triangle, ascending sawtooth and descending sawtooth will be generated in this way, so the LUT will be used just for sine and user defined waveforms.
So far the library has been tested with Arduino Nano and Arduino Diecimila with the new ATMega328P.
> Read the full article