[sdiy] High Q Resonators/digital drums
rburnett at richieburnett.co.uk
Thu Jun 16 00:30:00 CEST 2011
> dan snazelle wrote:
> wow! sounds great
> what is the code like? did you do it in C? which board?
The code consists of sequencer, voice synthesis and mixer modules, all
programmed in dsPIC30F6012A assembly language.
> Tom Wiltshire wrote:
> Very nice, Richie. I can't hear the join. I think you've successfully
> copied 1980's technology with 21st century technology! ;)
> What's the dsPIC development board you're using, out of interest?
> Is it your own design or a commercial one?
It used a dsPICDem 1.1 plus board that I had lying around from a previous
work project (clinical diagnostic machine.) It's actually fitted with a
dsPIC30F6014 device but the firmware was coded to run on 30F6012A. The
first thing I did was cut the traces to the sh**ty on board 8-bit CODEC and
proprietary LCD and connected up a decent CS4335 24-bit audio DAC and
Hitachi industry-standard LCD. The dev board isn't really doing much more
than supply power to the dsPIC and act as a breakout from those tiny surface
mount I/O leads!
> Thomas Strathmann wrote:
> That sounds eerily close. The most obvious difference to my ears (on
> cheap speakers at the moment) were the bass drum sound. Would you mind
> describing some of the details of your implementation?
It's funny how different people hear different differences! I think the
hi-hats are the most innaccurately modelled voice, and sound quite different
from the actual TR-808 I recorded. I wasn't able to measure the frequencies
of the 6 free-running pulse oscillators that form the basis of the cymbal
sounds in the actual TR-808. Therefore, the DSP model for the cymbals is
not as accurate as it could be. There is quite a variation in sound between
different Roland TR-808 machines though, and even a single unit drifts a lot
with changes in ambient temperature!
Some details of the implemenation? I wrote the firmware about 6 years ago,
so my recollection might be a bit wooly...
The drum pattern was hard coded as a lookup table in ROM, and played out by
a basic sequencer routine that triggers the appropriate voice modules at
each step. The voice synthesis software worked in 1ms blocks (48 samples
for each instrument at 48kHz sample rate.) The outputs from all of the
instrument voice buffers are then mixed together into a stereo output
buffer. This is continuously DMA transferred over I2S to the audio DAC in
the background. The tuning, decay, volume, panning etc. of each drum sound
are adjustable but currently hard-coded values in software. A multiplexed
array of pots and User Interface would be on the to do list! Likewise a
proper MIDI parser.
The BD, SD, LT, MT, HT, LC, MC, HC, RS, CL sounds are all based around
digital state variable filter implemenations excited by 1ms gate pulses.
There are some differences between the voices like that the BD filter tuning
changes as the impulse response decays away. The SD is a mix of two ringing
filters, plus enveloped filtered noise etc. CP is filtered enveloped noise.
CB, CH, OH and CY were all made as follows: Mixture of 2 or 6 free-running
pulse oscillators, filtered, non-linear clipping, enveloped and filtered
The dsPIC being only a 16-bit DSP isn't really aimed at pro-audio
processing. So there were lots of tweaks to the filter implementations like
using double-precision states and fraction saving to get good low-frequency
ringing performance. As always the trick is figuring out where to spend
your DSP resources and where to be thrifty to cram in the desired features.
More information about the Synth-diy