Components and supplies
matching pcb
LCD fordata 16x1 (FC1601B00)
amphenol 1/4" jack MV2
Rotary Encoder with Push-Button
case 19" 1U
Arduino Nano R3
Tools and machines
Soldering iron (generic)
Solder Flux, Soldering
Apps and platforms
Arduino IDE
Project description
Code
lcd.ino
c_cpp
text list for LCD
1// 60s DDR Begleitautomat Text 2 3#include <LiquidCrystal.h> 4 5const static char drum[78][17] PROGMEM={"NO RHYTHM SELECT", 6 "BAION A ","BAION B ","BAMBA ","BEAT A ","BEAT B ", 7 "BEAT-WALTZ A ","BEAT-WALTZ B ","BEGUINE ","BLACK BOTTOM ","BLUES ", 8 "BOLERO ","BOOGIE-WOOGIE ","BOSSA-NOVA ","BOSTELLA ","BOUNCE ", 9 "CALYPSO ","CARIOCA ","CHA-CHA-CHA ","CHARLESTON A ","CHARLESTON B ", 10 "CONGA ","FOXTROT A ","FOXTROT B ","FOXTROT FAST ","FOXTROT SLOW A ", 11 "FOXTROT SLOW B ","FOXTROT SYNCOPED","GUARACHA A ","GUARACHA B ","HILL-BILLY ", 12 "HULLY-GULLY ","LETKISS ","LIPSI ","LOKOMOTION A ","LOKOMOTION B ", 13 "MADISON ","MAMBO FAST ","MAMBO SLOW A ","MAMBO SLOW B ","MARCH ", 14 "MARCH SLOP A ","MARCH SLOP B ","MEMPHIS ","MEXICAN WALTZ ","MONTUNO ", 15 "MOZAMBIQUE ","NANIGO ","PACHANGA ","PASO DOBLE USA ","PASO DOBLE SPAIN", 16 "POLKA ","RASPA ","RHEINLAND ","ROCK ","ROCK-BEAT ", 17 "RUMBA ","RUMBA-ROCK ","SAMBA A ","SAMBA B ","SHAKE ", 18 "SHUFFLE-FOXTROT ","SIRTAKI ","SLOP A ","SLOP B ","SOUL ", 19 "SOUL-BEAT ","SURF A ","SURF B ","SWING QUINTO ","SWING-FOXTROT ", 20 "SWING-WALTZ A ","SWING-WALTZ B ","TANGO A ","TANGO B ","TANGO-BOLERO ", 21 "TWIST ","WALTZ "}; 22 23byte x=0; // char counter 24byte e=0; // rhythm number 25LiquidCrystal lcd(6,7,5,8,4,9,3,10,2,11); // RS, EN, D0-7 26char buff[20]; // selected drum buffer 27 28void setup() 29{ 30 Serial.begin(9600); 31 lcd.begin(8,2); 32 lcd.clear(); 33 lcd.noCursor(); 34 lcd.noBlink(); 35 lcd.noAutoscroll(); 36 lcd.display(); 37} 38 39void loop() 40{ 41 if (Serial.available()>0) 42 { 43 e=Serial.read(); 44 for (x=0;x<16;x++) 45 { 46 buff[x]=pgm_read_byte_near(&drum[e][x]); 47 } 48 lcd.clear(); 49 lcd.home(); 50 for (x=0;x<8;x++) 51 { 52 lcd.setCursor(x,0); 53 lcd.write(buff[x]); 54 lcd.setCursor(x,1); 55 lcd.write(buff[x+8]); 56 } 57 } 58} 59
lcd.ino
c_cpp
text list for LCD
1// 60s DDR Begleitautomat Text 2 3#include <LiquidCrystal.h> 4 5const static char drum[78][17] PROGMEM={"NO RHYTHM SELECT", 6 "BAION A ","BAION B ","BAMBA ","BEAT A ","BEAT B ", 7 "BEAT-WALTZ A ","BEAT-WALTZ B ","BEGUINE ","BLACK BOTTOM ","BLUES ", 8 "BOLERO ","BOOGIE-WOOGIE ","BOSSA-NOVA ","BOSTELLA ","BOUNCE ", 9 "CALYPSO ","CARIOCA ","CHA-CHA-CHA ","CHARLESTON A ","CHARLESTON B ", 10 "CONGA ","FOXTROT A ","FOXTROT B ","FOXTROT FAST ","FOXTROT SLOW A ", 11 "FOXTROT SLOW B ","FOXTROT SYNCOPED","GUARACHA A ","GUARACHA B ","HILL-BILLY ", 12 "HULLY-GULLY ","LETKISS ","LIPSI ","LOKOMOTION A ","LOKOMOTION B ", 13 "MADISON ","MAMBO FAST ","MAMBO SLOW A ","MAMBO SLOW B ","MARCH ", 14 "MARCH SLOP A ","MARCH SLOP B ","MEMPHIS ","MEXICAN WALTZ ","MONTUNO ", 15 "MOZAMBIQUE ","NANIGO ","PACHANGA ","PASO DOBLE USA ","PASO DOBLE SPAIN", 16 "POLKA ","RASPA ","RHEINLAND ","ROCK ","ROCK-BEAT ", 17 "RUMBA ","RUMBA-ROCK ","SAMBA A ","SAMBA B ","SHAKE ", 18 "SHUFFLE-FOXTROT ","SIRTAKI ","SLOP A ","SLOP B ","SOUL ", 19 "SOUL-BEAT ","SURF A ","SURF B ","SWING QUINTO ","SWING-FOXTROT ", 20 "SWING-WALTZ A ","SWING-WALTZ B ","TANGO A ","TANGO B ","TANGO-BOLERO ", 21 "TWIST ","WALTZ "}; 22 23byte x=0; // char counter 24byte e=0; // rhythm number 25LiquidCrystal lcd(6,7,5,8,4,9,3,10,2,11); // RS, EN, D0-7 26char buff[20]; // selected drum buffer 27 28void setup() 29{ 30 Serial.begin(9600); 31 lcd.begin(8,2); 32 lcd.clear(); 33 lcd.noCursor(); 34 lcd.noBlink(); 35 lcd.noAutoscroll(); 36 lcd.display(); 37} 38 39void loop() 40{ 41 if (Serial.available()>0) 42 { 43 e=Serial.read(); 44 for (x=0;x<16;x++) 45 { 46 buff[x]=pgm_read_byte_near(&drum[e][x]); 47 } 48 lcd.clear(); 49 lcd.home(); 50 for (x=0;x<8;x++) 51 { 52 lcd.setCursor(x,0); 53 lcd.write(buff[x]); 54 lcd.setCursor(x,1); 55 lcd.write(buff[x+8]); 56 } 57 } 58} 59
begleitautomat.ino
c_cpp
rhythm table and code
1// 60s DDR Begleitautomat Rhythmen 2 3// bass drum 4const static unsigned long bd[78] PROGMEM={0, 5 81,25,257,20820,8513,1041,4097,4353,4353,257, 6 257,4369,289472833,257,33153,16847105,4161,20753,257,257, 7 4260097,257,4369,257,257,257,65,4161,4353,257, 8 257,257,69889,4369,4369,286282001,16843009,4161,257,257, 9 4369,4369,16843009,1118481,5185,16843009,1118481,17043713,273,4369, 10 17,65,17,4369,17473,16843009,4161,16843009,321,4369, 11 4369,257,321,20545,17733,289493313,0,321,4097,4369, 12 1025,257,85,17,1438991685,4353,1}; 13 14// snare drum 15const static unsigned long sd[78] PROGMEM={0, 16 76,17,20817,17476,0,2576,1114384,17476,4417,32784, 17 23901,0,68161601,4112,0,1427181889,17684,4112,4112,4369, 18 272699733,4112,4369,4112,4369,1028,1105,21780,0,0, 19 23644,4369,1066000,4112,4369,286282001,0,0,257,4112,4112, 20 17476,273698896,0,0,1431655765,0,1157697857,1373,17501,68, 21 1361,68,4112,17424,0,21585,0,4433,4369,4112, 22 4112,4112,21597,18373,68158480,17476,4112,65924,4112,16, 23 0,213,91,1438991685,4176,272}; 24 25// low tom 26const static unsigned long lt[78] PROGMEM={0, 27 0,204,0,0,37008,0,0,0,0,0, 28 0,0,0,0,0,0,0,0,0,0, 29 0,0,0,0,0,0,0,0,1281,0, 30 0,0,0,0,0,0,0,0,0,0, 31 0,0,0,0,16384,0,0,0,0,0, 32 0,0,0,0,0,67437632,0,0,0,0, 33 0,0,0,0,0,0,0,0,0,0, 34 0,0,0,0,0,0,0}; 35 36// high tom 37const static unsigned long ht[78] PROGMEM={0, 38 0,0,0,0,25925,0,0,0,0,0, 39 0,0,0,0,0,0,0,0,0,0, 40 0,0,0,0,0,0,0,0,20544,0, 41 0,0,0,0,0,0,0,0,0,0, 42 0,0,0,0,1109,0,0,0,0,0, 43 0,0,0,0,0,1374744861,0,0,0,0, 44 0,0,0,0,0,0,0,0,0,0, 45 0,0,0,0,0,0,0}; 46 47// cymbal 48const static unsigned long cy[78] PROGMEM={0, 49 76,0,257,21845,4369,3925,10066329,0,0,37265, 50 257,39321,1431655765,257,39321,0,0,20817,0,4369, 51 0,37265,0,0,0,1028,0,0,0,20817, 52 0,257,0,4369,17476,1064960,1364283729,21589,20817,0, 53 21845,4369,286331153,1381445,0,269488144,5510213,0,0,0, 54 0,0,0,4369,21845,0,0,289685777,4369,4369, 55 39321,257,21845,0,4112,1431655765,4369,0,69905,37265, 56 2448,2449,0,0,1438991685,21845,0}; 57 58// maracas 59const static unsigned long mc[78] PROGMEM={0, 60 0,0,0,0,0,0,0,0,0,0, 61 0,0,0,0,0,1431655765,0,0,0,0, 62 1431655765,0,0,0,0,0,0,21845,21845,0, 63 0,0,0,0,0,0,1431655765,0,0,0, 64 0,0,0,0,0,0,5592405,1431655765,0,0, 65 0,0,0,0,0,1431655765,0,1431655765,21845,0, 66 0,0,0,0,0,0,0,0,0,0, 67 0,0,0,0,0,0,0}; 68 69// claves 70const static unsigned long cl[78] PROGMEM={0, 71 0,0,0,0,0,0,0,0,0,0, 72 0,0,0,0,0,17829953,0,0,0,0, 73 272695568,0,0,0,0,0,0,4161,4161,0, 74 0,0,0,0,0,0,17829953,0,0,0, 75 0,0,0,0,0,0,4477265,17829953,0,0, 76 0,0,0,0,0,17829953,0,0,0,0, 77 0,0,0,0,0,0,0,0,0,0, 78 0,0,0,0,0,0,0}; 79 80// cow bell 81const static unsigned long cb[78] PROGMEM={0, 82 0,0,0,0,0,0,0,0,0,0, 83 0,0,0,0,0,0,0,0,0,0, 84 0,0,0,0,0,0,0,0,0,0, 85 0,0,0,0,0,0,289685777,0,0,0, 86 0,0,0,0,0,1363431697,0,0,0,0, 87 0,0,0,0,0,0,0,0,0,0, 88 0,0,0,0,0,0,0,0,0,0, 89 0,0,0,0,0,0,0}; 90 91// bass trigger 92const static unsigned long bass[78] PROGMEM={0, 93 81,17,257,21589,17473,1345,4097,4353,4417,4369, 94 20801,4369,289472833,257,33153,16843009,4161,16705,257,4353, 95 272695553,257,4369,257,257,33153,65,20561,4353,257, 96 257,257,69889,4369,21845,286282001,1347506257,4161,5441,257, 97 4369,4369,4260097,1118481,17477,289472833,1118481,285282561,273,4369, 98 17,65,17,4369,16705,285282561,4161,16843009,321,4369, 99 4369,4433,16705,20545,17733,289493313,4369,321,69697,4369, 100 1025,257,213,89,1438991685,4353,1}; 101 102// chords trigger 103const static unsigned long chord[78] PROGMEM={0, 104 76,95,4112,4369,27861,1040,1151377,17476,4417,4369, 105 20560,34952,356778257,20817,1028,269488196,17684,5140,4112,4369, 106 272699472,4369,4369,4112,4369,1028,1105,16,4161,20560, 107 21588,4112,1066000,56797,43690,269504528,67372036,21589,4112,4112, 108 21844,17476,340873553,282689,17493,1431655765,282689,1141130244,1092,17476, 109 68,1361,68,4112,1104,273682512,21585,289685777,4112,4369, 110 34952,4112,1040,21584,4112,1141903376,17476,1040,65796,4369, 111 2448,276,85,91,1438991685,21845,272}; 112 113// bar length, called reset value 114const static byte res[78]={0, 115 8,8,16,16,16,12,12,16,16,16, 116 16,16,16,16,16,32,16,16,16,16, 117 32,16,16,16,16,16,12,16,16,16, 118 16,16,24,16,16,32,32,16,16,16, 119 16,16,32,24,16,32,24,32,12,16, 120 8,12,8,16,16,32,16,32,16,16, 121 16,16,16,16,16,32,16,16,20,16, 122 12,12,8,8,32,16,12}; 123 124byte x=0; // rhythm step 125byte volatile e=0; // rhythm select 126const byte i=77; // rhythm count 127bool enc=LOW; // enc A merker 128unsigned long buff[10]; // rhythm buffer 129byte y=0; 130int a=0; 131 132 133void setup() 134{ 135Serial.begin(9600); 136attachInterrupt(digitalPinToInterrupt(2),pulse,RISING); // clock 137pinMode(3,OUTPUT); // BD 138pinMode(4,OUTPUT); // SD 139pinMode(5,OUTPUT); // LT 140pinMode(10,OUTPUT); // HT 141pinMode(9,OUTPUT); // CY 142pinMode(8,OUTPUT); // MC 143pinMode(7,OUTPUT); // CL 144pinMode(6,OUTPUT); // CB 145pinMode(12,OUTPUT); // bass 146pinMode(11,OUTPUT); // chords 147pinMode(A0,INPUT); // s/s 148pinMode(A2,INPUT_PULLUP); // enc B 149pinMode(A3,INPUT_PULLUP); // enc A 150pinMode(13,OUTPUT); // view IRQ 151delay(2000); // wait for LCD 152Serial.write(0); // send zero LCD value 153} 154 155void pulse() 156{ 157if (digitalRead(A0) == HIGH) // S/S active 158 { 159 digitalWrite(13,HIGH); // show IRQ time 160 buff[0]=pgm_read_dword_near(&bd[e]); // read all drums 161 buff[1]=pgm_read_dword_near(&sd[e]); 162 buff[2]=pgm_read_dword_near(<[e]); 163 buff[3]=pgm_read_dword_near(&ht[e]); 164 buff[4]=pgm_read_dword_near(&cy[e]); 165 buff[5]=pgm_read_dword_near(&mc[e]); 166 buff[6]=pgm_read_dword_near(&cl[e]); 167 buff[7]=pgm_read_dword_near(&cb[e]); 168 buff[8]=pgm_read_dword_near(&bass[e]); 169 buff[9]=pgm_read_dword_near(&chord[e]); 170 digitalWrite(3,bitRead(buff[0],x)); // put out steps 171 digitalWrite(4,bitRead(buff[1],x)); 172 digitalWrite(5,bitRead(buff[2],x)); 173 digitalWrite(10,bitRead(buff[3],x)); 174 digitalWrite(9,bitRead(buff[4],x)); 175 digitalWrite(8,bitRead(buff[5],x)); 176 digitalWrite(7,bitRead(buff[6],x)); 177 digitalWrite(6,bitRead(buff[7],x)); 178 digitalWrite(12,bitRead(buff[8],x)); 179 digitalWrite(11,bitRead(buff[9],x)); 180 delay(5); // trigger pulse length 181 digitalWrite(3,LOW); // trigger pulse low 182 digitalWrite(4,LOW); 183 digitalWrite(5,LOW); 184 digitalWrite(6,LOW); 185 digitalWrite(7,LOW); 186 digitalWrite(8,LOW); 187 digitalWrite(9,LOW); 188 digitalWrite(10,LOW); 189 digitalWrite(11,LOW); 190 digitalWrite(12,LOW); 191 x++; // increase step 192 if (x >= res[e]) 193 { 194 x = 0; 195 } 196 digitalWrite(13,LOW); 197 } 198else // stop mode 199 { 200 x=0; 201 digitalWrite(3,LOW); 202 digitalWrite(4,LOW); 203 digitalWrite(5,LOW); 204 digitalWrite(6,LOW); 205 digitalWrite(7,LOW); 206 digitalWrite(8,LOW); 207 digitalWrite(9,LOW); 208 digitalWrite(10,LOW); 209 digitalWrite(11,LOW); 210 digitalWrite(12,LOW); 211 } 212} 213 214void loop() 215{ 216 if (digitalRead(A2) == HIGH && enc == LOW) // enc B 217 { 218 delay(5); 219 if (digitalRead(A3) == HIGH) // enc A 220 { 221 e++; 222 if (e > i) 223 { 224 e = 1; 225 } 226 } 227 else 228 { 229 e--; 230 if (e == 0) 231 { 232 e = i; 233 } 234 } 235 enc = HIGH; 236 Serial.write(e); 237 } 238 delay(5); 239 if (digitalRead(A2) == LOW && enc == HIGH) // enc B 240 { 241 enc = LOW; 242 delay(5); 243 } 244} 245
Downloadable files
panel
panel
pcb
pcb w/ arduinos and buffers
pcb
pcb
pcb w/ arduinos and buffers
pcb
panel
panel
Documentation
rhythm list
rhythm list
rhythm list
rhythm list
Comments
Only logged in users can leave comments