Question

I need to implement a wavetable synthesizer in an ARM Cortex-M3 core. I'm looking for any code or tools to help me get started.

I'm aware of this AVR implementation. I actually converted it to a PIC a while back. Now I am looking for something similar, but a little better sounding.

ANSI C code would be great. Any code snippets (C or C++), samples, tools, or just general information would be greatly appreciated.

Thanks.

Was it helpful?

Solution

The Synthesis Toolkit (STK) is excellent, but it is C++ only:

http://ccrma.stanford.edu/software/stk/

You may be able to extract the wavetable synthesizer code from the STK though.

OTHER TIPS

Two open-source wavetable synthesizers are FluidSynth and TiMidity.

Any ARM synth, the best ones, can be changed to wavescanner in less than a day. Scanning the wave from files or generating them mathematically is nearly the same thing audio wise, WT provides massive banks of waveforms at zero processing cost, you need the waves, the WT oscillator code itself is 20 lines. so change your waveform knob from 3 to 100 to indicate which WAV you are reading, use a ramp/counter to read the WAV files(as arrays). WT fixed.

From 7 years of Synth experience, i'd recommend to change 20 lines of the oscillator function of your favorite synth to adapt it to read wave arrays. The WT only uses 20 lines of logic, the rest of the synthesizer is more important: LFO's, Filters, input parameters, preset memory... Use your favorite synth instead and find a WT wave library as WAV files and folders, and replace your fav synth oscillators with WT functions, it will sound almost the same, only lower processing costs.

A synth normally uses Sin, Sqr, Saw, Antialiased OSC functions for the wave...

A wavetable synth uses about 20 lines of code at it's base, and 10/20/100ds of waves, each wave sampled at every octave ideally. If you can get a wavetable sound library, the synth just loops, pitch shifts, the sounds, and pro synths can also have multiple octave to mix the octaves.

WTfunction =

  • load WAV files into N arrays
  • change waveform = select waveform array from WAV list
  • read waveform array at desired Hz

wavescanner function =

  • crossfade between 2 waves and assign xfade to LFO, i.e. sine and xfade.

The envelope, filter, amplitude, all other functions are independent from the wave generation function in all synths.

remember the the most powerful psychoacoustic tool for synthesizers is deviation from the digital tone of the notes, it's called unison detune, sonic character of synthesizers mostly comes from chorus and unison detune.

WT's are either single periods of waves of longer sections, in more advanced synths. the single period stuff is super easy to write into code. the advanced WT's are sampled per octave with waves lasting N periods, even 2-3 seconds, i.e. piano, and that means that they change sound quality through the octaves, so the complex WT's are crossfaded every octave with multiple octave recordings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top