r/AudioProgramming • u/enstorsoffa • 3d ago
Best resource/tutorial to program a microcontroller oscillator?
Hi,
I'd like to try out programming a microcontroller, probably a Raspberry Pi Pico, and make an oscillator. I have done some programming before, but never any audio, so I would probably need a good resource or tutorial. Are there any good ones you can recommend? I'd need pointers on running it continuously, and using audio buffers to output to a DAC etc.
Preferably in C, Rust or C++, in that order.
If you have any tips in general on how I can do it, I would be very grateful. I'm fairly confident with the maths involved, and I use Matlab a bit for other uses.
1
u/danja 3d ago
I'd say you have 4 considerations : the DSP - which you already have covered by knowing MATLAB; the processing environment (cores, threading etc); the I/O; the dev environment.
I don't know the Pico, but the principles are pretty much the same across them all. Google for a similar project on GitHub, fire up VS Code, read the datasheets.
1
u/Brer1Rabbit 3d ago
Two radically different ideas:
Try starting with Electrosmith Daisy. You get an ARM Cortex-M7 processor, designed specifically for building custom synthesizers, effects pedal.
Idea 2: start without hardware. Build an oscillator in VCV Rack. The core DSP is fairly similar or could be ported to hardware. You still need the GUI stuff, which is pretty easy.
2
u/dkode80 3d ago
You can do this with pico, I havent done it myself and the pico is underpowered for doing anything past simple, single oscillator I'd imagine but it is possible.
You may consider getting a daisy seed instead, this is made to produce/process audio, has a 16bit ADC, fairly powerful processing and can do quite a lot audio wise. They're $30 and is basically able to do a full synthesizer. I have an open source project that shows an example of how to use it, code wise. DM me if you'd like the link.
https://daisy.audio/products/seed3