The dsp-G1 Analog Modeling Synth source code


> Not the most experienced on the planet but I admit he’s good.

When it comes to squeeze out the most possible synthesis of a given architecture you have an O to much in your “good” :wink:

And you need your arm to correct your code; its not nitpicking or making you look bad, its a constant quest to be as clear and strict as you can get with your definitions, labels and namings. While annoying at first in return you will be able to read your code in 10 years and make sense of it. I know because i have been thru all this……


I contacted Adafruit back in 2011 and they were incredibly harsh with me because I claimed the product was open-source while it was released under a cc-by-nc-sa licence.

You’ll probably have to rethink your licensing :slight_smile:


I know how Adafruit are.

I designed an Arduino DMX-512 interface exclusive for them in 2012.
They paid me €150 and I haven’t seen any sign of it since :slight_smile:


Man, that sucks, I would have killed for that back in the days of working with a DMX based lighting system… I mean, the MA Commander 24 channel controller was a nice, solid piece of kit, built better than most tanks… But ehh, a bit of Arduino wouldn’t have hurt…


Well, the have the shield and code for a complete DMX-Master.

But since they bought it I don’t have any rights to it and they never released it.


Surely the main reason cutoff should be on a logarithmic scale is because musical pitch is a logarithmic scale, and you’d want cutoff frequency to make sense musically. It obviously makes implementing cutoff key-following much easier, too.



I was looking at wavetables and vector synthesis.

How do you choose the waveforms in the table?

I mean what waveforms are handy and useful to have?


I choosed 3 oscillators for the dsp-G1 because it was simple to generate supersaw with few knobs.

Now I going back to 2 oscillators because I want FM, sync and ringmod and it’s easier with 2 oscillators.
But I want wavetable synthesis for the 2 OSC’s


Wouldn’t that be quite hard given the 4kb of flash constraint?

If I were to do something with 4kb of memory, I would focus on synthesis techniques that don’t need much lookup data. Phase distortion/modulation is a good candidate - you just need a sine LUT - and with extra code you can store just one fourth of a period (32 or 64 samples) and compute the rest by symmetry.


I have 2Mbyte wavememory?

And I got the dsp-G1 MK-II PCB manufactured today :slight_smile:


Then you can do a lot…

Wavetables found in early wavetable synths sometimes emulated other synthesis techniques - you’d find wavetables with square waves of various pulse-widths, various combination of sine harmonics, folded or FM’ed sines, filtered sawtooth or squares…

Besides that, a good technique is to take samples, slice them period by period, resample them, and select the most distinct slices.


Ok, thanks


Some of my synths are built on Atmel chips but I prefer NXP and Cypress.

High MIPS and most bang for the buck.
The Cypress chips even have a built in FPGA with 192 macrocells and an analog PGA with opamps.

I have looked at STM32 but the IDE doesn’t look good even if the code is the same.
They do have some good chips thought.


I hate clicky envelopes so I made the anti-click envelope.
It works by calculating the slope for every set rate.

Works perfectly down to 5mS.

And I got Adafruit to stock the chip :slight_smile:


5ms is aeons in Envelope Time…


5mS is about the response you get from a keyboard.

The anti-click works down to 5mS but the fastest settable envelope rate is 1mS.


and even 1mS is not what some people consider as tight…. but i don’t want to be overly picky :wink:


Synths are also played from sequencers and super-tight/snappy sequences are a good thing too :slight_smile:


Yes, I know but I didn’t manage to remove the clicks on a rate at just 5 samples.

From 0 to full in 5 steps still clicks no matter what.


…but thats only what we children of the 80ies assume as timing, todays modern MIDI over USB based BedRoomProducers™might have other preferences.