The dsp-D8 Drumchip Source code

With the release of the dsp-CR4 and R-606 virtual analog modelling chips I have decided to make the code for the PCM based dsp-D8 open source.



The code below can run on any ATmega with 32Kb flash or more.

You can still buy the preprogrammed chip for $20 by using this link:

Order the dsp-D8 drum chip

If you find  this code useful please consider a donation of $3.

Source code:

Download dsp-D8 source

// dsp-D8 PCM Drum chip  (c) DSP Synthesizers Sweden 2016
//Free for non Commercial use.
// Please consider a donation of $3 if you find this code useful

#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))

// Standard Arduino Pins
#define digitalPinToPortReg(P) \
(((P) >= 0 && (P) <= 7) ? &PORTD : (((P) >= 8 && (P) <= 13) ? &PORTB : &PORTC))
#define digitalPinToDDRReg(P) \
(((P) >= 0 && (P) <= 7) ? &DDRD : (((P) >= 8 && (P) <= 13) ? &DDRB : &DDRC))
#define digitalPinToPINReg(P) \
(((P) >= 0 && (P) <= 7) ? &PIND : (((P) >= 8 && (P) <= 13) ? &PINB : &PINC))
#define digitalPinToBit(P) \
(((P) >= 0 && (P) <= 7) ? (P) : (((P) >= 8 && (P) <= 13) ? (P) – 8 : (P) – 14))

#define digitalReadFast(P) bitRead(*digitalPinToPINReg(P), digitalPinToBit(P))

#define digitalWriteFast(P, V) bitWrite(*digitalPinToPortReg(P), digitalPinToBit(P), (V))

const unsigned char PS_128 = (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0);
//——— Ringbuf parameters ———-
uint8_t Ringbuffer[256];
uint8_t RingWrite=0;
uint8_t RingRead=0;
volatile uint8_t RingCount=0;
volatile uint16_t SFREQ;



4 Responses to “The dsp-D8 Drumchip Source code”

  1. Ed Droog Says:

    Hi Jan,

    Thank you for your great work! I have made a DSP8 type of drum synth using your code. Changed the code a bit to fit my needs in my diy synth. (removed code for the pull up resistors, soldered pull down resistors and made the triggers active on the leading edge).
    I would like to implement my own sounds.
    Is there a recipy to change the sounds in these drum synths other than copying parts of the code from e.g. a DSP-L8 to a DSP-D8?

  2. Ed Droog Says:


  3. Arduino 8-step drum sequencer (dsp-D8 drum chip) – Cassiopeia Ltd Says:

    […] connected to a custom PCB with an Arduino-based drum chip that has 8 drum sounds (based on the dsp-D8). Below video shows the ‘play’ mode of the sequencer, with the audio output connected […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: