introduction to the 16x4x3
this post assumes that you have *some* very basic knowledge of electronics and programming. if not, google is your best friend, it is really easy to learn!
the 16x4x3 is a chase light step sequencer, capable of sequencing 12 voices. additionally it has 4 shift buttons which control different functions and 2 potentiometers. but first of all, its just a box with buttons and lights. the 16x4x3 is based on the arduino, a great open source / open hardware micro controller.
the arduino is used to read button and potentiometer/mode-selector data thru its analog inputs and to control the led´s thru its digital outputs. the actual sequencing is happening inside a max/msp patch. the reason for this, is that it allows us to easily change the functionality of the box and not bounding it to one firmware.
as we want to connect 20 buttons, 2 potentiometers
and a 12 scale mode-selector, we need a total of 34 inputs. additionally, we want to control 20 led´s, so we need 20 digital outputs. the arduino has 6 analog inputs and 14 digital inputs/outputs, which is obviously not enough, so we are going to use five 4051 analog multiplexers to multiply our analog inputs and create a total of 40 inputs, and three 595 shift registers to multiply our digital outputs and create a total of 24 outputs.
data sheet, info and arduino tutorial of the 4051 multiplexer
data sheet, info and arduino tutorial of the 595 shift register
daisy-chaining five 4051´s for button input schematics(click for larger view):
daisy-chaining three 595´s for led control schematics(click for larger view):
the arduino code:
// credits and respect to Sebastian Tomczak (little scale)
// for all the useful information and help ive found in his blog
// during the 16x4x3 project. openskinnerbox 2009
int latchPin = 8;
int clockPin = 12;
int dataPin = 11;
byte data1;
byte data2;
byte data3;
byte data;
void setup() {
Serial.begin(57600);
DDRD = B00011110;
pinMode(latchPin, OUTPUT);
}
void loop() {
for(int i = 0; i < 40; i++) {
PORTD = (i % 8) << 2;
data = (analogRead(i / 8)) / 4;
Serial.print(data);
}
delay(5);
if(Serial.available() > 2) {
data1 = Serial.read();
data2 = Serial.read();
data3 = Serial.read();
digitalWrite(latchPin, 0);
shiftOut(dataPin, clockPin, data1);
shiftOut(dataPin, clockPin, data2);
shiftOut(dataPin, clockPin, data3);
digitalWrite(latchPin, 1);
}
}
void shiftOut(int myDataPin, int myClockPin, byte myDataOut) {
int i=0;
int pinState;
pinMode(myClockPin, OUTPUT);
pinMode(myDataPin, OUTPUT);
digitalWrite(myDataPin, 0);
digitalWrite(myClockPin, 0);
for (i=7; i>=0; i--) {
digitalWrite(myClockPin, 0);
if ( myDataOut & (1<<i) ) {
pinState= 1;
}
else {
pinState= 0;
}
digitalWrite(myDataPin, pinState);
digitalWrite(myClockPin, 1);
digitalWrite(myDataPin, 0);
}
digitalWrite(myClockPin, 0);
}
Saturday, November 7, 2009
Monday, November 2, 2009
the sbx 16x4x3
hello world and a channel arpeggiator
as a first post, we proudly introduce the "skinnerbox ch.dis" which stands for midi channel arpeggiator. this simple little patch takes midi note data from your favorite host and reproduce it with a changing midi channel per note.
like-so one can play multitimbral content using one midi track to send
midi data and up to 16 midi tracks to receive the notes in a"arpeggiating" fashion. we´ve initially programmed this patch to produce "octopus bigband"
which appears on our upcoming album "king of spades and marmalades".
download the patch here.
requires max/msp 5 runtime, get it here.
like-so one can play multitimbral content using one midi track to send
midi data and up to 16 midi tracks to receive the notes in a"arpeggiating" fashion. we´ve initially programmed this patch to produce "octopus bigband"
which appears on our upcoming album "king of spades and marmalades".
download the patch here.
requires max/msp 5 runtime, get it here.
Subscribe to:
Posts (Atom)