Pages: [1]   Go Down
Author Topic: 64 knob MIDI controller prototype  (Read 1997 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Knobby knob midi controller project prototype number 2. 64 knobs working smooth as eggs. Refined the code a bit to achieve said smoothness and accommodate new multiplexing board I built that handles the 64 knobs (256 knobs is possible with this design, but that's just crazy). Multiplexing board was built from scratch by designing circuit layout with CAD -- printing layout onto transparency paper and exposing and developing light sensitive board with pattern. This one was really rough, but honestly super surprised it worked on first attempt. Next step will be coming up with ideas for a nice enclosure.

Code:
byte muxSelect[64] = {
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000000,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000001,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000010,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011,
  B00000011};  //set array of port values

byte muxRead[64] = {
  B00000000,
  B00010000,
  B00100000,
  B00110000,
  B01000000,
  B01010000,
  B01100000,
  B01110000,
  B10000000,
  B10010000,
  B10100000,
  B10110000,
  B11000000,
  B11010000,
  B11100000,
  B11110000,
  B00000000,
  B00010000,
  B00100000,
  B00110000,
  B01000000,
  B01010000,
  B01100000,
  B01110000,
  B10000000,
  B10010000,
  B10100000,
  B10110000,
  B11000000,
  B11010000,
  B11100000,
  B11110000,
  B00000000,
  B00010000,
  B00100000,
  B00110000,
  B01000000,
  B01010000,
  B01100000,
  B01110000,
  B10000000,
  B10010000,
  B10100000,
  B10110000,
  B11000000,
  B11010000,
  B11100000,
  B11110000,
  B00000000,
  B00010000,
  B00100000,
  B00110000,
  B01000000,
  B01010000,
  B01100000,
  B01110000,
  B10000000,
  B10010000,
  B10100000,
  B10110000,
  B11000000,
  B11010000,
  B11100000,
  B11110000};  //set array of port values

int chanVal[64]; //initialize array to hold all 64 values to compare with old values
int oldChanVal[64];  //initialize array to hold all 64 old values to compare with new values

void setup(){

  DDRB = B00001111;  // set PORTB (digital pins 8-11) to output
  PORTB = B00000000;  // set PORTB to LOW
  DDRD = DDRD | B11110000;  // set PORTD (digital pins 4-7) to output while making sure not to change pins 0 and 1 (TX and RX)
  PORTD = B00000000;  // set PORTD to LOW

  Serial.begin(31250);  //set this to 31250 for MIDI
}

void loop(){

  for(int a=0; a < 64; a++){  //loop through all 64 channels

    PORTB = muxSelect[a];
    PORTD = muxRead[a];
    chanVal[a] = map(analogRead(A0), 0, 1023, 0, 127); 

    if(abs(chanVal[a] - oldChanVal[a]) > 1){  //test to see if any of the values in the chanVal array have changed by more than one -- if so, print
      Serial.write(0xB0);
      //Serial.print("::");
      Serial.write(a);
      //Serial.print("::");
      Serial.write(chanVal[a]);
    }
    oldChanVal[a] = chanVal[a]; //assign chanVal values to oldChanVal before starting over
  }
  delay(64);
}



* arduino-muxBoard.jpg (334.17 KB, 1024x768 - viewed 62 times.)

* muxBoardBack4.jpg (377.72 KB, 1024x768 - viewed 67 times.)

* muxBoardPlugged.jpg (347.85 KB, 1024x768 - viewed 37 times.)

* whole1.jpg (336.98 KB, 1024x768 - viewed 80 times.)
Logged

Brisbane, Australia
Online Online
Edison Member
*
Karma: 29
Posts: 1071
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow.  I'm subbing here for the eventual link to your performance video  : )
Next step will be coming up with ideas for a nice enclosure.
I'm a fan of the Cisco router case featured in those photos - does it all fit back in there?

Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow.  I'm subbing here for the eventual link to your performance video  : )
Next step will be coming up with ideas for a nice enclosure.
I'm a fan of the Cisco router case featured in those photos - does it all fit back in there?

Geoff

Videos coming soon...   smiley-lol

Yea it does all fit in the case.  I would need to drill holes and get standoffs for the mux board though.  My goal for the final revision is to have the programed ATmega chip, USB, and multiplexer chips on one board.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a 30 sec. clip of me trying to demonstrate the smoothness of the resolution...  Using FRAPS for screen capture -- any recommendations for something better?

« Last Edit: January 27, 2013, 04:25:55 pm by monoLab » Logged

Collegno, Turin
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino lovers
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What kind of pots did you use???

100k??? 10k??? 1m???

nice work man smiley
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What kind of pots did you use???

100k??? 10k??? 1m???

nice work man smiley

10K pots.  I bought the cheapest ones I could find and they are a little noisy...   smiley-red
Logged

geo. area called Italia
Offline Offline
Full Member
***
Karma: 0
Posts: 190
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

nice! Could you post the schematics?
Logged

Pages: [1]   Go Up
Jump to: