Showing posts with label synthesiser. Show all posts
Showing posts with label synthesiser. Show all posts

Thursday, November 15, 2012

Auduino With Delay

This is the first in a series of posts introducing simple audio effects that can be used in micro controller projects.

Next Week - Bit Crushing effects

The Delay effect is one of the simplest and most effective enhancements we can add to our audio projects.

The delay effect works by recording the output as it is being generated and then mixing this sound back in with itself - after a delay. The result should be familiar to anyone who has every played an electric guitar through an amp with reverb.

In the case of the Auduino synthesizer the result is a mild echo effect and slightly smoother, more metallic sound - the effect can be turned on or off through a push button in the code provided below.

How do we create the delay effect
Delay is very simple to add in a microcontroller, all we need is a block of memory to record the output in.

The larger the block of memory, the longer the delay we can record and the deeper the effect.

In this case we are using a 1K block of memory in the array named sDelayBuffer -

// Duane B
// rcarduino.blogspot.com
// 15/11/2012
// Very simple ring buffer delay
// we record the output in this array
// and then mix it back in with the output as the buffer wraps around
// can be switched on and off by a button on DELAY_BUTTON
#define MAX_DELAY 1024
unsigned char sDelayBuffer[MAX_DELAY];
unsigned int nDelayCounter = 0;
unsigned char bDelay;

The other modification is inside the interrupt service routine which generates the Audiuno output, essentially what we are doing is adding the sound we recorded 1/8th of a second ago on top of the current output value -


  // Duane B
  // rcarduino.blogspot.com
  // 15/11/2012
  // add a button to set bDelay true or false to turn delay on and off
  if(bDelay)
  {
    // Output to PWM (this is faster than using analogWrite) 
    // Here we add the delay buffer to the output value, this produces
    // an subtle echo effect, the delay buffer is effectivley replaying the sound from
    // 1/8th of a second ago.
 
    LED_PORT |= 1 << LED_BIT; // Faster than using digitalWrite
    PWM_VALUE = (output + (sDelayBuffer[nDelayCounter]))>>1;
   
    // add the new output to the buffer so we can use it when the buffer next wraps around
    sDelayBuffer[nDelayCounter] = PWM_VALUE;
    nDelayCounter++;
    if(nDelayCounter == MAX_DELAY)
    {
      nDelayCounter = 0;
    }
  }
  else
  {
    LED_PORT &= ~(1 << LED_BIT); // Faster than using digitalWrite
   
    PWM_VALUE = output;
  }

We test whether delay is enabled, if it is we calculate the output value by adding the initial output to the earlier recorded output from our delay buffer. After outputting this combined value we record it in the delay buffer replacing the value we just used. Over time, the code cycles through the delay buffer over and over again, mixing the current output with a sample from 1/8th of a second back - a bit like playing your instrument in a large hall where the distinct sound is the result of the current sound being constantly mixed with its echo.

Thats all there is to generating delay in a micro controller synth engine - exactly the same code is used to create the delay effect in the RCArduino Five Dollar Synthesizer.


The RCArduino Five Dollar Synthesizer is another audio project enhanced with this delay effect -

http://rcarduino.blogspot.com/2012/10/five-dollar-synthesiser.html 


Further Development
The amount of delay we can provide is determined to the memory we use to record the samples. In the Auduino we are using 1K which at an 8K play back rate gives us 125ms of delay. This can be increased by bit crushing the samples - using 4 bits per sample we get 250ms, 2 bits gets us half a second, with 1 bit we can get a whole second. Unfortunately initial experiments suggest that the effect is largely lost when applying these techniques, its a bit like shouting into a cave and getting a different echo back - your ears just don't buy it.

Auduino Accreditation
The Auduino is an original work by Peter Knight, the original project can be found here -
http://code.google.com/p/tinkerit/wiki/Auduino

Auduino with delay

Auduino with delay is a very slight modification by Duane B (rcarduino) to the original work of Peter Knight.

Notes
- This code also include the volatile fix which allows the Auduino to work correctly in Arduino 1.0 and later
- Remember to use a pull up or pull down resistor if you are not using a push button or switch for the delay button or if your more comfortable modifying the code, replace the button code with true or false.
- LED 13, now indicates whether delay is on or off.


// Auduino, the Lo-Fi granular synthesiser
//
// by Peter Knight, Tinker.it http://tinker.it
//
// Help:      http://code.google.com/p/tinkerit/wiki/Auduino
// More help: http://groups.google.com/group/auduino
//
// Analog in 0: Grain 1 pitch
// Analog in 1: Grain 2 decay
// Analog in 2: Grain 1 decay
// Analog in 3: Grain 2 pitch
// Analog in 4: Grain repetition frequency
//
// Digital 3: Audio out (Digital 11 on ATmega8)
//
// Changelog:
// 19 Nov 2008: Added support for ATmega8 boards
// 21 Mar 2009: Added support for ATmega328 boards
// 7 Apr 2009: Fixed interrupt vector for ATmega328 boards
// 8 Apr 2009: Added support for ATmega1280 boards (Arduino Mega)

#include <avr/io.h>
#include <avr/interrupt.h>

uint16_t syncPhaseAcc;
volatile uint16_t syncPhaseInc;
uint16_t grainPhaseAcc;
volatile uint16_t grainPhaseInc;
uint16_t grainAmp;
volatile uint8_t grainDecay;
uint16_t grain2PhaseAcc;
volatile uint16_t grain2PhaseInc;
uint16_t grain2Amp;
volatile uint8_t grain2Decay;

// Map Analogue channels
#define SYNC_CONTROL         (4)
#define GRAIN_FREQ_CONTROL   (0)
#define GRAIN_DECAY_CONTROL  (2)
#define GRAIN2_FREQ_CONTROL  (3)
#define GRAIN2_DECAY_CONTROL (1)

// DB
#define SMOOTH_PIN 8


// Changing these will also requires rewriting audioOn()

#if defined(__AVR_ATmega8__)
//
// On old ATmega8 boards.
//    Output is on pin 11
//
#define LED_PIN       13
#define LED_PORT      PORTB
#define LED_BIT       5
#define PWM_PIN       11
#define PWM_VALUE     OCR2
#define PWM_INTERRUPT TIMER2_OVF_vect



#elif defined(__AVR_ATmega1280__)
//
// On the Arduino Mega
//    Output is on pin 3
//
#define LED_PIN       13
#define LED_PORT      PORTB
#define LED_BIT       7
#define PWM_PIN       3
#define PWM_VALUE     OCR3C
#define PWM_INTERRUPT TIMER3_OVF_vect
#else
//
// For modern ATmega168 and ATmega328 boards
//    Output is on pin 3
//
#define PWM_PIN       3
#define PWM_VALUE     OCR2B
#define LED_PIN       13
#define LED_PORT      PORTB
#define LED_BIT       5
#define PWM_INTERRUPT TIMER2_OVF_vect
#endif

// Duane B
// rcarduino.blogspot.com
// 15/11/2012
// Very simple ring buffer delay
// we record the output in this array
// and then mix it back in with the output as the buffer wraps around
// can be switched on and off by a button on DELAY_BUTTON
#define MAX_DELAY 1024
unsigned char sDelayBuffer[MAX_DELAY];
unsigned int nDelayCounter = 0;
unsigned char bDelay;

#define DELAY_BUTTON 4


// Smooth logarithmic mapping
//
uint16_t antilogTable[] = {
  64830,64132,63441,62757,62081,61413,60751,60097,59449,58809,58176,57549,56929,56316,55709,55109,
  54515,53928,53347,52773,52204,51642,51085,50535,49991,49452,48920,48393,47871,47356,46846,46341,
  45842,45348,44859,44376,43898,43425,42958,42495,42037,41584,41136,40693,40255,39821,39392,38968,
  38548,38133,37722,37316,36914,36516,36123,35734,35349,34968,34591,34219,33850,33486,33125,32768
};
uint16_t mapPhaseInc(uint16_t input) {
  return (antilogTable[input & 0x3f]) >> (input >> 6);
}

// Stepped chromatic mapping
//
uint16_t midiTable[] = {
  17,18,19,20,22,23,24,26,27,29,31,32,34,36,38,41,43,46,48,51,54,58,61,65,69,73,
  77,82,86,92,97,103,109,115,122,129,137,145,154,163,173,183,194,206,218,231,
  244,259,274,291,308,326,346,366,388,411,435,461,489,518,549,581,616,652,691,
  732,776,822,871,923,978,1036,1097,1163,1232,1305,1383,1465,1552,1644,1742,
  1845,1955,2071,2195,2325,2463,2610,2765,2930,3104,3288,3484,3691,3910,4143,
  4389,4650,4927,5220,5530,5859,6207,6577,6968,7382,7821,8286,8779,9301,9854,
  10440,11060,11718,12415,13153,13935,14764,15642,16572,17557,18601,19708,20879,
  22121,23436,24830,26306
};
uint16_t mapMidi(uint16_t input) {
  return (midiTable[(1023-input) >> 3]);
}

// Stepped Pentatonic mapping
//
uint16_t pentatonicTable[54] = {
  0,19,22,26,29,32,38,43,51,58,65,77,86,103,115,129,154,173,206,231,259,308,346,
  411,461,518,616,691,822,923,1036,1232,1383,1644,1845,2071,2463,2765,3288,
  3691,4143,4927,5530,6577,7382,8286,9854,11060,13153,14764,16572,19708,22121,26306
};

uint16_t mapPentatonic(uint16_t input) {
  uint8_t value = (1023-input) / (1024/53);
  return (pentatonicTable[value]);
}


void audioOn() {
#if defined(__AVR_ATmega8__)
  // ATmega8 has different registers
  TCCR2 = _BV(WGM20) | _BV(COM21) | _BV(CS20);
  TIMSK = _BV(TOIE2);
#elif defined(__AVR_ATmega1280__)
  TCCR3A = _BV(COM3C1) | _BV(WGM30);
  TCCR3B = _BV(CS30);
  TIMSK3 = _BV(TOIE3);
#else
  // Set up PWM to 31.25kHz, phase accurate
  TCCR2A = _BV(COM2B1) | _BV(WGM20);
  TCCR2B = _BV(CS20);
  TIMSK2 = _BV(TOIE2);
#endif
}


void setup() {
  pinMode(PWM_PIN,OUTPUT);
  audioOn();
  pinMode(LED_PIN,OUTPUT);

  pinMode(DELAY_BUTTON,INPUT);
 
  // set pin mode and turn on pull up so that default mode
  // is PENTATONIC, pull the pin low to switch to smooth
  pinMode(SMOOTH_PIN,INPUT);
  digitalWrite(SMOOTH_PIN,HIGH);
}

void loop() {
  // The loop is pretty simple - it just updates the parameters for the oscillators.
  //
  // Avoid using any functions that make extensive use of interrupts, or turn interrupts off.
  // They will cause clicks and poops in the audio.
 
  // defaults to pentatonic stepped tones, pull pin low for smooth frequency without distinct tones
  //    syncPhaseInc = mapPhaseInc(analogRead(SYNC_CONTROL)) / 4;

  syncPhaseInc = mapPentatonic(analogRead(SYNC_CONTROL));
 
  // updated 29/01/2013
  // pull the DELAY_BUTTON pin high for delay, low for no delay
  // use either a pull up/pull down resistor
  // or a pull up resistor with a toggle switch between the pin and ground
  bDelay = digitalRead(DELAY_BUTTON);
 
  // Stepped mapping to MIDI notes: C, Db, D, Eb, E, F...
  //syncPhaseInc = mapMidi(analogRead(SYNC_CONTROL));
 
  // Stepped pentatonic mapping: D, E, G, A, B
 

  grainPhaseInc  = mapPhaseInc(analogRead(GRAIN_FREQ_CONTROL)) / 2;
  grainDecay     = analogRead(GRAIN_DECAY_CONTROL) / 8;
  grain2PhaseInc = mapPhaseInc(analogRead(GRAIN2_FREQ_CONTROL)) / 2;
  grain2Decay    = analogRead(GRAIN2_DECAY_CONTROL) / 4;
}


SIGNAL(PWM_INTERRUPT)
{
  uint8_t value;
  uint16_t output;

  syncPhaseAcc += syncPhaseInc;
  if (syncPhaseAcc < syncPhaseInc) {
    // Time to start the next grain
    grainPhaseAcc = 0;
    grainAmp = 0x7fff;
    grain2PhaseAcc = 0;
    grain2Amp = 0x7fff;
//    LED_PORT ^= 1 << LED_BIT; // Faster than using digitalWrite
  }
 
  // Increment the phase of the grain oscillators
  grainPhaseAcc += grainPhaseInc;
  grain2PhaseAcc += grain2PhaseInc;

  // Convert phase into a triangle wave
  value = (grainPhaseAcc >> 7) & 0xff;
  if (grainPhaseAcc & 0x8000) value = ~value;
  // Multiply by current grain amplitude to get sample
  output = value * (grainAmp >> 8);

  // Repeat for second grain
  value = (grain2PhaseAcc >> 7) & 0xff;
  if (grain2PhaseAcc & 0x8000) value = ~value;
  output += value * (grain2Amp >> 8);

  // Make the grain amplitudes decay by a factor every sample (exponential decay)
  grainAmp -= (grainAmp >> 8) * grainDecay;
  grain2Amp -= (grain2Amp >> 8) * grain2Decay;

  // Scale output to the available range, clipping if necessary
  output >>= 9;
  if (output > 255) output = 255;

  // Duane B
  // rcarduino.blogspot.com
  // 15/11/2012
  // add a button to set bDelay true or false to turn delay on and off
  if(bDelay)
  {
    // Output to PWM (this is faster than using analogWrite) 
    // Here we add the delay buffer to the output value, this produces
    // an subtle echo effect, the delay buffer is effectivley replaying the sound from
    // 1/8th of a second ago.
 
    LED_PORT |= 1 << LED_BIT; // Faster than using digitalWrite
    PWM_VALUE = (output + (sDelayBuffer[nDelayCounter]))>>1;
   
    // add the new output to the buffer so we can use it when the buffer next wraps around
    sDelayBuffer[nDelayCounter] = PWM_VALUE;
    nDelayCounter++;
    if(nDelayCounter == MAX_DELAY)
    {
      nDelayCounter = 0;
    }
  }
  else
  {
    LED_PORT &= ~(1 << LED_BIT); // Faster than using digitalWrite
   
    PWM_VALUE = output;
  }
}


Saturday, September 22, 2012

Algorithmic Music On Arduino

Original By Viznut Arduino Version

This is an interesting little project that can be built in minutes. It plays 13 different tunes all of which are generated from a single line of C code, the tunes are selected through four push buttons which have 16 possible combinations, including silence and two free slots for your own music.

The project also includes an 8 LED visualizer that is driven by the same line of code as the music.

About Algorithmic Music


The original tunes were produced by Viznut and by others in response to his original blog post here -

http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html

The original Arduino port was completed by Arduino Forum user Stimmer and can be found in this post -

http://arduino.cc/forum/index.php/topic,74123.msg558213.html#msg558213

Arduino Forum user Zeni also has an interesting variation which allows the user to enter new algorithms at runtime, this can be seen in action in the forum topic above.

The RCArduino Version adds the ability to select the current algorithm and the 8 LED Visualiser.

The RCArduino Version code and schematic can be found below, if your interested in the theory behind the music or demoscene in general ( http://en.wikipedia.org/wiki/Demoscene ) you can pick up the trail from Viznuts original video linked at the start of this post.

An application in Grain Synthesis ?
 
One area that would be interesting to apply these techniques is grain synthesis. Grain synthesis is based on repeating a simple grain of sound while adding additional grains, envelopes, oscillators or filters to make the sound more interesting. These operations can be computationally expensive and do not always produce interesting sound. The techniques used to generate the algorithmic music from a simple counter demonstrated by Viznut could also be applied to generating more interesting synthesis grains.

The best known example of an Arduino Grain Synthesizer is the Auduino, its incredible to see that all of the sound generated by an auduino is the result of overlaying just two triangle waveforms. In one of the videos linked below you will see the triangle waveforms interacting together with the rich sound that results.

Examples of built Auduino Synths can be found at the end of this post - 
http://rcarduino.blogspot.com/2012/08/adding-audio-to-arduino-projects.html

An interesting development of the grain synthesis would be to combine it with the realtime code upload work of Zeni, it should be possible to create grains that modulate and transform themselves to create a more interesting sound palette.

RCArduino Version - Based on original work of Viznut and original Arduino port of stimmer



// one-line algorithmic music
// see viznut's blog http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
// and http://www.youtube.com/watch?v=GtQdIYUtAHg&feature=related

// ported to arduino by stimmer
// Audio out on pin 10

// Further ported to Interrupt based music generation with 4 button selection of upto 16 algorithms (or 15 + silence on no buttons pressed)
// by Duane B aka RCArduino
//
// Buttons are digital 8,9,10,11, music output is on digital 6
//
// Also added a four LED Visualiser on digital pins 2,3,4,5
//
// Update - LED Visalizer is now 8 bit using digital pins 2,3,4,5 and analog pins 0,1,2,3


#define SAMPLE_MAX (65535.0)
#define SAMPLE_FREQUENCY (8000.0)
#define TIMER1_FREQUENCY 2000000
#define UPDATE_RATE 8000

// by keeping t global we can use it to drive the visualiser as well
long t;

// iterate the grains and LFO
SIGNAL (TIMER1_COMPA_vect)
{
 OCR1A += (TIMER1_FREQUENCY/UPDATE_RATE);

 t++;

 switch(PINB&15)
 {
   default:
   case 0:
     OCR0A = 0;
     break;
   case 1:
     OCR0A = ((-t&4095)*(255&t*(t&t>>13))>>12)+(127&t*(234&t>>8&t>>3)>>(3&t>>14)); // by tejeez
     break;
   case 2:
     OCR0A = t*(t>>11&t>>8&123&t>>3); // by tejeez
     break;
   case 3:
     OCR0A = t*((t>>9|t>>13)&25&t>>6);   // by visy
     break;
   case 4:
     OCR0A = (t*(t>>5|t>>8))>>(t>>16);   // by tejeez

     break;
   case 5:
     OCR0A = ((t*(t>>8|t>>9)&46&t>>8))^(t&t>>13|t>>6); // by xpansive
     break;
   case 6:
     OCR0A = ((t&4096)?((t*(t^t%255)|(t>>4))>>1):(t>>3)|((t&8192)?t<<2:t)); // by skurk (raer's version)
     break;
   case 7:
     OCR0A = (t>>7|t|t>>6)*10+4*(t&t>>13|t>>6); // by viznut, xpansive, varjohukka
     break;
   case 8:
     OCR0A = t*5&(t>>7)|t*3&(t*4>>10); // by miiro

     break;
   case 9:
     OCR0A = (t|(t>>9|t>>7))*t&(t>>11|t>>9); // by red
     break;
   case 10:
     long v;
     OCR0A = v=(v>>1)+(v>>4)+t*(((t>>16)|(t>>6))&(69&(t>>9))); // by pyryp
     break;
   case 11:
     OCR0A = (t>>6|t|t>>(t>>16))*10+((t>>11)&7);  //by viznut
     break;
   case 12:
     OCR0A = (t*(4|7&t>>13)>>((~t>>11)&1)&128) + ((t)*(t>>11&t>>13)*((~t>>9)&3)&127); // by stimmer

     break;
   case 13:
     // free to use
     break;
   case 14:
     // free to use
     break;
   case 15:
     // free to use
     break;
     // any more and we need another bit from PORTB
 }
}

void setup()
{
  TCCR1A=0x0;          // set the timer prescaler to 8 = 16/8 = 2MHz
  TCCR1B=0x02;          // set the timer prescaler to 8 = 16/8 = 2MHz
  TIMSK1 |= (1<<OCIE1A);   // Enable output compare match interrupt on OCR1A
  
  //TCCR0A=0B10110011;                                    //-8 bit audio PWM
  TCCR0A=0B10000011;                                    //-8 bit audio PWM
  //TCCR0A=0x83;          // Set timer waveform generation mode to FAST PWM, clear OC0A On match, set at bottom - OC0A = digital pin 6.
  TCCR0B=0x01;          // Set to clock frequency, no prescaler
  OCR0A=127;            // set in the middle - do we need this ? probably not.
  DDRD|=1<<6;          // Set digital pin 6 to output - channels 2 and 3

  DDRB &= (~15); // set digital pins 8,9,10,11 as inputs
  DDRD |= ((1<<2) | (1<<3) | (1<<4) | (1<<5)); // set digital pins 2,3,4,5 as outputs for the visualiser
  DDRC &= (15);
}

void loop()
{
 unsigned char output = OCR0A;

 // clear visualiser bits on portD
 PORTD &= 0B000011;

 // set the portd part of the visualiser using the top 4bits of output
 PORTD |= ((output>>4)<<2);

 // set the portc part of the visualiser using the bottom 4 bits of output
 PORTC &= 0B110000;
 PORTC |= (output & B1111);
}




For a simple amplifier circuit to use with Arduino projects see here -

http://rcarduino.blogspot.com/2012/08/adding-audio-to-arduino-projects.html

I am currently working on an Arduino based modular synthesizer with a very different sound, stay tuned

Duane B.

Sunday, August 26, 2012

The Must Build Arduino Project - The Illutron B

Is there a must build Arduino project ? Something simple that can be built in minutes and tinkered with for days or weeks ?

There is now.

Presenting the Illutron B -




The Illutron B is a development of the Illutron synthesizer originally created by Nikolaj Mobius. All of the sound in the clip is being generated by the Arduino with no outside assistance or post processing - the bass notes are extraordinary.

Even more incredibly is that all of the sound is being generated using just one analog output.

How does it work ?
If you think of an analog output as a power switch, the longer it is switched on, the more power we output. By varying the duration that the power is on over time we can output a waveform, for example a sine wave.

Its a technique known as Direct Digital Synthesis. The is a good example here http://interface.khm.de/index.php/lab/experiments/arduino-dds-sinewave-generator/


Taking it further - Skip the theory if you like, or read on -
The Illutron B is a wave table synthesizer, this is a synthesizer which uses the Direct Digital Synthesis described above to generate sound waves using descriptions 'wave tables' that are stored in the memory. 

The wavetables are simply arrays, if you take the values from each of the wave header files and copy them into your favorite spreadsheet you will see the following - 


Synth designers know that as listeners we do not find endlessly repeating sine, square or triangle waves very interesting. To make the sound more musical wave table synthesizers combine the waveform with an envelope. 


The envelope describes the power or loudness of the waveform over time - think of a snare drum, its starts very powerfully and decays away to nothing very quickly - a flute can start softly, reach a level then decay softly - its the envelope that describes this. The simple trick of combining the wavetable with an envelope is responsible for the huge range of musical possibilities in wavetable synthesis.

How do we do this in software ? - It couldn't be easier, we mulitply the waveform by the envelope, as the envelope value gets smaller, so the output waveform shrinks away to nothing.

Have a look through the code, its extensively documented.

Built in envelopes - the faster the sound drops away, the more percussive (drum like) the envelope -


You can add your own envelopes, or modify the supplies ones, there is no rule that an envelop cannot start quietly and get louder - or look like a heart beat for a pulsing bass sound.


Build your own pocket night club -

How long does it take to build ? anywhere from 5 to 10 minutes, seriously, if you have two potentiometers a few capacitors and resistors you can be playing your own Illutron B in 10 minutes.

What does it do ?

While the synth is very powerful, Nikolaj has included a demonstration tune which is the basis of the clip.

In the clip I am using the Illutron B which provides control over the beats per minute and also the pitch of one of the four channels using just two potentiometers to jam with the demo tune.

This is where RCArduino comes in. When I first heard the Illutron I was blown away, it is far and away the best Arduino Audio project of all. The drum sounds are awesome, the bass is incredible, you will not get tired of exploring those low notes. I know that as a community we can make great things from this.

For this reason I have spent the past few days refactoring, optimizing and documenting the Illutron version B.

Some ideas for your own Illutron projects -

1) Hook up some peizo knock sensors for an electronic drum kit
2) Bass loop generator with push buttons for different bass drops
3) A four channel sequencer
4) Sound effects for games, installations and robots
5) Its a great basis for a Thermin or similar physical instrument.
6) Add some soft pots, cross faders or a stylus to control the pitch of the different channels

Nightclub in your pocket

My own idea is to build on the current example - Ideally I would like to see a set of beats or tunes included in a 'Night club in a box' where the user can select the beat with a push button. The user is then free to jam with the selection in the same manner as the video - Arduino, two potentiometers, one resistor, two capacitors, synched LED Light show and you have an instant pocket night club that everyone can enjoy.


In order to support the further development of Nikolaj's original concept I have refactored the original Illutron code into a more user friendly class library while at the same time taking the opportunity to do some optimizing and improve the readability of the code.

If you would prefer to use Nikolaj's original code for the Illutron Wave Table Synth, its available here - http://www.instructables.com/id/Turn-your-Arduino-into-a-4-voice-wavetable-synth-w/

The Illutron B code is being added to the Illutron repository on github I will provide a link once its uploaded,  in the meantime, you can get it from me - DuaneB on the Arduino forum.

If your a musician it should be immediately obvious how to setup and trigger the different voices, the sample sequencer is also easy to understand and modify. If like me you are not a musician, build one anyway, the demo tune is great to play with and I hope to get some new tunes included for you to upload.

Whats an Illutron ?

Its actually an art studio on a ship in Copenhagen harbour. The original Illutron synth was created by a member of the Illutron collective Nikolaj Mobius. You can find out more about Illutron and their work in light, sound, electronics and a surprising amount of fire here - http://illutron.dk/posts/54


Building your own Illutron B - 

The easy part - 
2 * 10 K Potentiometers
4 * LEDs (or eight if you like)
4 * LED Current Limiting Resistors (500 to 1000 Ohms should be fine)

The only slightly less easy part -

Jelly Beans

What are Jelly Beans and why do I need them ?

Jelly Beans are those common components that all circuits need and you should have a jar full of. If your just starting out, you might not have these, but get some, they are very cheap standard components which are widely used in all sort of circuits.

1 * 2.2K resistor (or two 1K resistors in series - anything thats close)
1 * 0.1uF capacitor - you should have hundreds of these, they are used for stopping interference from other components from reaching the sensitive parts of your circuits, if you don't have any, buy 20, they are cheap and you will use them for everything.
1 * 100uf  capacitor - again these are widely used. In this case the capacitor is there to filter out a DC voltage so that your Audio equipment only receives the alternating signal part of the Arduino output. If you don't have any of these, get 10.

Here is the Schematic -

Note : The Fritzing software used to draw the circuit labels C2 with 0.1mF, this is the 100uf capacitor, 100uf is the most common way to represent this value but 0.1mf is also correct (1uf = 0.001mf so 100uf = 0.1mf)

You can also follow the original build instructions here -http://www.instructables.com/id/Turn-your-Arduino-into-a-4-voice-wavetable-synth-w/

Here is mine as used in the video. For the nightclub in a box project I will be adding two amplifiers based on the previous rcarduino post - Adding Audio To Arduino Projects - http://rcarduino.blogspot.com/2012/08/adding-audio-to-arduino-projects.html


The final part of the build to to plug the Illutron B into your MP3 Player docking station - I used a section of head phone cable soldered to a three pin header for this -


The code is now available for download on the RCArduino downloads page here -

http://rcarduino.blogspot.ae/2014/02/rcarduino-downloads.html

If you have any problems with the download, contact me 'DuaneB' through the Arduino forum or leave a comment.

In a future post I will explore more of the capabilities of the Illutron B, the Illutron team will also be working on new Illutron synth based projects.

Stay tuned

Duane B