Arduino Step Sequencer




I was wondering about on making a sequencer, a big 16 step sequencer was what I wanted to make. To it’s full extension with lots of features including single leds for each step, midi input and output, etc. Then I realised that I should start from a more basic model and then maybe tweak around to see what I can do. So while surfing the web and between other small sequencer projects I found this arduino sequencer, named “arduino punk console” after the simple tone output device from the 555 (atari punk console) and using the arduino as the tone generator.
So here goes a simple project which can later be modified and used in different projects, check last step for more detail on stuff to do with this sequencer.
Schematic, code and original idea is from Beavis Audio, everything can be found at there website:
www.beavisaudio.com

Here is a little preview video I made:

Remove these ads




Remove these ads by Signing Up

Arduino Step Sequencer

Step 1: Materials

The bill of materials to making this project consists in:

  •  X8 Momentary pushbuttons, normally open.
  •  X1 Small Toggle DPDT switch.
  •  X1 LED, whichever color, it’s only used to indicate that the Arduino is on and working.
  •  X9 10K resistors.
  •  X4 100K Potentiometers.
  •  X1 Female stereo jack, it can be 3,5mm or a 6,3mm.
  •  X1 Cable.
  •  X1 Enclosure, I just picked up a simple hard plastic box.
  •  X4 Knobs for the pots, only if you wish so.

List of tools to elaborate:

  •  Soldering Iron.
  •  Solder.
  •  Drill.
  •  Tweezers.
  •  Screwdrivers.

Step 2: Schematic and wiring

Following the schematic is fairly easy. What we must notice is that the 10K resistors are pull down, this means it’s hooked up to ground and it holds the logic signal when no other active device is connected. So you must hook the wire leading to the Arduino pins for the steps from the pushbutton. Arduino pins from digital 10 till 2 go to pushbuttons.
Then connect all buttons together with the pots positive lead and hook it up to 5V. All Resistors go together with pots negative leads and hook it up to ground. Also notice the traditional 100K wiring for the volume, which goes to Arduino digital 11. The pots go hooked up to Arduino analog 0, 1 and 3. Finally a red led goes to Arduino pin digital 12.

*There are two schematics. One that I made on Fritzing and the second one which is much better organised, can be found at beavis audio.

Step 3: Code

The original code comes with a LCD setup for displaying frequency changes. I just deleted that part, but you can get the code with lcd setup here.

Arduino Step Sequencer schematic

/* ======================================================================
Arduino Punk Console
A simple programmable 8 step tone sequencer
by dano/beavisaudio.com
Revs
———————————–
15 Sept  djh  initial version
======================================================================*/
// Map all the input and output pins
#define AnalogInFrequency 1
#define AnalogInTempo 2
#define AnalogInDuration 0
#define DigitalOutSignal 11
#define DigitalInSwitch0 2
#define DigitalInSwitch1 3
#define DigitalInSwitch2 4
#define DigitalInSwitch3 5
#define DigitalInSwitch4 6
#define DigitalInSwitch5 7
#define DigitalInSwitch6 8
#define DigitalInSwitch7 9
#define DigitalInStartStop 10
#define DigitalOutLED 12
// Set up the array for each step
int steps[] = {100,120,140,160,180,200,220,240};
// misc housekeeping
int duration = 50;
int pitchval = 1;
int fPlayMode = true;
int lastPushedStep = -1;
// Initialize the tempo
int tempo = 100;
void setup()
{
// setup pin modes (Digital pins are input by default, but
// I like to set ’em explicitly just so the code is clear.
pinMode (DigitalInSwitch0, INPUT);
pinMode (DigitalInSwitch1, INPUT);
pinMode (DigitalInSwitch2, INPUT);
pinMode (DigitalInSwitch3, INPUT);
pinMode (DigitalInSwitch4, INPUT);
pinMode (DigitalInSwitch5, INPUT);
pinMode (DigitalInSwitch6, INPUT);
pinMode (DigitalInSwitch7, INPUT);
pinMode (DigitalInStartStop, INPUT);
pinMode (DigitalOutSignal, OUTPUT);
pinMode (DigitalOutLED, OUTPUT);

}

void loop()
{
// Main sequence loop
for (int i=0; i<8; i++)
{
// Are we playing or stopping?
fPlayMode = digitalRead (DigitalInStartStop);
digitalWrite (DigitalOutLED, HIGH);
// Check the Hardware
readSwitches();
readPots();

// update the display
updateDisplay();

// Make the noise
if (fPlayMode)
{
freqout (steps[i], duration);
}
digitalWrite (DigitalOutLED, LOW);

// Pause between steps
delay (tempo);
}
}

void updateDisplay()
{
Serial.print (254, BYTE);
Serial.print (192, BYTE);
Serial.print (“T:”);
Serial.print (tempo);
Serial.print (” d:”);
Serial.print (duration);
if (lastPushedStep != -1)
{
Serial.print (“*”);
Serial.print (lastPushedStep);
}
}
// Read the current values of the pots, called from the loop.
void readPots ()
{
tempo = (analogRead (AnalogInTempo) * 1.9);
duration = (analogRead (AnalogInDuration));
}
// Read the current values of the switches and
// if pressed, replace the switch’s slot frequency
// by reading the frequency pot.
void readSwitches()
{
// reset last pushed button number
lastPushedStep = -1;

// check switch 0, if pressed, get the current freq into step 0, etc. etc.
if (digitalRead (DigitalInSwitch0) == HIGH)
{
steps[0] = analogRead(AnalogInFrequency);
lastPushedStep = 1;
}

else if (digitalRead (DigitalInSwitch1) == HIGH)
{
steps[1] = analogRead(AnalogInFrequency);
lastPushedStep = 2;
}

else if (digitalRead (DigitalInSwitch2) == HIGH)
{
steps[2] = analogRead(AnalogInFrequency);
lastPushedStep = 3;
}
else if (digitalRead (DigitalInSwitch3) == HIGH)
{
steps[3] = analogRead(AnalogInFrequency);
lastPushedStep = 4;
}
else if (digitalRead (DigitalInSwitch4) == HIGH)
{
steps[4] = analogRead(AnalogInFrequency);
lastPushedStep = 5;
}
else if (digitalRead (DigitalInSwitch5) == HIGH)
{
steps[5] = analogRead(AnalogInFrequency);
lastPushedStep = 6;
}
else if (digitalRead (DigitalInSwitch6) == HIGH)
{
steps[6] = analogRead(AnalogInFrequency);
lastPushedStep = 7;
}
else if (digitalRead (DigitalInSwitch7) == HIGH)
{
steps[7] = analogRead(AnalogInFrequency);
lastPushedStep = 8;
}
}

 

For more detail: Arduino Step Sequencer




This Post / Project can also be found using search terms:

  • arduino sequencer tutorial
Clip to Evernote

Leave a Comment

(Spamcheck Enabled)

Read previous post:
Arduino circuit
ASCII Table using Arduino

Demonstrates the advanced serial printing functions by generating a table of characters and their ASCII values in decimal, hexadecimal, octal,...

Close
Scroll to top