├── README.md ├── piLoopControl.ino └── piLooper ├── Loop.pd ├── clearCheck.pd ├── fmVoice.pd ├── load.pd ├── loop-midi.pd ├── loopLoad.pd ├── loopSave.pd ├── notecheck.pd ├── oneshot.pd ├── piLooper.pd ├── samp.pd ├── serial_print.pd ├── synthLeadVoice.pd ├── synthLeadVoiceThree.pd └── synthLeadVoiceTwo.pd /README.md: -------------------------------------------------------------------------------- 1 | # Raspberry-Pi-Looper-synth-drum-thing 2 | 3 | This is a fork of otem's "Raspberry Pi Looper synth drum thing" or "piLooper" as the pd file is called. This fork is designed to run on any computer with PD Vanilla installed with any MIDI controller plugged into it. 4 | 5 | All of the buttons and controls are done using MIDI but it's a bit buried within subpatches to actually find where the samples are being played and where you can change the note values. 6 | 7 | As with otem's version, no samples are provided for the drum machine portions. To quote his readme: 8 | 9 | > To add your own samples just add .wav files to the piLooper directory with names like: 10 | > 11 | > kick_01.wav - kick_24.wav 12 | > 13 | > hh_01.wav - hh_12.wav 14 | > 15 | > snare_01.wav - snare_24.wav 16 | > 17 | > crash_01.wav - crash_04.wav 18 | 19 | 20 | # How do I install this? 21 | 22 | * Download Pure Data Vanilla then open pd.exe (or mac equivalent) then click on "Help" -> "Find external" -> search for "comport" and install it, then search for "ggee" and install that too. You only need these if you're trying to use the external hardware, but it gets rid of the errors in the log so might as well install them. 23 | * Download the Raspberry-Pi-Looper-synth-drum-thing zip file and unzip it. 24 | * Open up piLooper.pd in Pure Data. 25 | * A window with a bunch of controls should now open up. In the menu bar, click on "Media" -> "MIDI Settings" and select your midi device. Close the MIDI settings window and go back to the piLooper window. 26 | * The big buttons start recording for each of the 8 loops, with the corresponding slider next to it, and the little red button is the clear button for each loop. The tall sliders below control the FX parameters. 27 | * In PD there's normal mode and Edit Mode. Switch between the two with Ctrl + E, Cmd + E, or "Edit" -> "Edit Mode". For now make sure you're not in edit mode to make this easier. 28 | * Click on the box labeled [pd guts]. This is a subpatch with a bunch of other subpatches in it. Clicking on it should open it, but it if you end up editing the name instead or moving it around, you are in Edit Mode. If you're in Edit Mode you can right-click / cmd-click -> "Open" instead. 29 | * From here click on [pd set-midi-buttons] 30 | 31 | Now the instructions on screen should be pretty straight forward, but the idea is that you're editing the message boxes to use the values of the buttons on your MIDI controller. Once you are done with the buttons, close the [pd set-midi-buttons] subpatch, and open [pd set-midi-knobs-or-sliders] and follow the same process. 32 | 33 | # What features aren't implemented (yet)? 34 | 35 | There are several features that I haven't implemented yet because I just haven't gotten around to it. 36 | 37 | * The X/Y pad 38 | * Lighting up MIDI buttons 39 | * External audio input 40 | * Saving / Loading songs 41 | * Probably some other features that I haven't noticed yet 42 | 43 | I should be able to have all these features added soon, but I might not be able to work on this until next weekend. 44 | 45 | For more details on this project, check out otem's original repo https://github.com/otem/Raspberry-Pi-Looper-synth-drum-thing 46 | -------------------------------------------------------------------------------- /piLoopControl.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "SPI.h" 4 | #include "ILI9341_t3.h" 5 | #include 6 | 7 | #define PIN 23 8 | #define NUMPIXELS 86 9 | Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); 10 | 11 | //drumPads 12 | #define NUM_BTN_COLUMNS (4) 13 | #define NUM_BTN_ROWS (4) 14 | #define MAX_DEBOUNCE (1) 15 | static const uint8_t btncolumnpins[NUM_BTN_COLUMNS] = {38, 39, 40, 41}; 16 | static const uint8_t btnrowpins[NUM_BTN_ROWS] = {42, 43, 44, 45}; 17 | static int8_t debounce_count[NUM_BTN_COLUMNS][NUM_BTN_ROWS]; 18 | 19 | //Encoder 20 | Bounce encBtn = Bounce(0,5); 21 | int encBtnStatus; 22 | int encPrevBtnStatus; 23 | unsigned long encHold; 24 | int encoderPin1 = 1; 25 | int encoderPin2 = 2; 26 | volatile int lastEncoded = 0; 27 | volatile long encoderValue = 0; 28 | long lastencoderValue = 0; 29 | int scaledEncVal; 30 | int prevScaledEncVal; 31 | 32 | //InputTog 33 | Bounce inputOneBtn = Bounce(7,5); 34 | Bounce inputTwoBtn = Bounce(8,5); 35 | bool inputOneTog = false; 36 | bool inputTwoTog = false; 37 | //transport 38 | Bounce clearBtn = Bounce(24,5); 39 | Bounce playStopBtn = Bounce(25,5); 40 | //bool playStop = false; 41 | //Inst Select 42 | Bounce instSelBtn = Bounce(26,5); 43 | int instNumber; 44 | bool instSelectMode = false; 45 | String instName[16] = { 46 | "Kit 1", "Kit 2","Kit 3","Kit 4", 47 | "Lead 1", "Pad 1", "Bass 1", "Keys 1", 48 | "Lead 2", "Pad 2", "Bass 2", "Keys 2", 49 | "Lead 3", "Pad 3", "Bass 3", "Keys 3", 50 | }; 51 | //roboDrums 52 | Bounce roboDrumBtn = Bounce(27,5); 53 | 54 | //LP Buttons 55 | int lpBtnPins[8] = {28,29,30,33,34,35,36,37}; 56 | int lpBtnState[8]; 57 | int lpPrevBtnState[8] = {HIGH}; 58 | Bounce lpBounce[] = { 59 | Bounce(28,10), 60 | Bounce(29,10), 61 | Bounce(30,10), 62 | Bounce(33,10), 63 | Bounce(34,10), 64 | Bounce(35,10), 65 | Bounce(36,10), 66 | Bounce(37,10), 67 | }; 68 | unsigned long clearTimstamp; 69 | 70 | String digitalStrings[8] = { 71 | "D1: ","D2: ","D3: ", "D4: ","D5: ","D6: ","D7: ","D8: " 72 | }; 73 | String drumStrings[16] = { 74 | "Dr1: ","Dr2: ","Dr3: ", "Dr4: ","Dr5: ","Dr6: ","Dr7: ","Dr8: ", 75 | "Dr9: ","Dr10: ","Dr11: ", "Dr12: ","Dr13: ","Dr14: ","Dr15: ","Dr16: " 76 | }; 77 | uint32_t neoColorArray[24] = { 78 | pixels.Color(0, 255, 255), 79 | pixels.Color(0, 255, 0), 80 | pixels.Color(255, 255, 0), 81 | pixels.Color(255,0,50), 82 | pixels.Color(0, 255, 255), 83 | pixels.Color(0, 255, 0), 84 | pixels.Color(255, 255, 0), 85 | pixels.Color(255,0,50), 86 | 87 | pixels.Color(0, 255, 255), 88 | pixels.Color(0, 255, 0), 89 | pixels.Color(255, 255, 0), 90 | pixels.Color(255,0,50), 91 | pixels.Color(0, 255, 255), 92 | pixels.Color(0, 255, 0), 93 | pixels.Color(255, 255, 0), 94 | pixels.Color(255,0,50), 95 | 96 | pixels.Color(0, 255, 255), 97 | pixels.Color(0, 255, 0), 98 | pixels.Color(255, 255, 0), 99 | pixels.Color(255,0,50), 100 | pixels.Color(0, 255, 255), 101 | pixels.Color(0, 255, 0), 102 | pixels.Color(255, 255, 0), 103 | pixels.Color(255,0,50), 104 | }; 105 | uint32_t neoColorArrayDim[8] = { 106 | pixels.Color(0, 15.9375, 15.9375), 107 | pixels.Color(0, 15.9375, 0), 108 | pixels.Color(15.9375, 15.9375, 0), 109 | pixels.Color(15.9375,0,50), 110 | pixels.Color(0, 15.9375, 15.9375), 111 | pixels.Color(0, 15.9375, 0), 112 | pixels.Color(15.9375, 15.9375, 0), 113 | pixels.Color(15.9375,0,3.125), 114 | }; 115 | uint32_t neoColorOff = pixels.Color(0,0,0); 116 | 117 | 118 | // LCD STUFF 119 | #define TFT_DC 9 120 | #define TFT_CS 10 121 | // Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC 122 | ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC); 123 | 124 | //Mux control pins 125 | int s0 = 3; 126 | int s1 = 4; 127 | int s2 = 5; 128 | int s3 = 6; 129 | //Mux in "SIG" pin 130 | int SIG_pin = A0; 131 | 132 | int analogValues[22]; 133 | int analogValuesLag[22]; 134 | String analogStrings[22] = { 135 | "A1: ","A2: ","A3: ", "A4: ","A5: ","A6: ","A7: ","A8: ","A9: ","A10: ","A11: ", 136 | "A12: ","A13: ","A14: ","A15: ","A16: ","A17: ","A18: ","A19: ","A20: ","A21: ","A22: " 137 | }; 138 | 139 | //NintendoScreen 140 | int yPin1 = A7; 141 | int xPin2 = A8; 142 | int yPin2 = A12; 143 | int xPin1 = A13; 144 | int touchX; 145 | int touchY; 146 | int fxTogOn = 0; 147 | int fxTogOff = 1; 148 | unsigned long readTime; 149 | unsigned long prevReadTime; 150 | unsigned long readTimeTwo; 151 | unsigned long prevReadTimeTwo; 152 | 153 | int readX(){ 154 | pinMode(yPin1, INPUT); 155 | pinMode(xPin2, OUTPUT); 156 | pinMode(yPin2, INPUT); 157 | pinMode(xPin1, OUTPUT); 158 | digitalWrite(xPin2, LOW); 159 | digitalWrite(xPin1, HIGH); 160 | return getSmooth(yPin1); 161 | } 162 | 163 | int readY(){ 164 | pinMode(yPin1, OUTPUT); 165 | pinMode(xPin2, INPUT); 166 | pinMode(yPin2, OUTPUT); 167 | pinMode(xPin1, INPUT); 168 | digitalWrite(yPin1, LOW); 169 | digitalWrite(yPin2, HIGH); 170 | return getSmooth(xPin2); 171 | } 172 | 173 | int getSmooth(int pin){ 174 | int vals[10]; //array that stores 10 readings. 175 | for(int i = 0; i < 10; i++){ 176 | vals[i] = analogRead(pin); //takes 10 readings. 177 | } 178 | float smooth = (vals[0] + vals[1] + vals[2] + vals[3] + vals[4] + vals[5] + vals[6] + vals[7] + vals[8] + vals[9]) / 10; 179 | return smooth; 180 | } 181 | 182 | int readMux(int channel){ 183 | int controlPin[] = {s0, s1, s2, s3}; 184 | 185 | int muxChannel[16][4]={ 186 | {0,0,0,0}, //channel 0 187 | {1,0,0,0}, //channel 1 188 | {0,1,0,0}, //channel 2 189 | {1,1,0,0}, //channel 3 190 | {0,0,1,0}, //channel 4 191 | {1,0,1,0}, //channel 5 192 | {0,1,1,0}, //channel 6 193 | {1,1,1,0}, //channel 7 194 | {0,0,0,1}, //channel 8 195 | {1,0,0,1}, //channel 9 196 | {0,1,0,1}, //channel 10 197 | {1,1,0,1}, //channel 11 198 | {0,0,1,1}, //channel 12 199 | {1,0,1,1}, //channel 13 200 | {0,1,1,1}, //channel 14 201 | {1,1,1,1} //channel 15 202 | }; 203 | 204 | //loop through the 4 sig 205 | for(int i = 0; i < 4; i ++){ 206 | digitalWrite(controlPin[i], muxChannel[channel][i]); 207 | } 208 | 209 | int val; 210 | val = analogRead(SIG_pin); 211 | 212 | return val; 213 | } 214 | 215 | void setup() { 216 | 217 | //Btns 218 | pinMode(0, INPUT_PULLUP); 219 | //LPBTNS 220 | pinMode(28,INPUT_PULLUP); 221 | pinMode(29,INPUT_PULLUP); 222 | pinMode(30,INPUT_PULLUP); 223 | pinMode(33,INPUT_PULLUP); 224 | pinMode(34,INPUT_PULLUP); 225 | pinMode(35,INPUT_PULLUP); 226 | pinMode(36,INPUT_PULLUP); 227 | pinMode(37,INPUT_PULLUP); 228 | 229 | //LCD Stuff 230 | tft.begin(); 231 | tft.setRotation(3); 232 | Serial.begin(9600); 233 | tft.fillScreen(ILI9341_BLACK); 234 | tft.setFont(Arial_14); 235 | //Pixels 236 | pixels.begin(); 237 | //Waiting for Serial Animation 238 | while (!Serial){ 239 | rainbowCycle(2); 240 | } 241 | //Initialize stuff 242 | tft.fillScreen(ILI9341_BLACK); 243 | drawLoopBtns(); 244 | drawInputToggle("left","0"); 245 | drawInputToggle("right","0"); 246 | drawPosition(0); 247 | drawBpm(00.00); 248 | 249 | //ENCODER STUFF 250 | pinMode(encoderPin1, INPUT); 251 | pinMode(encoderPin2, INPUT); 252 | digitalWrite(encoderPin1, HIGH); //turn pullup resistor on 253 | digitalWrite(encoderPin2, HIGH); //turn pullup resistor on 254 | //call updateEncoder() when any high/low changed seen 255 | //on interrupt 5 (pin 5), or interrupt 6 (pin 6) 256 | attachInterrupt(1, updateEncoder, CHANGE); 257 | attachInterrupt(2, updateEncoder, CHANGE); 258 | 259 | //MUX 260 | pinMode(s0, OUTPUT); 261 | pinMode(s1, OUTPUT); 262 | pinMode(s2, OUTPUT); 263 | pinMode(s3, OUTPUT); 264 | pinMode(SIG_pin, INPUT); 265 | 266 | digitalWrite(s0, LOW); 267 | digitalWrite(s1, LOW); 268 | digitalWrite(s2, LOW); 269 | digitalWrite(s3, LOW); 270 | 271 | //digitalBtns 272 | pinMode(7, INPUT_PULLUP); 273 | pinMode(8, INPUT_PULLUP); 274 | pinMode(24, INPUT_PULLUP); 275 | pinMode(25, INPUT_PULLUP); 276 | pinMode(26, INPUT_PULLUP); 277 | pinMode(27, INPUT_PULLUP); 278 | 279 | //drumPads 280 | setuppins(); 281 | } 282 | 283 | //Serial Read Vars 284 | bool serialStarted = false; 285 | bool serialEnded = false; 286 | char inData[80]; 287 | int serIndex; 288 | 289 | 290 | //Serial Write Vars 291 | const int num_of_digital_pins = 1; 292 | int digital_values[num_of_digital_pins]; 293 | 294 | 295 | ///SCREEN VARS for recall 296 | int playStatus; 297 | float bpmVal; 298 | int loopPosVal; 299 | int inputLeftActive; 300 | int inputRightActive; 301 | String Recstatus; 302 | int leftInputAmp; 303 | int rightInputAmp; 304 | int lpNumber; 305 | int lpStatus; 306 | int loopRec[8]; 307 | int loopMute[8]; 308 | bool ledBlinking[8] = {false}; 309 | int blinkBrightness; 310 | bool lpCurrentlyRec[8] = {false}; 311 | 312 | 313 | 314 | String songNames[52]; 315 | String songName; 316 | int lpOffset; 317 | int songIttr; 318 | int songSelIndex;; 319 | bool selectEvent = false; 320 | bool menu = false; 321 | int menuIndex; 322 | int menuSelPos[4] = {118,148,178,208}; 323 | bool songMode = false; 324 | bool newSongNameFlag = false; 325 | int charPosition; 326 | int charIndex; 327 | char charArray[52] = { 328 | 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', 329 | 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' 330 | }; 331 | char newSongCharArray[18]; 332 | int lpOffsetArray[8] = {20,80,140,200,20,80,140,200}; 333 | int lpOffsetVertArray[8] = {120,120,120,120,180,180,180,180}; 334 | uint32_t lcdColorArray[16] = { 335 | 0x033f,0x07f0,0xffa4,0xf8ea,0x033f,0x07f0,0xffa4,0xf8ea, 336 | 0x033f,0x07f0,0xffa4,0xf8ea,0x033f,0x07f0,0xffa4,0xf8ea 337 | }; 338 | //InstPads 339 | static void setuppins() 340 | { 341 | uint8_t i; 342 | // button columns 343 | for (i = 0; i < NUM_BTN_COLUMNS; i++) 344 | { 345 | pinMode(btncolumnpins[i], OUTPUT); 346 | // with nothing selected by default 347 | digitalWrite(btncolumnpins[i], HIGH); 348 | } 349 | // button row input lines 350 | for (i = 0; i < NUM_BTN_ROWS; i++) 351 | { 352 | pinMode(btnrowpins[i], INPUT_PULLUP); 353 | } 354 | // Initialize the debounce counter array 355 | for (uint8_t i = 0; i < NUM_BTN_COLUMNS; i++) 356 | { 357 | for (uint8_t j = 0; j < NUM_BTN_ROWS; j++) 358 | { 359 | debounce_count[i][j] = 0; 360 | } 361 | } 362 | } 363 | //InstPads 364 | static void scan() 365 | { 366 | static uint8_t current = 0; 367 | uint8_t val; 368 | uint8_t i, j; 369 | 370 | // Select current columns 371 | digitalWrite(btncolumnpins[current], LOW); 372 | 373 | // Read the button inputs 374 | for ( j = 0; j < NUM_BTN_ROWS; j++) 375 | { 376 | val = digitalRead(btnrowpins[j]); 377 | 378 | if (val == LOW) 379 | { 380 | // active low: val is low when btn is pressed 381 | if ( debounce_count[current][j] < MAX_DEBOUNCE) 382 | { 383 | debounce_count[current][j]++; 384 | if ( debounce_count[current][j] == MAX_DEBOUNCE ) 385 | { 386 | if(instSelectMode){ 387 | Serial.print("Inst: "); 388 | Serial.print((current * NUM_BTN_ROWS) + j); 389 | Serial.print(" "); 390 | Serial.println(0); 391 | instNumber = (current * NUM_BTN_ROWS) + j; 392 | drawInstrument(instNumber); 393 | }else{ 394 | Serial.print(drumStrings[(current * NUM_BTN_ROWS) + j]); 395 | Serial.print(1); 396 | Serial.print(" "); 397 | Serial.println(""); 398 | } 399 | // int btnNum = (13 - (current * NUM_BTN_ROWS) + j); 400 | // pixels.setPixelColor(btnNum+9,pixels.Color(255,0,50)); 401 | } 402 | } 403 | } 404 | else 405 | { 406 | // otherwise, button is released 407 | if ( debounce_count[current][j] > 0) 408 | { 409 | debounce_count[current][j]--; 410 | if ( debounce_count[current][j] == 0 ) 411 | { 412 | Serial.print(drumStrings[(current * NUM_BTN_ROWS) + j]); 413 | Serial.print(0); 414 | Serial.print(" "); 415 | Serial.println(""); 416 | // int btnNum = (13 - (current * NUM_BTN_ROWS) + j); 417 | // pixels.setPixelColor(btnNum+9,pixels.Color(0,0,0)); 418 | } 419 | } 420 | } 421 | }// for j = 0 to 3; 422 | 423 | digitalWrite(btncolumnpins[current], HIGH); 424 | 425 | current++; 426 | if (current >= NUM_BTN_COLUMNS) 427 | { 428 | current = 0; 429 | } 430 | 431 | } 432 | // ====================================================================================================================================// 433 | // ! Start Loop 434 | // ====================================================================================================================================// 435 | 436 | void loop(void) { 437 | while (!Serial){ 438 | rainbowCycle(2); 439 | } 440 | pixels.show(); 441 | //DrumBtns 442 | scan(); 443 | //Loop Btns 444 | for(int i=0; i<8; i++){ 445 | lpBtnState[i] = digitalRead(lpBtnPins[i]); 446 | if(lpBounce[i].update()){ 447 | if (lpBtnState[i] == LOW && lpPrevBtnState[i] == HIGH){ 448 | clearTimstamp = millis(); 449 | Serial.print(digitalStrings[i]); 450 | Serial.print(1); 451 | Serial.print(" "); 452 | Serial.println(0); 453 | } 454 | } 455 | if (lpBtnState[i] == LOW && lpPrevBtnState[i] == LOW){ 456 | if((millis() - clearTimstamp) > 1000 && (millis() - clearTimstamp) < 1200){ 457 | Serial.print("clearSingle: "); 458 | Serial.print(i+1); 459 | Serial.print(" "); 460 | Serial.println(""); 461 | clearTimstamp = millis(); 462 | } 463 | } 464 | lpPrevBtnState[i] = lpBtnState[i]; 465 | } 466 | readTimeTwo = millis(); 467 | //FX and Loop Volume 468 | for(int i = 0; i < 22; i ++){ 469 | if(i<16){ 470 | analogValues[i] = readMux(i); 471 | }else{ 472 | analogValues[i] = analogRead(i-15); 473 | } 474 | if (abs(analogValues[i] - analogValuesLag[i]) > 8){ 475 | if(readTimeTwo - prevReadTimeTwo > 5){ 476 | Serial.print(analogStrings[i]); 477 | Serial.print(analogValues[i]); 478 | Serial.print(" "); 479 | Serial.println(0); 480 | analogValuesLag[i] = analogValues[i]; 481 | prevReadTimeTwo = readTimeTwo; 482 | } 483 | } 484 | } 485 | 486 | //Btns 487 | if(inputOneBtn.update()){ 488 | if(inputOneBtn.fallingEdge()){ 489 | inputOneTog = !inputOneTog; 490 | Serial.print("InputOne: "); 491 | Serial.print(inputOneTog); 492 | Serial.print(" "); 493 | Serial.println(""); 494 | } 495 | } 496 | if(inputTwoBtn.update()){ 497 | if(inputTwoBtn.fallingEdge()){ 498 | inputTwoTog = !inputTwoTog; 499 | Serial.print("InputTwo: "); 500 | Serial.print(inputTwoTog); 501 | Serial.print(" "); 502 | Serial.println(""); 503 | } 504 | } 505 | if(clearBtn.update()){ 506 | if(clearBtn.fallingEdge()){ 507 | Serial.print("Clear: "); 508 | Serial.print(1); 509 | Serial.print(" "); 510 | Serial.println(""); 511 | } 512 | } 513 | if(playStopBtn.update()){ 514 | if(playStopBtn.fallingEdge()){ 515 | //playStop = !playStop; 516 | Serial.print("PlayStop: "); 517 | if(playStatus == 1){ 518 | Serial.print(0); 519 | }else{ 520 | Serial.print(1); 521 | } 522 | Serial.print(" "); 523 | Serial.println(""); 524 | } 525 | } 526 | //Instrument Selection 527 | if(instSelBtn.update()){ 528 | if(instSelBtn.fallingEdge()){ 529 | for(int i=0; i<16; i++){ 530 | pixels.setPixelColor(i+10, pixels.Color(0, 0, 0)); 531 | } 532 | drawInstrument(instNumber); 533 | instSelectMode = true; 534 | }else{ 535 | instSelectMode = false; 536 | returnToGui(songName); 537 | } 538 | } 539 | 540 | if(roboDrumBtn.update()){ 541 | if(roboDrumBtn.fallingEdge()){ 542 | Serial.print("RoboDrums: "); 543 | Serial.print(1); 544 | Serial.print(" "); 545 | Serial.println(""); 546 | }else{ 547 | Serial.print("RoboDrums: "); 548 | Serial.print(0); 549 | Serial.print(" "); 550 | Serial.println(""); 551 | } 552 | } 553 | 554 | //NDS_TOUCH 555 | //limit reads to 5ms 556 | readTime = millis(); 557 | touchX = readX(); 558 | touchY = readY(); 559 | 560 | if ((touchX < 900) && (touchY < 900)){ 561 | if(readTime - prevReadTime > 16){ 562 | Serial.print("Xval: "); 563 | Serial.print(touchX); 564 | Serial.print(" "); 565 | Serial.println(0); 566 | Serial.print("Yval: "); 567 | Serial.print(touchY); 568 | Serial.print(" "); 569 | Serial.println(0); 570 | fxTogOn = 1; 571 | fxTogOff = 0; 572 | prevReadTime = readTime; 573 | } 574 | }else{ 575 | if (abs(fxTogOn - fxTogOff) > 0){ 576 | Serial.print("postTog: "); 577 | Serial.print(0); 578 | Serial.print(" "); 579 | Serial.println(0); 580 | fxTogOff = fxTogOn; 581 | } 582 | } 583 | //NEOPIXELS 584 | //Drum Pad Pixels 585 | if(!instSelectMode){ 586 | 587 | if(instNumber>3){ 588 | if (instNumber == 4 || instNumber == 8 || instNumber == 12){ 589 | for(int i=0; i<16; i++){ 590 | pixels.setPixelColor(i+10, neoColorArray[0]); 591 | } 592 | }else if (instNumber == 5 || instNumber == 9 || instNumber == 13){ 593 | for(int i=0; i<16; i++){ 594 | pixels.setPixelColor(i+10, neoColorArray[1]); 595 | } 596 | }else if (instNumber == 6 || instNumber == 10 || instNumber == 14){ 597 | for(int i=0; i<16; i++){ 598 | pixels.setPixelColor(i+10, neoColorArray[2]); 599 | } 600 | }else{ 601 | for(int i=0; i<16; i++){ 602 | pixels.setPixelColor(i+10, neoColorArray[3]); 603 | } 604 | } 605 | }else{ 606 | pixels.setPixelColor(10, pixels.Color(0, 255, 0)); 607 | pixels.setPixelColor(11, pixels.Color(0, 255, 0)); 608 | pixels.setPixelColor(12, pixels.Color(0, 255, 0)); 609 | pixels.setPixelColor(18, pixels.Color(0, 255, 0)); 610 | pixels.setPixelColor(19, pixels.Color(0, 255, 0)); 611 | pixels.setPixelColor(20, pixels.Color(0, 255, 0)); 612 | 613 | pixels.setPixelColor(14, pixels.Color(0, 255, 255)); 614 | pixels.setPixelColor(15, pixels.Color(0, 255, 255)); 615 | pixels.setPixelColor(16, pixels.Color(0, 255, 255)); 616 | pixels.setPixelColor(22, pixels.Color(0, 255, 255)); 617 | pixels.setPixelColor(23, pixels.Color(0, 255, 255)); 618 | pixels.setPixelColor(24, pixels.Color(0, 255, 255)); 619 | 620 | pixels.setPixelColor(13, pixels.Color(255,0,50)); 621 | pixels.setPixelColor(17, pixels.Color(255,0,50)); 622 | pixels.setPixelColor(21, pixels.Color(255,0,50)); 623 | pixels.setPixelColor(25, pixels.Color(255,0,50)); 624 | 625 | //pixels.Color(255,0,50), 626 | 627 | } 628 | }else{ 629 | for(int i=0; i<16; i++){ 630 | pixels.setPixelColor(i+10, neoColorArray[i]); 631 | } 632 | if (instNumber < 4){ 633 | pixels.setPixelColor(instNumber+22, pixels.Color(blinkBrightness, blinkBrightness, blinkBrightness)); 634 | }else if(instNumber > 3 && instNumber < 8){ 635 | pixels.setPixelColor(instNumber+14, pixels.Color(blinkBrightness, blinkBrightness, blinkBrightness)); 636 | }else if (instNumber > 7 && instNumber < 12){ 637 | pixels.setPixelColor(instNumber+6, pixels.Color(blinkBrightness, blinkBrightness, blinkBrightness)); 638 | }else if(instNumber > 11){ 639 | pixels.setPixelColor(instNumber-2, pixels.Color(blinkBrightness, blinkBrightness, blinkBrightness)); 640 | } 641 | } 642 | //Loop Pad Pixes 643 | blinkBrightness = 128+127*cos(2*PI/500*readTime); 644 | 645 | for(int i=0; i<8; i++){ 646 | if(loopMute[i] == 1){ 647 | if(!ledBlinking[i]){ 648 | pixels.setPixelColor(i+2, neoColorArray[i]); 649 | }else{ 650 | if(lpCurrentlyRec[i]){ 651 | pixels.setPixelColor(i+2, pixels.Color(blinkBrightness, 0, 0)); 652 | }else{ 653 | pixels.setPixelColor(i+2, pixels.Color(blinkBrightness, blinkBrightness, 0)); 654 | } 655 | } 656 | }else{ 657 | if(!ledBlinking[i]){ 658 | if(loopRec[i]){ 659 | pixels.setPixelColor(i+2, neoColorArrayDim[i]); 660 | }else{ 661 | pixels.setPixelColor(i+2, neoColorOff); 662 | } 663 | }else{ 664 | if(lpCurrentlyRec[i]){ 665 | pixels.setPixelColor(i+2, pixels.Color(blinkBrightness, 0, 0)); 666 | }else{ 667 | pixels.setPixelColor(i+2, pixels.Color(blinkBrightness, blinkBrightness, 0)); 668 | } 669 | } 670 | } 671 | } 672 | //Encode Menu 673 | encBtnStatus = digitalRead(0); 674 | if(encBtn.update()){ 675 | if (encBtnStatus == LOW && encPrevBtnStatus == HIGH){ 676 | encHold = millis(); 677 | songMode = true; 678 | 679 | if(songMode){ 680 | if(!selectEvent && !menu && !newSongNameFlag){ 681 | //Query folders for song names (Shell) 682 | tft.fillScreen(ILI9341_BLACK); 683 | Serial.print("Select_Song: "); 684 | Serial.print(1); 685 | Serial.print(" "); 686 | Serial.println(0); 687 | drawSongSelection(songSelIndex); 688 | selectEvent = true; 689 | }else if(!menu && !newSongNameFlag){ 690 | //Load Menu 691 | menu = true; 692 | tft.fillRect(10,menuSelPos[menuIndex],200,20,0x31a6); 693 | drawMenu(); 694 | }else if(menuIndex == 0 && !newSongNameFlag){ 695 | //Cancel 696 | returnToGui(songName); 697 | }else if (menuIndex == 1 && !newSongNameFlag){ 698 | //Load Song 699 | Serial.print("Clear_Song: "); 700 | Serial.print(1); 701 | Serial.print(" "); 702 | Serial.println(0); 703 | 704 | Serial.print("Load_Song: "); 705 | Serial.print(1); 706 | Serial.print(" "); 707 | Serial.println(0); 708 | returnToGui(songNames[songSelIndex]); 709 | }else if (menuIndex == 2 && !newSongNameFlag){ 710 | if(songNames[songSelIndex].length() == 0){ 711 | //create new song name 712 | newSongNameFlag = true; 713 | drawCharacter(charIndex); 714 | }else{ 715 | //overwrite 716 | //delete directory first 717 | Serial.print("Delete_Song: "); 718 | Serial.print(songNames[songSelIndex]); 719 | Serial.print(" "); 720 | Serial.println(0); 721 | //recreate directory 722 | Serial.print("New_Song: "); 723 | Serial.print(songNames[songSelIndex]); 724 | Serial.print(" "); 725 | Serial.println(0); 726 | //then save 727 | Serial.print("Save_Song: "); 728 | Serial.print(1); 729 | Serial.print(" "); 730 | Serial.println(0); 731 | returnToGui(songNames[songSelIndex]); 732 | } 733 | }else if (menuIndex == 3 && !newSongNameFlag){ 734 | //delete song 735 | Serial.print("Delete_Song: "); 736 | Serial.print(songNames[songSelIndex]); 737 | Serial.print(" "); 738 | Serial.println(0); 739 | returnToGui(songName); 740 | }else if (newSongNameFlag){ 741 | //new Song Name Character Skip 742 | charPosition++; 743 | if(charPosition > 17){ 744 | charPosition = 0; 745 | } 746 | tft.fillRect(0,70,320,4,ILI9341_BLACK); 747 | tft.fillRect(50+(charPosition*12),70,10,4,0xffa4); 748 | } 749 | } 750 | } 751 | } 752 | //Hold save for new song 753 | if (encBtnStatus == LOW && encPrevBtnStatus == LOW){ 754 | if((millis() - encHold) > 2000 && newSongNameFlag){ 755 | String newSongNameString = String(newSongCharArray); 756 | //create new directory 757 | Serial.print("New_Song: "); 758 | Serial.print(newSongNameString); 759 | Serial.print(" "); 760 | Serial.println(0); 761 | //then save 762 | Serial.print("Save_Song: "); 763 | Serial.print(1); 764 | Serial.print(" "); 765 | Serial.println(0); 766 | returnToGui(newSongNameString); 767 | encHold = millis(); 768 | } 769 | } 770 | 771 | encPrevBtnStatus = encBtnStatus; 772 | 773 | //Select Song/Character with Encoder 774 | if(songMode){ 775 | scaledEncVal = encoderValue; 776 | if (abs(scaledEncVal - prevScaledEncVal) > 3){ 777 | 778 | if(menu && !newSongNameFlag){ 779 | menuIndex = scaledEncVal/4; 780 | if(menuIndex > 3){ 781 | encoderValue = 0; 782 | } 783 | if(menuIndex<4){ 784 | tft.fillRect(0,118,320,120,ILI9341_BLACK); 785 | tft.fillRect(10,menuSelPos[menuIndex],200,20,0x31a6); 786 | drawMenu(); 787 | } 788 | }else if(!newSongNameFlag){ 789 | songSelIndex = scaledEncVal/4; 790 | if(songSelIndex == 52){ 791 | songSelIndex = 0; 792 | } 793 | drawSongSelection(songSelIndex); 794 | if(songNames[songSelIndex].length() > 0){ 795 | Serial.print("Song_Name: "); 796 | Serial.print(songNames[songSelIndex]); 797 | Serial.print(" "); 798 | Serial.println(0); 799 | } 800 | }else if(newSongNameFlag){ 801 | charIndex = scaledEncVal/4; 802 | if(charIndex == 52){ 803 | charIndex = 0; 804 | } 805 | drawCharacter(charIndex); 806 | } 807 | prevScaledEncVal = scaledEncVal; 808 | } 809 | } 810 | //Read Serial 811 | while(Serial.available() > 0) 812 | { 813 | char c = Serial.read(); 814 | if(c=='-'){ 815 | serIndex = 0; 816 | inData[serIndex] = '\0'; 817 | serialStarted = true; 818 | }else if(c=='/'){ 819 | serialEnded = true; 820 | break; 821 | }else{ 822 | if(serIndex < 79){ 823 | inData[serIndex] = c; 824 | serIndex++; 825 | inData[serIndex] = '\0'; 826 | } 827 | } 828 | } 829 | //Process Serial Package 830 | if(serialStarted && serialEnded){ 831 | 832 | String PrintString = String(inData); 833 | 834 | int commaIndex = PrintString.indexOf('_'); 835 | int secondCommaIndex = PrintString.indexOf('_', commaIndex+1); 836 | int thirdCommaIndex = PrintString.indexOf('_', secondCommaIndex+1); 837 | 838 | 839 | String part1 = PrintString.substring(0, commaIndex); 840 | String part2 = PrintString.substring(commaIndex+1, secondCommaIndex); 841 | String part3 = PrintString.substring(secondCommaIndex+1, thirdCommaIndex); 842 | 843 | //testTEXT 844 | //debugMessage(part1, part2, part3); 845 | 846 | if (part1.equals("bpm")) { 847 | bpmVal = part2.toFloat(); 848 | if(!songMode && !instSelectMode) drawBpm(bpmVal); 849 | }else if (part1.equals("pos")){ 850 | loopPosVal = part2.toInt(); 851 | if(!songMode && !instSelectMode) drawPosition(loopPosVal); 852 | }else if (part1.equals("inp")){ 853 | if(part2.equals("left")){ 854 | inputLeftActive = part3.toInt(); 855 | }else{ 856 | inputRightActive = part3.toInt(); 857 | } 858 | if(!songMode && !instSelectMode) drawInputToggle(part2, part3); 859 | }else if (part1.equals("sta")){ 860 | Recstatus = part2; 861 | if(Recstatus.equals("r")){ 862 | ledBlinking[part3.toInt()-1] = true; 863 | lpCurrentlyRec[part3.toInt()-1] = true; 864 | }else if(Recstatus.equals("p")){ 865 | ledBlinking[part3.toInt()-1] = true; 866 | lpCurrentlyRec[part3.toInt()-1] = false; 867 | }else{ 868 | ledBlinking[part3.toInt()-1] = false; 869 | } 870 | if(!songMode && !instSelectMode) drawStatus(Recstatus); 871 | }else if (part1.equals("mut")){ 872 | lpNumber = part2.toInt(); 873 | lpStatus = part3.toInt(); 874 | loopMute[lpNumber-1] = lpStatus; 875 | if(!songMode && !instSelectMode) drawMute(lpNumber, lpStatus); 876 | }else if(part1.equals("wav")){ 877 | lpNumber = part2.toInt(); 878 | lpStatus = part3.toInt(); 879 | loopRec[lpNumber-1] = lpStatus; 880 | if(!songMode && !instSelectMode) drawWav(lpNumber, lpStatus); 881 | }else if (part1.equals("amp")){ 882 | if(part2.equals("left")){ 883 | leftInputAmp = part3.toInt()*1.6; 884 | if(!songMode && !instSelectMode) drawAmp("left",leftInputAmp); 885 | }else if (part2.equals("right")){ 886 | rightInputAmp = part3.toInt()*1.6; 887 | if(!songMode && !instSelectMode) drawAmp("right",rightInputAmp); 888 | }else{ 889 | extraNeoPixels(part3.toInt()); 890 | } 891 | }else if (part1.equals("sng")){ 892 | if(songIttr==0){ 893 | for(int i=0; i<52; i++){ 894 | songNames[i] = ""; 895 | } 896 | } 897 | songNames[songIttr] = part2; 898 | songIttr++; 899 | }else if(part1.equals("sgn")){ 900 | songName = part2; 901 | drawSongName(part2); 902 | }else if(part1.equals("ply")){ 903 | playStatus = part2.toInt(); 904 | } 905 | 906 | serialStarted = false; 907 | serialEnded = false; 908 | serIndex = 0; 909 | for(int i=0; i<80; i++){ 910 | inData[i] = '\0'; 911 | } 912 | } 913 | } 914 | 915 | void drawBpm(String newBpm){ 916 | tft.fillRect(20, 30, 140, 30, ILI9341_BLACK); 917 | tft.setTextColor(0x033f); 918 | tft.setCursor(20, 30); 919 | tft.print("BPM:"); 920 | tft.setCursor(70, 30); 921 | tft.setTextColor(ILI9341_WHITE); 922 | tft.print(newBpm); 923 | } 924 | void drawPosition(int position){ 925 | if(position == 0){ 926 | tft.fillRect(0, 1, 320, 20, ILI9341_BLACK); 927 | } 928 | tft.fillRect(20*position+1, 1, 18, 20, ILI9341_BLACK); 929 | if(Recstatus.equals("r")){ 930 | tft.fillRect(20*position+1, 1, 18, 20, 0xf8ea); 931 | }else if(Recstatus.equals("p")){ 932 | tft.fillRect(20*position+1, 1, 18, 20, 0xffa4); 933 | }else{ 934 | tft.fillRect(20*position+1, 1, 18, 20, 0x07f0); 935 | } 936 | tft.setCursor(160,30); 937 | tft.setTextColor(ILI9341_WHITE); 938 | 939 | if(position==0){ 940 | tft.fillRect(160, 30, 20, 30, ILI9341_BLACK); 941 | tft.print("1."); 942 | }else if(position == 4){ 943 | tft.fillRect(160, 30, 20, 30, ILI9341_BLACK); 944 | tft.print("2."); 945 | }else if(position == 8){ 946 | tft.fillRect(160, 30, 20, 30, ILI9341_BLACK); 947 | tft.print("3."); 948 | }else if(position == 12){ 949 | tft.fillRect(160, 30, 20, 30, ILI9341_BLACK); 950 | tft.print("4."); 951 | } 952 | tft.fillRect(180, 30, 20, 30, ILI9341_BLACK); 953 | tft.setCursor(180,30); 954 | tft.setTextColor(0x07f0); 955 | tft.print((position%4)+1); 956 | pixels.setPixelColor(0, neoColorArray[position%4]); 957 | pixels.setPixelColor(1, neoColorArray[position%4]); 958 | } 959 | void drawInputToggle(String input, String onOff){ 960 | if(input.equals("left")){ 961 | if(onOff.equals('1')){ 962 | tft.fillCircle(275, 40, 10, ILI9341_WHITE); 963 | }else{ 964 | tft.fillCircle(275, 40, 10, ILI9341_BLACK); 965 | tft.drawCircle(275, 40, 10, ILI9341_WHITE); 966 | } 967 | }else{ 968 | if(onOff.equals('1')){ 969 | tft.fillCircle(305, 40, 10, 0xf8ea); 970 | }else{ 971 | tft.fillCircle(305, 40, 10, ILI9341_BLACK); 972 | tft.drawCircle(305, 40, 10, 0xf8ea); 973 | } 974 | } 975 | } 976 | void drawStatus(String status){ 977 | tft.fillRect(20, 90, 100, 30, ILI9341_BLACK); 978 | tft.setCursor(20, 90); 979 | if(status.equals("r")){ 980 | tft.setTextColor(0xf8ea); 981 | tft.print("Recording"); 982 | }else if(status.equals("p")){ 983 | tft.setTextColor(0xffa4); 984 | tft.print("Pending"); 985 | } 986 | } 987 | // void ledBlink(String status, int lpNumber){ 988 | 989 | 990 | // if(status.equals("r")){ 991 | // pixels.setPixelColor(lpNumber+1, pixels.Color(value, 0, 0)); 992 | // }else if(status.equals("p")){ 993 | // pixels.setPixelColor(lpNumber+1, pixels.Color(255, value, 0)); 994 | // } 995 | // } 996 | 997 | void drawMute(int loopNum, int loopStatus){ 998 | tft.fillRoundRect(lpOffsetArray[loopNum-1], lpOffsetVertArray[loopNum-1], 50, 50, 3, ILI9341_BLACK); 999 | if(loopStatus == 1){ 1000 | tft.fillRoundRect(lpOffsetArray[loopNum-1], lpOffsetVertArray[loopNum-1], 50, 50, 3, lcdColorArray[loopNum-1]); 1001 | }else{ 1002 | tft.drawRoundRect(lpOffsetArray[loopNum-1], lpOffsetVertArray[loopNum-1], 50, 50, 3, lcdColorArray[loopNum-1]); 1003 | } 1004 | drawWav(loopNum, loopRec[loopNum-1]); 1005 | } 1006 | void drawWav(int loopNum, int loopStatus){ 1007 | if(loopNum< 5){ 1008 | if(loopNum == 1){ 1009 | lpOffset = 0; 1010 | }else{ 1011 | lpOffset = 16*(loopNum-1); 1012 | } 1013 | tft.fillCircle((44*loopNum)+lpOffset, 144, 14, ILI9341_BLACK); 1014 | if(loopStatus == 1){ 1015 | tft.fillCircle((44*loopNum)+lpOffset, 144, 14, 0x31a6); 1016 | tft.fillCircle((44*loopNum)+lpOffset, 144, 10, ILI9341_WHITE); 1017 | } 1018 | }else{ 1019 | loopNum = loopNum-4; 1020 | if(loopNum == 1){ 1021 | lpOffset = 0; 1022 | }else{ 1023 | lpOffset = 16*(loopNum-1); 1024 | } 1025 | tft.fillCircle((44*loopNum)+lpOffset, 204, 14, ILI9341_BLACK); 1026 | if(loopStatus == 1){ 1027 | tft.fillCircle((44*loopNum)+lpOffset, 204, 14, 0x31a6); 1028 | tft.fillCircle((44*loopNum)+lpOffset, 204, 10, ILI9341_WHITE); 1029 | } 1030 | } 1031 | } 1032 | void drawAmp(String input, int ampVal){ 1033 | if(input.equals("left")){ 1034 | tft.fillRect(265, 230 - ampVal, 20, ampVal, ILI9341_WHITE); 1035 | tft.fillRect(265, 230 - 160, 20, 160 - ampVal, ILI9341_BLACK); 1036 | }else{ 1037 | tft.fillRect(295, 230 - ampVal, 20, ampVal, 0xf8ea); 1038 | tft.fillRect(295, 230 - 160, 20, 160 - ampVal, ILI9341_BLACK); 1039 | } 1040 | } 1041 | void drawLoopBtns(){ 1042 | tft.drawRoundRect(20, 120, 50, 50, 3, 0x033f); 1043 | tft.drawRoundRect(80, 120, 50, 50, 3, 0x07f0); 1044 | tft.drawRoundRect(140, 120, 50, 50, 3, 0xffa4); 1045 | tft.drawRoundRect(200, 120, 50, 50, 3, 0xf8ea); 1046 | tft.drawRoundRect(20, 180, 50, 50, 3, 0x033f); 1047 | tft.drawRoundRect(80, 180, 50, 50, 3, 0x07f0); 1048 | tft.drawRoundRect(140, 180, 50, 50, 3, 0xffa4); 1049 | tft.drawRoundRect(200, 180, 50, 50, 3, 0xf8ea); 1050 | } 1051 | void drawSongName(String songName){ 1052 | tft.fillRect(20, 60, 240, 30, ILI9341_BLACK); 1053 | tft.setCursor(20,60); 1054 | if(songName.equals("Saving...")){ 1055 | tft.setTextColor(0xf8ea); 1056 | }else{ 1057 | tft.setTextColor(0x07f0); 1058 | } 1059 | tft.print(songName); 1060 | } 1061 | void returnToGui(String songName){ 1062 | tft.fillScreen(ILI9341_BLACK); 1063 | drawSongName(songName); 1064 | drawLoopBtns(); 1065 | for(int i=0; i<8; i++){ 1066 | drawWav(i+1,loopRec[i]); 1067 | drawMute(i+1,loopMute[i]); 1068 | } 1069 | drawInputToggle("left",inputLeftActive); 1070 | drawInputToggle("right",inputRightActive); 1071 | drawPosition(0); 1072 | drawPosition(loopPosVal); 1073 | drawBpm(bpmVal); 1074 | for(int i=0; i<18; i++){ 1075 | newSongCharArray[i] = (char)0; 1076 | } 1077 | selectEvent = false; 1078 | songIttr = 0; 1079 | charPosition = 0; 1080 | songMode = false; 1081 | newSongNameFlag = false; 1082 | menu = false; 1083 | } 1084 | void drawSongSelection(int songIndex){ 1085 | tft.fillRect(0,20,320,30,ILI9341_BLACK); 1086 | tft.setCursor(20,20); 1087 | tft.setTextColor(ILI9341_WHITE); 1088 | tft.print("Save // Load Song"); 1089 | tft.fillRect(20,50,320,30,ILI9341_BLACK); 1090 | tft.setCursor(20, 50); 1091 | tft.setTextColor(ILI9341_WHITE); 1092 | tft.print(songIndex+1); 1093 | tft.setCursor(50, 50); 1094 | tft.setTextColor(0x07f0); 1095 | tft.print(songNames[songIndex]); 1096 | } 1097 | 1098 | void drawCharacter(int index){ 1099 | tft.fillRect(0,70,320,4,ILI9341_BLACK); 1100 | tft.fillRect(50+(charPosition*12),70,10,4,0xffa4); 1101 | tft.drawChar(50+(charPosition*12), 50, charArray[index], ILI9341_WHITE,ILI9341_BLACK,2); 1102 | //store character into what will be new song name string 1103 | newSongCharArray[charPosition] = charArray[index]; 1104 | } 1105 | void drawMenu(){ 1106 | tft.setTextColor(0xffa4); 1107 | tft.setCursor(20,120); 1108 | tft.print("Cancel"); 1109 | tft.setTextColor(0x07f0); 1110 | tft.setCursor(20,150); 1111 | tft.print("Load"); 1112 | tft.setTextColor(0xf8ea); 1113 | tft.setCursor(20,180); 1114 | tft.print("Save / Overwrite"); 1115 | tft.setTextColor(0x033f); 1116 | tft.setCursor(20,210); 1117 | tft.print("Delete"); 1118 | } 1119 | void drawInstrument(int instNum){ 1120 | tft.fillScreen(ILI9341_BLACK); 1121 | if(instNum > 3){ 1122 | //Draw Keys 1123 | tft.fillRect(50,70,220,160,lcdColorArray[instNum]); 1124 | for(int i=0; i<7; i++){ 1125 | tft.fillRect((i*30)+60,120,20,100,ILI9341_WHITE); 1126 | } 1127 | for(int i=0; i<6; i++){ 1128 | tft.fillRect((i*30)+75,120,20,50,ILI9341_BLACK); 1129 | if(i<4){ 1130 | tft.fillCircle((i*30)+70,90,10,ILI9341_WHITE); 1131 | } 1132 | } 1133 | }else if(instNum <4){ 1134 | //Draw Drums 1135 | tft.fillRect(50,70,220,160,lcdColorArray[instNum]); 1136 | for(int i=0; i<4; i++){ 1137 | tft.fillRect((i*50)+60,130,40,40,ILI9341_WHITE); 1138 | } 1139 | for(int i=0; i<4; i++){ 1140 | tft.fillRect((i*50)+60,180,40,40,ILI9341_WHITE); 1141 | } 1142 | for(int i=0; i<4; i++){ 1143 | tft.fillCircle((i*30)+70,90,10,ILI9341_WHITE); 1144 | } 1145 | tft.fillRect(180,80,80,20,ILI9341_WHITE); 1146 | } 1147 | tft.setCursor(50,20); 1148 | if(instNum>7){ 1149 | tft.setTextColor(lcdColorArray[instNum]); 1150 | tft.print(instName[instNum]); 1151 | }else{ 1152 | tft.setTextColor(lcdColorArray[instNum]); 1153 | tft.print(instName[instNum]); 1154 | } 1155 | } 1156 | void debugMessage(String pt1, String pt2, String pt3){ 1157 | tft.fillRect(0, 100, 320, 240, 0x033f); 1158 | tft.setCursor(40, 120); 1159 | tft.setTextColor(ILI9341_WHITE); 1160 | tft.print(pt1); 1161 | tft.setCursor(40, 140); 1162 | tft.print(pt2); 1163 | tft.setCursor(40, 160); 1164 | tft.print(pt3); 1165 | } 1166 | void updateEncoder(){ 1167 | int MSB = digitalRead(encoderPin1); //MSB = most significant bit 1168 | int LSB = digitalRead(encoderPin2); //LSB = least significant bit 1169 | 1170 | int encoded = (MSB << 1) |LSB; //converting the 2 pin value to single number 1171 | int sum = (lastEncoded << 2) | encoded; //adding it to the previous encoded value 1172 | 1173 | if(sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011) encoderValue ++; 1174 | if(sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000) encoderValue --; 1175 | if(encoderValue > 208){ 1176 | encoderValue = 208; 1177 | }else if (encoderValue < 0){ 1178 | encoderValue = 0; 1179 | } 1180 | 1181 | lastEncoded = encoded; //store this value for next time 1182 | } 1183 | void extraNeoPixels(int amp){ 1184 | int ampOne = map(amp, 0, 100, 0, 30); 1185 | for (int i = 0; i < 30; ++i){ 1186 | if (i 0; 6 | #X obj 198 181 == 0; 7 | #X obj 159 201 spigot; 8 | #X obj 99 272 sel 1; 9 | #X obj 42 292 spigot; 10 | #X obj 42 81 inlet; 11 | #X obj 99 330 outlet; 12 | #X obj 42 330 outlet; 13 | #X obj 99 250 > \$1; 14 | #X connect 0 0 3 0; 15 | #X connect 1 0 2 0; 16 | #X connect 2 0 11 0; 17 | #X connect 3 0 4 0; 18 | #X connect 3 0 1 1; 19 | #X connect 3 0 7 1; 20 | #X connect 4 0 5 1; 21 | #X connect 5 0 2 1; 22 | #X connect 6 0 9 0; 23 | #X connect 7 0 10 0; 24 | #X connect 8 0 1 0; 25 | #X connect 8 0 5 0; 26 | #X connect 8 0 7 0; 27 | #X connect 11 0 6 0; 28 | -------------------------------------------------------------------------------- /piLooper/fmVoice.pd: -------------------------------------------------------------------------------- 1 | #N canvas 66 89 1281 690 10; 2 | #X obj 275 283 osc~; 3 | #X obj 260 347 +~; 4 | #X obj 260 371 osc~; 5 | #X obj 13 6 inlet; 6 | #X obj 521 660 outlet~; 7 | #X obj 13 41 unpack 0 0; 8 | #X obj 521 630 *~; 9 | #X obj 536 585 vline~; 10 | #X obj 730 517 \$1; 11 | #X obj 275 308 *~ 1000; 12 | #X obj 151 120 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 13 | -1 -1; 14 | #X obj 74 120 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 15 | -1; 16 | #X floatatom 74 68 5 0 0 0 - - -, f 5; 17 | #X obj 74 90 sel 1 0; 18 | #X obj 275 221 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 19 | -1 -1; 20 | #X floatatom 315 219 5 0 0 0 - - -, f 5; 21 | #X obj 275 250 * 1, f 5; 22 | #X obj 302 158 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 23 | -1 -1; 24 | #X obj 13 67 s freq-\$1; 25 | #X obj 188 182 r freq-\$1; 26 | #X obj 151 143 s noteOff-\$1; 27 | #X obj 74 143 s noteOn-\$1; 28 | #X obj 730 466 r noteOff-\$1; 29 | #X obj 536 409 r noteOn-\$1; 30 | #N canvas 791 321 215 479 Mod_ADSR_1 0; 31 | #X obj 39 365 \$1; 32 | #X obj 16 428 line, f 13; 33 | #X obj 16 78 pack \$1 \$2 \$3; 34 | #X msg 16 101 \$2 \$3; 35 | #X obj 53 31 r fmOpOneAmt; 36 | #X obj 91 53 r fmOpOneAttack; 37 | #X obj 54 341 r fmOpOneRelease; 38 | #X obj 16 10 r noteOn-\$1; 39 | #X obj 39 320 r noteOff-\$1; 40 | #X msg 39 392 0 \$1; 41 | #X obj 32 142 r noteOn-\$1; 42 | #X obj 32 186 delay 1; 43 | #X obj 107 234 r fmOpOneDecay; 44 | #X obj 71 164 r fmOpOneAttack; 45 | #X obj 32 211 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 46 | -1; 47 | #X obj 69 213 r fmOpOneSustain; 48 | #X obj 32 256 pack \$1 \$2 \$3; 49 | #X msg 32 280 \$2 \$3; 50 | #X obj 16 451 outlet; 51 | #X connect 0 0 9 0; 52 | #X connect 1 0 18 0; 53 | #X connect 2 0 3 0; 54 | #X connect 3 0 1 0; 55 | #X connect 4 0 2 1; 56 | #X connect 5 0 2 2; 57 | #X connect 6 0 0 1; 58 | #X connect 7 0 2 0; 59 | #X connect 8 0 0 0; 60 | #X connect 9 0 1 0; 61 | #X connect 10 0 11 0; 62 | #X connect 11 0 14 0; 63 | #X connect 12 0 16 2; 64 | #X connect 13 0 11 1; 65 | #X connect 14 0 16 0; 66 | #X connect 15 0 16 1; 67 | #X connect 16 0 17 0; 68 | #X connect 17 0 1 0; 69 | #X restore 314 284 pd Mod_ADSR_1; 70 | #X obj 567 434 r envAttack; 71 | #X obj 598 454 r envDecay; 72 | #X obj 629 474 r envSustain; 73 | #X obj 745 492 r envRelease; 74 | #X msg 730 540 0 \$1; 75 | #X obj 485 276 osc~; 76 | #X obj 470 347 +~; 77 | #X obj 470 371 osc~; 78 | #X obj 485 308 *~ 1000; 79 | #X obj 485 221 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 80 | -1 -1; 81 | #X floatatom 525 219 5 0 0 0 - - -, f 5; 82 | #X obj 485 250 * 1, f 5; 83 | #X obj 512 189 * 1; 84 | #X obj 512 158 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 85 | -1 -1; 86 | #X obj 414 182 r freq-\$1; 87 | #N canvas 791 321 215 479 Mod_ADSR_1 0; 88 | #X obj 39 365 \$1; 89 | #X obj 16 428 line, f 13; 90 | #X obj 16 78 pack \$1 \$2 \$3; 91 | #X msg 16 101 \$2 \$3; 92 | #X obj 16 10 r noteOn-\$1; 93 | #X obj 39 320 r noteOff-\$1; 94 | #X msg 39 392 0 \$1; 95 | #X obj 32 142 r noteOn-\$1; 96 | #X obj 32 186 delay 1; 97 | #X obj 32 211 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 98 | -1; 99 | #X obj 32 256 pack \$1 \$2 \$3; 100 | #X msg 32 280 \$2 \$3; 101 | #X obj 16 451 outlet; 102 | #X obj 53 31 r fmOpTwoAmt; 103 | #X obj 91 53 r fmOpTwoAttack; 104 | #X obj 71 164 r fmOpTwoAttack; 105 | #X obj 69 213 r fmOpTwoSustain; 106 | #X obj 107 234 r fmOpTwoDecay; 107 | #X obj 54 341 r fmOpTwoRelease; 108 | #X connect 0 0 6 0; 109 | #X connect 1 0 12 0; 110 | #X connect 2 0 3 0; 111 | #X connect 3 0 1 0; 112 | #X connect 4 0 2 0; 113 | #X connect 5 0 0 0; 114 | #X connect 6 0 1 0; 115 | #X connect 7 0 8 0; 116 | #X connect 8 0 9 0; 117 | #X connect 9 0 10 0; 118 | #X connect 10 0 11 0; 119 | #X connect 11 0 1 0; 120 | #X connect 13 0 2 1; 121 | #X connect 14 0 2 2; 122 | #X connect 15 0 8 1; 123 | #X connect 16 0 10 1; 124 | #X connect 17 0 10 2; 125 | #X connect 18 0 0 1; 126 | #X restore 524 277 pd Mod_ADSR_1; 127 | #X obj 485 69 r fmOpTwoPitch; 128 | #X obj 814 314 vsl 15 50 0.5 1.1 0 0 empty empty empty 0 -9 0 10 -262144 129 | -1 -1 4134 1; 130 | #X obj 817 87 hsl 128 15 0 10 0 0 empty empty empty -2 -8 0 10 -262144 131 | -1 -1 7100 1; 132 | #X obj 814 233 *~ 0.5, f 11; 133 | #X obj 877 172 vsl 15 50 0 0.05 0 0 empty empty empty 0 -9 0 10 -262144 134 | -1 -1 617 1; 135 | #X obj 814 257 snapshot~; 136 | #X text 894 199 LFO Ammount 0-1; 137 | #X text 824 29 lfo one; 138 | #X text 890 56 LFO FREQ 0-10; 139 | #X obj 877 146 r lfoOneAmt; 140 | #X obj 814 55 r lfoOneFreq; 141 | #X obj 814 123 osc~ 0.05; 142 | #X obj 759 189 r snap; 143 | #X obj 814 281 + 1; 144 | #X floatatom 896 383 5 0 0 0 - - -, f 5; 145 | #X obj 302 189 * 1; 146 | #X obj 275 69 r fmOpOnePitch; 147 | #X obj 322 122 r lfoOne-\$1; 148 | #X obj 814 381 s lfoOne-\$1; 149 | #X obj 1064 314 vsl 15 50 0.5 1.1 0 0 empty empty empty 0 -9 0 10 -262144 150 | -1 -1 4163 1; 151 | #X obj 1067 87 hsl 128 15 0 10 0 0 empty empty empty -2 -8 0 10 -262144 152 | -1 -1 7500 1; 153 | #X obj 1064 233 *~ 0.5, f 11; 154 | #X obj 1127 172 vsl 15 50 0 0.05 0 0 empty empty empty 0 -9 0 10 -262144 155 | -1 -1 1042 1; 156 | #X obj 1064 257 snapshot~; 157 | #X text 1144 199 LFO Ammount 0-1; 158 | #X text 1074 29 lfo one; 159 | #X text 1140 56 LFO FREQ 0-10; 160 | #X obj 1064 123 osc~ 0.05; 161 | #X obj 1009 189 r snap; 162 | #X obj 1064 281 + 1; 163 | #X floatatom 1146 383 5 0 0 0 - - -, f 5; 164 | #X obj 1064 55 r lfoTwoFreq; 165 | #X obj 1127 146 r lfoTwoAmt; 166 | #X obj 1064 381 s lfoTwo-\$1; 167 | #X obj 530 113 r lfoTwo-\$1; 168 | #X obj 394 357 *~; 169 | #X obj 412 274 r crossMod; 170 | #X obj 623 361 r envAttackLev; 171 | #X obj 536 499 pack \$1 \$2 \$3 \$4 \$5; 172 | #X msg 536 537 \$2 \$3 \, \$5 \$4 \$3; 173 | #X connect 0 0 9 0; 174 | #X connect 1 0 2 0; 175 | #X connect 2 0 6 0; 176 | #X connect 3 0 5 0; 177 | #X connect 5 0 18 0; 178 | #X connect 5 1 12 0; 179 | #X connect 6 0 4 0; 180 | #X connect 7 0 6 1; 181 | #X connect 8 0 29 0; 182 | #X connect 9 0 1 1; 183 | #X connect 9 0 76 0; 184 | #X connect 10 0 20 0; 185 | #X connect 11 0 21 0; 186 | #X connect 12 0 13 0; 187 | #X connect 13 0 11 0; 188 | #X connect 13 1 10 0; 189 | #X connect 14 0 16 0; 190 | #X connect 16 0 0 0; 191 | #X connect 17 0 56 0; 192 | #X connect 19 0 16 0; 193 | #X connect 19 0 1 0; 194 | #X connect 22 0 8 0; 195 | #X connect 23 0 79 0; 196 | #X connect 24 0 9 1; 197 | #X connect 25 0 79 2; 198 | #X connect 26 0 79 3; 199 | #X connect 27 0 79 4; 200 | #X connect 28 0 8 1; 201 | #X connect 29 0 7 0; 202 | #X connect 30 0 33 0; 203 | #X connect 31 0 32 0; 204 | #X connect 32 0 6 0; 205 | #X connect 32 0 76 0; 206 | #X connect 33 0 31 1; 207 | #X connect 34 0 36 0; 208 | #X connect 36 0 30 0; 209 | #X connect 37 0 36 1; 210 | #X connect 37 0 34 0; 211 | #X connect 37 0 35 0; 212 | #X connect 38 0 37 0; 213 | #X connect 39 0 36 0; 214 | #X connect 39 0 31 0; 215 | #X connect 40 0 33 1; 216 | #X connect 41 0 34 0; 217 | #X connect 41 0 37 0; 218 | #X connect 42 0 55 0; 219 | #X connect 42 0 59 0; 220 | #X connect 43 0 52 0; 221 | #X connect 44 0 46 0; 222 | #X connect 45 0 44 1; 223 | #X connect 46 0 54 0; 224 | #X connect 50 0 45 0; 225 | #X connect 51 0 43 0; 226 | #X connect 52 0 44 0; 227 | #X connect 53 0 46 0; 228 | #X connect 54 0 42 0; 229 | #X connect 56 0 16 1; 230 | #X connect 56 0 14 0; 231 | #X connect 56 0 15 0; 232 | #X connect 57 0 14 0; 233 | #X connect 57 0 56 0; 234 | #X connect 58 0 56 1; 235 | #X connect 58 0 17 0; 236 | #X connect 60 0 71 0; 237 | #X connect 60 0 74 0; 238 | #X connect 61 0 68 0; 239 | #X connect 62 0 64 0; 240 | #X connect 63 0 62 1; 241 | #X connect 64 0 70 0; 242 | #X connect 68 0 62 0; 243 | #X connect 69 0 64 0; 244 | #X connect 70 0 60 0; 245 | #X connect 72 0 61 0; 246 | #X connect 73 0 63 0; 247 | #X connect 75 0 38 0; 248 | #X connect 75 0 37 1; 249 | #X connect 76 0 1 1; 250 | #X connect 77 0 76 1; 251 | #X connect 78 0 79 1; 252 | #X connect 79 0 80 0; 253 | #X connect 80 0 7 0; 254 | -------------------------------------------------------------------------------- /piLooper/load.pd: -------------------------------------------------------------------------------- 1 | #N canvas 169 225 335 268 10; 2 | #X obj 51 31 loadbang; 3 | #X obj 51 149 soundfiler; 4 | #X obj 51 79 symbol \$1; 5 | #X obj 51 53 trigger a a; 6 | #X obj 51 105 pack s s; 7 | #X obj 125 78 symbol \$2; 8 | #X obj 130 149 table \$2; 9 | #X msg 51 127 read -resize \$1 \$2; 10 | #X connect 0 0 3 0; 11 | #X connect 2 0 4 0; 12 | #X connect 3 0 2 0; 13 | #X connect 3 1 5 0; 14 | #X connect 4 0 7 0; 15 | #X connect 5 0 4 1; 16 | #X connect 7 0 1 0; 17 | -------------------------------------------------------------------------------- /piLooper/loop-midi.pd: -------------------------------------------------------------------------------- 1 | #N canvas 737 138 450 300 10; 2 | #X obj 15 42 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 3 | -1; 4 | #X obj 111 42 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 5 | -1; 6 | #X msg 28 173 1; 7 | #X msg 101 219 0; 8 | #X text 26 128 Send LED Data CH10; 9 | #X obj 209 44 / 63.5; 10 | #X obj 15 60 s lp-trig-\$1; 11 | #X obj 111 60 s PreClear-\$1; 12 | #X obj 209 65 s lp-vol-\$1; 13 | #X obj 71 172 r mute-\$1; 14 | #X obj 101 195 r clear-\$1; 15 | #X obj 28 147 r lp-trig-led-\$1; 16 | #X obj 15 21 ctlin \$1; 17 | #X obj 111 21 ctlin \$2; 18 | #X obj 209 20 ctlin \$3; 19 | #X obj 28 252 ctlout \$1 26; 20 | #X obj 118 252 ctlout \$1 10; 21 | #X connect 0 0 6 0; 22 | #X connect 1 0 7 0; 23 | #X connect 2 0 15 0; 24 | #X connect 2 0 16 0; 25 | #X connect 3 0 15 0; 26 | #X connect 3 0 16 0; 27 | #X connect 5 0 8 0; 28 | #X connect 9 0 15 0; 29 | #X connect 10 0 3 0; 30 | #X connect 11 0 2 0; 31 | #X connect 12 0 0 0; 32 | #X connect 13 0 1 0; 33 | #X connect 14 0 5 0; 34 | -------------------------------------------------------------------------------- /piLooper/loopLoad.pd: -------------------------------------------------------------------------------- 1 | #N canvas 514 197 325 184 10; 2 | #X obj 33 119 soundfiler; 3 | #X obj 33 68 pack \$1 symbol; 4 | #X msg 33 93 read Sessions/\$2/stem-\$1.wav loop-\$1; 5 | #X obj 33 43 r load; 6 | #X obj 114 45 r songName; 7 | #X connect 1 0 2 0; 8 | #X connect 2 0 0 0; 9 | #X connect 3 0 1 0; 10 | #X connect 4 0 1 1; 11 | -------------------------------------------------------------------------------- /piLooper/loopSave.pd: -------------------------------------------------------------------------------- 1 | #N canvas 518 114 438 491 10; 2 | #X obj 161 163 r ms; 3 | #X obj 110 188 delay 500; 4 | #X msg 66 188 start; 5 | #X msg 110 210 stop; 6 | #X obj 208 319 writesf~ 2; 7 | #X obj 123 101 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 8 | -1 -1; 9 | #X obj 209 170 pack \$1 symbol; 10 | #X obj 123 75 spigot; 11 | #X msg 252 47 0; 12 | #X msg 156 46 1; 13 | #X text 172 78 but only create the file if there is a loop here, f 14 | 17; 15 | #X obj 156 22 r lp-done-\$1; 16 | #X obj 290 146 r songName; 17 | #X msg 208 194 open Sessions/\$2/stem-\$1.wav; 18 | #X obj 66 270 tabplay~ loop-\$1; 19 | #X obj 63 22 r save; 20 | #X obj 66 244 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 21 | -1; 22 | #X obj 252 22 r clear-\$1; 23 | #X obj 9 318 s stop; 24 | #X obj 75 461 s comPortMsg; 25 | #X msg 75 425 print -sgn_Saving.../; 26 | #X obj 225 404 symbol; 27 | #X obj 258 377 r songName; 28 | #X obj 225 380 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 29 | -1 -1; 30 | #X msg 225 427 print -sgn_\$1/; 31 | #X connect 0 0 1 1; 32 | #X connect 1 0 3 0; 33 | #X connect 2 0 4 0; 34 | #X connect 2 0 16 0; 35 | #X connect 3 0 4 0; 36 | #X connect 3 0 23 0; 37 | #X connect 5 0 6 0; 38 | #X connect 5 0 2 0; 39 | #X connect 5 0 1 0; 40 | #X connect 6 0 13 0; 41 | #X connect 7 0 5 0; 42 | #X connect 8 0 7 1; 43 | #X connect 9 0 7 1; 44 | #X connect 11 0 9 0; 45 | #X connect 12 0 6 1; 46 | #X connect 13 0 4 0; 47 | #X connect 14 0 4 0; 48 | #X connect 14 0 4 1; 49 | #X connect 15 0 7 0; 50 | #X connect 16 0 14 0; 51 | #X connect 16 0 18 0; 52 | #X connect 16 0 20 0; 53 | #X connect 17 0 8 0; 54 | #X connect 20 0 19 0; 55 | #X connect 21 0 24 0; 56 | #X connect 22 0 21 1; 57 | #X connect 23 0 21 0; 58 | #X connect 24 0 19 0; 59 | -------------------------------------------------------------------------------- /piLooper/notecheck.pd: -------------------------------------------------------------------------------- 1 | #N canvas 272 401 551 280 10; 2 | #X obj 53 125 spigot; 3 | #X obj 53 95 == \$1; 4 | #X obj 53 47 inlet; 5 | #X text 207 63 Play on Screen; 6 | #X obj 106 199 outlet~; 7 | #X obj 106 171 oneshot \$3; 8 | #X obj 163 146 inlet; 9 | #X text 20 23 midi note #; 10 | #X text 199 145 pass through pad velocity; 11 | #X msg 203 107 1; 12 | #X obj 203 83 r btn\$2; 13 | #X obj 106 102 r \$2; 14 | #X connect 0 0 5 0; 15 | #X connect 1 0 0 1; 16 | #X connect 1 0 0 0; 17 | #X connect 2 0 1 0; 18 | #X connect 5 0 4 0; 19 | #X connect 6 0 5 1; 20 | #X connect 9 0 5 0; 21 | #X connect 10 0 9 0; 22 | #X connect 11 0 5 0; 23 | -------------------------------------------------------------------------------- /piLooper/oneshot.pd: -------------------------------------------------------------------------------- 1 | #N canvas 619 277 466 433 10; 2 | #X obj 69 32 inlet; 3 | #X obj 160 116 tabplay~ \$0-sample; 4 | #X obj 275 36 load \$1 \$0-sample; 5 | #X obj 69 54 select 1; 6 | #X text 179 359 Main Audio Out; 7 | #X obj 111 358 outlet~; 8 | #X obj 111 327 *~; 9 | #X obj 234 181 inlet; 10 | #X obj 234 248 pack 0 50; 11 | #X obj 234 223 / 127; 12 | #X text 233 164 pad velocity; 13 | #X obj 158 178 loadbang; 14 | #X msg 158 202 1; 15 | #X obj 158 288 line~; 16 | #X obj 113 190 *~; 17 | #X obj 69 156 line~; 18 | #X obj 106 86 delay 5; 19 | #X msg 107 118 1 5; 20 | #X msg 69 118 0 5; 21 | #X msg 26 191 1; 22 | #X obj 26 224 switch~; 23 | #X msg 57 191 0; 24 | #X connect 0 0 3 0; 25 | #X connect 1 0 14 1; 26 | #X connect 1 1 21 0; 27 | #X connect 3 0 18 0; 28 | #X connect 3 0 16 0; 29 | #X connect 3 0 19 0; 30 | #X connect 6 0 5 0; 31 | #X connect 7 0 9 0; 32 | #X connect 8 0 13 0; 33 | #X connect 9 0 8 0; 34 | #X connect 11 0 12 0; 35 | #X connect 12 0 13 0; 36 | #X connect 13 0 6 1; 37 | #X connect 14 0 6 0; 38 | #X connect 15 0 14 0; 39 | #X connect 16 0 17 0; 40 | #X connect 16 0 1 0; 41 | #X connect 17 0 15 0; 42 | #X connect 18 0 15 0; 43 | #X connect 19 0 20 0; 44 | #X connect 21 0 20 0; 45 | -------------------------------------------------------------------------------- /piLooper/samp.pd: -------------------------------------------------------------------------------- 1 | #N canvas 925 409 296 153 10; 2 | #X obj 10 34 stripnote; 3 | #X obj 10 98 outlet~; 4 | #X obj 10 68 notecheck \$1 \$2 \$3; 5 | #X obj 10 8 notein; 6 | #X obj 97 33 inlet; 7 | #X connect 2 0 1 0; 8 | #X connect 3 0 0 0; 9 | #X connect 3 1 0 1; 10 | #X connect 4 0 2 0; 11 | -------------------------------------------------------------------------------- /piLooper/serial_print.pd: -------------------------------------------------------------------------------- 1 | #N canvas 417 91 618 555 10; 2 | #X obj 47 113 inlet; 3 | #X text 374 491 written by Alexandros Drymonitis; 4 | #X obj 47 135 sel 10 13; 5 | #X obj 205 112 inlet delimiter; 6 | #X obj 389 369 outlet symbol; 7 | #X obj 70 514 outlet list; 8 | #N canvas 64 299 639 403 \$0-set_argument 0; 9 | #X obj 24 7 loadbang; 10 | #X obj 24 245 symbol \$1; 11 | #X obj 24 269 sel tab space comma any; 12 | #X obj 84 53 inlet; 13 | #X obj 372 46 symbol \$2; 14 | #X obj 24 29 t b b; 15 | #X obj 298 204 list append; 16 | #X msg 372 91 9; 17 | #X msg 415 91 32; 18 | #X obj 372 69 sel tab space comma; 19 | #X msg 458 91 44; 20 | #X msg 24 301 9; 21 | #X msg 63 301 32; 22 | #X msg 103 301 44; 23 | #X msg 142 301 9 32 44; 24 | #X msg 502 91 0; 25 | #X obj 250 120 t b s; 26 | #X obj 193 98 route bang; 27 | #X obj 193 120 t b b; 28 | #X text 189 138 if we provide one symbol only \, clear [list append] 29 | first; 30 | #X obj 298 273 outlet arg_list; 31 | #X obj 379 248 outlet num_args; 32 | #N canvas 675 248 516 378 drip_list 0; 33 | #X obj 69 60 until; 34 | #X obj 69 82 list; 35 | #X obj 69 104 list split 1; 36 | #X obj 69 14 inlet; 37 | #X obj 69 126 sel 0; 38 | #X obj 218 121 t b b; 39 | #X obj 101 149 t b f; 40 | #X obj 101 193 f; 41 | #X obj 131 193 + 1; 42 | #X obj 101 215 t f f; 43 | #X obj 218 212 f; 44 | #X obj 101 237 pack; 45 | #X obj 69 36 t b l b; 46 | #X msg 119 171 1; 47 | #X text 59 299 force a zero as the second argument if only one symbol 48 | is given via argument \, and exclude it from the list; 49 | #X obj 101 259 outlet arg_list; 50 | #X obj 218 234 outlet num_args; 51 | #X connect 0 0 1 0; 52 | #X connect 1 0 2 0; 53 | #X connect 2 0 4 0; 54 | #X connect 2 1 1 1; 55 | #X connect 2 2 5 0; 56 | #X connect 3 0 12 0; 57 | #X connect 4 1 6 0; 58 | #X connect 5 0 10 0; 59 | #X connect 5 1 0 1; 60 | #X connect 6 0 7 0; 61 | #X connect 6 1 11 1; 62 | #X connect 7 0 8 0; 63 | #X connect 7 0 9 0; 64 | #X connect 8 0 7 1; 65 | #X connect 9 0 11 0; 66 | #X connect 9 1 10 1; 67 | #X connect 10 0 16 0; 68 | #X connect 11 0 15 0; 69 | #X connect 12 0 0 0; 70 | #X connect 12 1 1 1; 71 | #X connect 12 2 13 0; 72 | #X connect 13 0 7 1; 73 | #X restore 298 227 pd drip_list; 74 | #N canvas 444 92 736 575 split_symbols 0; 75 | #X obj 34 24 inlet; 76 | #X obj 126 108 until; 77 | #X obj 126 130 list; 78 | #X obj 126 152 list split 1; 79 | #X obj 126 214 sel 32; 80 | #X obj 251 231 list prepend; 81 | #X obj 251 253 t l l; 82 | #X obj 126 236 t b b; 83 | #X obj 230 276 list; 84 | #X obj 230 298 list tosymbol; 85 | #X obj 34 47 list fromsymbol; 86 | #X obj 230 371 f; 87 | #X obj 258 371 + 1; 88 | #X msg 245 350 0; 89 | #X obj 126 86 t b l b b; 90 | #X obj 230 427 pack f s; 91 | #X obj 230 326 t b s; 92 | #X obj 230 521 outlet; 93 | #X obj 312 505 outlet; 94 | #X obj 230 449 route 0 1; 95 | #X obj 230 499 symbol; 96 | #X obj 260 472 symbol; 97 | #X obj 207 173 t b b b; 98 | #X obj 312 472 spigot; 99 | #X obj 351 450 == 0; 100 | #X obj 230 393 t f f; 101 | #X obj 34 69 route bang; 102 | #X msg 34 91 97 110 121; 103 | #X text 153 46 if we receive an empty symbol \, we'll force the list 104 | of the symbol "any"; 105 | #X text 173 211 we use space to split the two symbols; 106 | #X text 340 232 every time we output one symbol \, clear this list 107 | ; 108 | #X text 359 472 if we provide one symbol only \, send a bang out this 109 | outet; 110 | #X text 263 151 if only one symbol is received (hence \, no space) 111 | \, bang the right outlet of this subpatch explicitly \, so the symbol 112 | can pass; 113 | #X connect 0 0 10 0; 114 | #X connect 1 0 2 0; 115 | #X connect 2 0 3 0; 116 | #X connect 3 0 4 0; 117 | #X connect 3 1 2 1; 118 | #X connect 3 2 22 0; 119 | #X connect 4 0 7 0; 120 | #X connect 4 1 5 0; 121 | #X connect 5 0 6 0; 122 | #X connect 6 0 8 1; 123 | #X connect 6 1 5 1; 124 | #X connect 7 0 8 0; 125 | #X connect 7 1 5 1; 126 | #X connect 8 0 9 0; 127 | #X connect 9 0 16 0; 128 | #X connect 10 0 26 0; 129 | #X connect 11 0 12 0; 130 | #X connect 11 0 25 0; 131 | #X connect 12 0 11 1; 132 | #X connect 13 0 11 1; 133 | #X connect 14 0 1 0; 134 | #X connect 14 1 2 1; 135 | #X connect 14 2 13 0; 136 | #X connect 14 3 5 1; 137 | #X connect 15 0 19 0; 138 | #X connect 16 0 11 0; 139 | #X connect 16 1 15 1; 140 | #X connect 19 0 20 0; 141 | #X connect 19 1 21 0; 142 | #X connect 20 0 17 0; 143 | #X connect 21 0 18 0; 144 | #X connect 22 0 23 0; 145 | #X connect 22 1 8 0; 146 | #X connect 22 2 1 1; 147 | #X connect 23 0 18 0; 148 | #X connect 24 0 23 1; 149 | #X connect 25 0 15 0; 150 | #X connect 25 1 24 0; 151 | #X connect 26 0 27 0; 152 | #X connect 26 1 14 0; 153 | #X connect 27 0 14 0; 154 | #X restore 84 76 pd split_symbols; 155 | #X connect 0 0 5 0; 156 | #X connect 1 0 2 0; 157 | #X connect 2 0 11 0; 158 | #X connect 2 1 12 0; 159 | #X connect 2 2 13 0; 160 | #X connect 2 3 14 0; 161 | #X connect 2 4 14 0; 162 | #X connect 3 0 23 0; 163 | #X connect 4 0 9 0; 164 | #X connect 5 0 1 0; 165 | #X connect 5 1 4 0; 166 | #X connect 6 0 22 0; 167 | #X connect 7 0 6 1; 168 | #X connect 8 0 6 1; 169 | #X connect 9 0 7 0; 170 | #X connect 9 1 8 0; 171 | #X connect 9 2 10 0; 172 | #X connect 9 3 15 0; 173 | #X connect 10 0 6 1; 174 | #X connect 11 0 6 0; 175 | #X connect 12 0 6 0; 176 | #X connect 13 0 6 0; 177 | #X connect 14 0 6 0; 178 | #X connect 15 0 6 1; 179 | #X connect 16 0 1 0; 180 | #X connect 16 1 4 0; 181 | #X connect 17 0 18 0; 182 | #X connect 17 1 16 0; 183 | #X connect 18 0 1 0; 184 | #X connect 18 1 6 1; 185 | #X connect 22 0 20 0; 186 | #X connect 22 1 21 0; 187 | #X connect 23 0 1 1; 188 | #X connect 23 1 17 0; 189 | #X restore 205 134 pd \$0-set_argument; 190 | #X text 40 20 to be used with [comport] for utilising Arduinos' Serial.print() 191 | and Serial.println() functions; 192 | #X obj 102 446 list; 193 | #N canvas 293 276 844 259 delimiter 0; 194 | #X obj 38 176 outlet bang; 195 | #X obj 38 32 inlet; 196 | #X obj 38 56 sel; 197 | #X obj 56 79 sel; 198 | #X obj 74 101 sel; 199 | #X obj 91 39 route 1 2 3; 200 | #X obj 305 34 swap 3; 201 | #X obj 305 56 -; 202 | #X obj 305 78 t f b; 203 | #X obj 305 100 until; 204 | #X obj 305 144 f; 205 | #X obj 335 144 - 1; 206 | #X msg 323 122 3; 207 | #X obj 305 166 pack f 256; 208 | #X text 361 61 set 256 to [sel]s that are not used (if we provide one 209 | or two arguments \, for example) \, cause this number will never go 210 | through [comport] (it's 8-bits plus 1); 211 | #X obj 129 118 outlet through; 212 | #X obj 91 17 inlet arg_list; 213 | #X obj 305 12 inlet num_args; 214 | #X connect 1 0 2 0; 215 | #X connect 2 0 0 0; 216 | #X connect 2 1 3 0; 217 | #X connect 3 0 0 0; 218 | #X connect 3 1 4 0; 219 | #X connect 4 0 0 0; 220 | #X connect 4 1 15 0; 221 | #X connect 5 0 2 1; 222 | #X connect 5 1 3 1; 223 | #X connect 5 2 4 1; 224 | #X connect 6 0 7 0; 225 | #X connect 6 1 7 1; 226 | #X connect 7 0 8 0; 227 | #X connect 8 0 9 0; 228 | #X connect 8 1 12 0; 229 | #X connect 9 0 10 0; 230 | #X connect 10 0 11 0; 231 | #X connect 10 0 13 0; 232 | #X connect 11 0 10 1; 233 | #X connect 12 0 10 1; 234 | #X connect 13 0 5 0; 235 | #X connect 16 0 5 0; 236 | #X connect 17 0 6 0; 237 | #X restore 165 159 pd delimiter; 238 | #N canvas 372 82 841 654 \$0-assemble_float 0; 239 | #X obj 103 366 t f b; 240 | #X obj 103 457 +; 241 | #X obj 135 393 f; 242 | #X obj 135 440 * 10; 243 | #X msg 153 233 0; 244 | #X obj 103 479 t f f; 245 | #X obj 21 496 f; 246 | #X obj 103 343 - 48; 247 | #X obj 21 194 inlet get; 248 | #X obj 201 63 inlet val; 249 | #X obj 21 584 outlet; 250 | #N canvas 155 167 262 222 bang_once 0; 251 | #X obj 64 91 inlet; 252 | #X obj 64 113 spigot; 253 | #X obj 64 135 t b b; 254 | #X msg 117 96 0; 255 | #X obj 64 157 outlet; 256 | #X obj 103 45 inlet reset; 257 | #X msg 103 67 1; 258 | #X connect 0 0 1 0; 259 | #X connect 1 0 2 0; 260 | #X connect 2 0 4 0; 261 | #X connect 2 1 3 0; 262 | #X connect 3 0 1 1; 263 | #X connect 5 0 6 0; 264 | #X connect 6 0 1 1; 265 | #X restore 300 229 pd bang_once; 266 | #X msg 436 234 0; 267 | #X msg 300 299 1; 268 | #X obj 21 338 spigot; 269 | #X obj 21 216 t b b; 270 | #N canvas 386 453 292 235 set_decimal_place 0; 271 | #X obj 36 26 inlet; 272 | #X obj 66 104 + 1; 273 | #X obj 36 126 swap 10; 274 | #X obj 36 148 pow; 275 | #X obj 36 193 outlet; 276 | #X obj 36 104 f; 277 | #X obj 36 71 spigot; 278 | #X obj 122 32 inlet; 279 | #X obj 122 54 t f f; 280 | #X obj 75 46 inlet; 281 | #X obj 36 170 pow -1; 282 | #X connect 0 0 6 0; 283 | #X connect 1 0 5 1; 284 | #X connect 2 0 3 0; 285 | #X connect 2 1 3 1; 286 | #X connect 3 0 10 0; 287 | #X connect 5 0 1 0; 288 | #X connect 5 0 2 0; 289 | #X connect 6 0 5 0; 290 | #X connect 7 0 8 0; 291 | #X connect 8 0 6 1; 292 | #X connect 8 1 5 0; 293 | #X connect 9 0 6 1; 294 | #X connect 10 0 4 0; 295 | #X restore 277 372 pd set_decimal_place; 296 | #X obj 254 201 t f b b; 297 | #X msg 201 401 1; 298 | #X msg 160 418 10; 299 | #X obj 201 423 t f f; 300 | #X obj 300 321 t f f; 301 | #X obj 201 115 moses 48; 302 | #X obj 254 137 moses 58; 303 | #X obj 436 256 t f f; 304 | #X obj 291 51 r \$0-symbol; 305 | #X msg 291 73 0; 306 | #X obj 356 282 s \$0-digits; 307 | #X text 426 284 if digits start coming in \, close symbol's [spigot] 308 | ; 309 | #X text 326 74 if symbols start coming in \, close [spigot] so that 310 | the symbol can also contain digits; 311 | #X obj 483 251 t f f; 312 | #X msg 483 229 1; 313 | #X obj 396 190 r \$0-delimit; 314 | #X obj 323 480 f; 315 | #X obj 341 457 r \$0-hyphen; 316 | #X obj 300 265 t b b b; 317 | #X obj 201 162 sel 46; 318 | #X obj 323 502 sel 45; 319 | #X msg 323 544 -1; 320 | #X obj 396 212 t b b b b; 321 | #X obj 201 90 spigot 1; 322 | #X obj 21 561 * 1; 323 | #X obj 103 389 * 1; 324 | #X connect 0 0 42 0; 325 | #X connect 0 1 2 0; 326 | #X connect 1 0 5 0; 327 | #X connect 2 0 3 0; 328 | #X connect 3 0 1 1; 329 | #X connect 4 0 2 1; 330 | #X connect 5 0 6 1; 331 | #X connect 5 1 2 1; 332 | #X connect 6 0 41 0; 333 | #X connect 7 0 0 0; 334 | #X connect 8 0 15 0; 335 | #X connect 9 0 40 0; 336 | #X connect 11 0 35 0; 337 | #X connect 12 0 24 0; 338 | #X connect 13 0 21 0; 339 | #X connect 14 0 6 0; 340 | #X connect 15 0 14 0; 341 | #X connect 15 1 4 0; 342 | #X connect 16 0 42 1; 343 | #X connect 17 0 7 0; 344 | #X connect 17 1 16 0; 345 | #X connect 17 2 11 0; 346 | #X connect 18 0 20 0; 347 | #X connect 19 0 3 1; 348 | #X connect 20 0 3 1; 349 | #X connect 20 1 16 1; 350 | #X connect 21 0 14 1; 351 | #X connect 21 1 42 1; 352 | #X connect 22 0 36 0; 353 | #X connect 22 1 23 0; 354 | #X connect 23 0 17 0; 355 | #X connect 24 0 14 1; 356 | #X connect 24 1 16 2; 357 | #X connect 25 0 26 0; 358 | #X connect 26 0 40 1; 359 | #X connect 30 0 40 1; 360 | #X connect 30 1 33 1; 361 | #X connect 31 0 30 0; 362 | #X connect 32 0 39 0; 363 | #X connect 33 0 37 0; 364 | #X connect 34 0 33 1; 365 | #X connect 35 0 13 0; 366 | #X connect 35 1 33 0; 367 | #X connect 35 2 27 0; 368 | #X connect 36 0 18 0; 369 | #X connect 37 0 38 0; 370 | #X connect 37 1 41 1; 371 | #X connect 38 0 41 1; 372 | #X connect 39 0 11 1; 373 | #X connect 39 1 19 0; 374 | #X connect 39 2 12 0; 375 | #X connect 39 3 31 0; 376 | #X connect 40 0 22 0; 377 | #X connect 41 0 10 0; 378 | #X connect 42 0 1 0; 379 | #X restore 205 355 pd \$0-assemble_float; 380 | #N canvas 265 108 854 599 \$0-assemble_strings 0; 381 | #X obj 231 116 inlet; 382 | #X obj 131 412 list tosymbol; 383 | #X obj 231 313 t l l; 384 | #X obj 231 291 list prepend; 385 | #X obj 131 146 inlet bang; 386 | #X obj 163 520 outlet; 387 | #X text 28 13 upper and lower case letters \, plus underscore and hyphen 388 | symbols go through. if some delimiters are ommited \, they will go 389 | through too; 390 | #X obj 131 330 list; 391 | #X obj 23 323 inlet counter; 392 | #X obj 23 429 pack f s; 393 | #X obj 23 520 outlet; 394 | #X obj 23 451 route 1 0; 395 | #X obj 163 493 symbol; 396 | #N canvas 155 167 262 222 bang_once 0; 397 | #X obj 64 91 inlet; 398 | #X obj 64 113 spigot; 399 | #X obj 64 135 t b b; 400 | #X msg 117 96 0; 401 | #X obj 64 157 outlet; 402 | #X obj 103 45 inlet reset; 403 | #X msg 103 67 1; 404 | #X connect 0 0 1 0; 405 | #X connect 1 0 2 0; 406 | #X connect 2 0 4 0; 407 | #X connect 2 1 3 0; 408 | #X connect 3 0 1 1; 409 | #X connect 5 0 6 0; 410 | #X connect 6 0 1 1; 411 | #X restore 434 282 pd bang_once; 412 | #X msg 558 309 0; 413 | #X obj 90 520 outlet; 414 | #X obj 231 169 moses 48; 415 | #X obj 304 186 moses 58; 416 | #X obj 299 77 r \$0-digits; 417 | #X msg 299 99 0; 418 | #X text 328 99 if numbers start coming in \, close [spigot]; 419 | #X obj 434 391 s \$0-symbol; 420 | #X text 433 412 if symbols start coming in \, close number's [spigot] 421 | ; 422 | #X obj 535 265 t b b b; 423 | #X obj 299 121 t f f; 424 | #X msg 600 282 1; 425 | #X obj 600 364 t f f; 426 | #X obj 535 243 r \$0-delimit; 427 | #X obj 336 326 f; 428 | #X obj 354 303 r \$0-hyphen; 429 | #X obj 336 348 sel 0; 430 | #X obj 231 265 t f b b; 431 | #X obj 304 247 t f b; 432 | #X obj 131 168 t b b; 433 | #X obj 23 479 route bang; 434 | #X obj 231 138 spigot 1; 435 | #X obj 23 381 spigot 1; 436 | #X connect 0 0 35 0; 437 | #X connect 1 0 9 1; 438 | #X connect 2 0 7 1; 439 | #X connect 2 1 3 1; 440 | #X connect 3 0 2 0; 441 | #X connect 4 0 33 0; 442 | #X connect 7 0 1 0; 443 | #X connect 8 0 36 0; 444 | #X connect 9 0 11 0; 445 | #X connect 11 0 34 0; 446 | #X connect 11 1 12 0; 447 | #X connect 12 0 5 0; 448 | #X connect 13 0 21 0; 449 | #X connect 14 0 28 1; 450 | #X connect 16 0 31 0; 451 | #X connect 16 1 17 0; 452 | #X connect 17 0 32 0; 453 | #X connect 17 1 31 0; 454 | #X connect 18 0 19 0; 455 | #X connect 19 0 24 0; 456 | #X connect 23 0 13 1; 457 | #X connect 23 1 14 0; 458 | #X connect 23 2 25 0; 459 | #X connect 24 0 35 1; 460 | #X connect 24 1 36 1; 461 | #X connect 25 0 26 0; 462 | #X connect 26 0 36 1; 463 | #X connect 26 1 35 1; 464 | #X connect 27 0 23 0; 465 | #X connect 28 0 30 0; 466 | #X connect 29 0 28 1; 467 | #X connect 30 1 3 0; 468 | #X connect 31 0 3 0; 469 | #X connect 31 1 28 0; 470 | #X connect 31 2 13 0; 471 | #X connect 32 0 3 0; 472 | #X connect 32 1 28 0; 473 | #X connect 33 0 7 0; 474 | #X connect 33 1 3 1; 475 | #X connect 34 0 10 0; 476 | #X connect 34 1 15 0; 477 | #X connect 35 0 16 0; 478 | #X connect 36 0 9 0; 479 | #X restore 185 329 pd \$0-assemble_strings; 480 | #N canvas 87 82 481 287 \$0-count 0; 481 | #X obj 45 145 f; 482 | #X obj 75 145 + 1; 483 | #X msg 63 122 0; 484 | #X obj 45 169 > 0; 485 | #X obj 45 74 inlet; 486 | #X obj 45 196 outlet; 487 | #X obj 63 99 r \$0-done; 488 | #X text 49 23 this is used in case a delimiter is followed by a symbol 489 | \, so the two (or more) symbols can be diffused properly; 490 | #X connect 0 0 1 0; 491 | #X connect 0 0 3 0; 492 | #X connect 1 0 0 1; 493 | #X connect 2 0 0 1; 494 | #X connect 3 0 5 0; 495 | #X connect 4 0 0 0; 496 | #X connect 6 0 2 0; 497 | #X restore 185 302 pd \$0-count; 498 | #X obj 165 252 t b b b b; 499 | #X obj 165 275 s \$0-delimit; 500 | #X obj 47 259 s \$0-done; 501 | #X obj 297 176 sel 45; 502 | #X msg 297 198 45; 503 | #X obj 297 220 s \$0-hyphen; 504 | #X obj 336 276 t f f; 505 | #X obj 47 235 t b b b; 506 | #X obj 357 346 t b s; 507 | #X obj 102 468 route bang; 508 | #X obj 205 407 list prepend; 509 | #X obj 205 429 t l l; 510 | #X obj 286 381 r \$0-done; 511 | #X obj 127 422 r \$0-done; 512 | #X obj 70 303 t b b; 513 | #N canvas 1 82 353 268 got_bang 0; 514 | #X obj 89 97 inlet; 515 | #X obj 89 119 spigot; 516 | #X obj 89 141 outlet; 517 | #X obj 204 80 inlet; 518 | #X msg 204 102 1; 519 | #X obj 128 49 r \$0-done; 520 | #X msg 128 71 0; 521 | #X connect 0 0 1 0; 522 | #X connect 1 0 2 0; 523 | #X connect 3 0 4 0; 524 | #X connect 4 0 1 1; 525 | #X connect 5 0 6 0; 526 | #X connect 6 0 1 1; 527 | #X restore 70 346 pd got_bang; 528 | #X text 38 61 space \, comma \, and tab function as delimiters by default 529 | \, which can be set explicitly via arguments; 530 | #X connect 0 0 2 0; 531 | #X connect 2 0 20 0; 532 | #X connect 2 2 9 0; 533 | #X connect 3 0 6 0; 534 | #X connect 6 0 9 1; 535 | #X connect 6 1 9 2; 536 | #X connect 8 0 22 0; 537 | #X connect 9 0 13 0; 538 | #X connect 9 1 16 0; 539 | #X connect 10 0 23 0; 540 | #X connect 11 0 28 1; 541 | #X connect 11 1 23 0; 542 | #X connect 11 2 21 0; 543 | #X connect 12 0 11 0; 544 | #X connect 13 0 14 0; 545 | #X connect 13 1 12 0; 546 | #X connect 13 2 10 0; 547 | #X connect 13 3 11 1; 548 | #X connect 16 0 17 0; 549 | #X connect 16 1 19 0; 550 | #X connect 17 0 18 0; 551 | #X connect 19 0 11 2; 552 | #X connect 19 1 10 1; 553 | #X connect 20 0 15 0; 554 | #X connect 20 1 27 0; 555 | #X connect 20 2 13 0; 556 | #X connect 21 0 23 1; 557 | #X connect 21 1 4 0; 558 | #X connect 22 1 5 0; 559 | #X connect 23 0 24 0; 560 | #X connect 24 0 8 1; 561 | #X connect 24 1 23 1; 562 | #X connect 25 0 23 1; 563 | #X connect 26 0 8 1; 564 | #X connect 27 0 28 0; 565 | #X connect 27 1 8 0; 566 | #X connect 28 0 5 0; 567 | -------------------------------------------------------------------------------- /piLooper/synthLeadVoice.pd: -------------------------------------------------------------------------------- 1 | #N canvas 445 69 776 546 10; 2 | #X obj 393 412 *~; 3 | #X obj 408 386 vline~; 4 | #X obj 61 54 unpack 0 0; 5 | #X obj 61 230 phasor~; 6 | #X obj 61 24 inlet; 7 | #X obj 393 443 outlet~; 8 | #X obj 359 320 vline~; 9 | #X obj 171 223 phasor~; 10 | #X msg 694 318 0 200; 11 | #X msg 517 296 0 200; 12 | #X obj 302 274 noise~; 13 | #X obj 302 308 *~ 0.1; 14 | #X obj 396 38 sel 1 0; 15 | #X obj 61 268 expr~ $v1 > $v2; 16 | #X obj 277 224 line; 17 | #X msg 313 185 0.2 500; 18 | #X msg 253 185 0.7 2000; 19 | #X obj 334 364 vcf~ 5, f 9; 20 | #X obj 241 275 *~ 2; 21 | #X obj 241 300 -~ 1; 22 | #X obj 169 179 * 0.99; 23 | #X msg 359 295 20000 10 \, 10000 1000 400; 24 | #X msg 561 317 0.3 100 \, 0.2 1000 200; 25 | #X obj 153 134 line; 26 | #X obj 193 418 vline~; 27 | #X obj 180 443 snapshot~; 28 | #X msg 254 422 0; 29 | #X obj 197 146 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 30 | -1 -1; 31 | #X msg 136 98 \$1 50; 32 | #X msg 193 394 0.99 1 \, 0.97 5000 1000; 33 | #X obj 121 384 r snap; 34 | #X connect 0 0 5 0; 35 | #X connect 1 0 0 1; 36 | #X connect 2 0 28 0; 37 | #X connect 2 1 12 0; 38 | #X connect 3 0 13 0; 39 | #X connect 4 0 2 0; 40 | #X connect 6 0 17 1; 41 | #X connect 7 0 18 0; 42 | #X connect 8 0 1 0; 43 | #X connect 9 0 6 0; 44 | #X connect 10 0 11 0; 45 | #X connect 11 0 17 0; 46 | #X connect 12 0 21 0; 47 | #X connect 12 0 22 0; 48 | #X connect 12 0 16 0; 49 | #X connect 12 0 29 0; 50 | #X connect 12 1 8 0; 51 | #X connect 12 1 9 0; 52 | #X connect 12 1 15 0; 53 | #X connect 12 1 26 0; 54 | #X connect 13 0 17 0; 55 | #X connect 14 0 13 1; 56 | #X connect 15 0 14 0; 57 | #X connect 16 0 14 0; 58 | #X connect 17 0 0 0; 59 | #X connect 18 0 19 0; 60 | #X connect 19 0 17 0; 61 | #X connect 20 0 7 0; 62 | #X connect 21 0 6 0; 63 | #X connect 22 0 1 0; 64 | #X connect 23 0 20 0; 65 | #X connect 23 0 3 0; 66 | #X connect 24 0 25 0; 67 | #X connect 25 0 20 1; 68 | #X connect 25 0 27 0; 69 | #X connect 26 0 24 0; 70 | #X connect 27 0 20 0; 71 | #X connect 28 0 23 0; 72 | #X connect 29 0 24 0; 73 | #X connect 30 0 25 0; 74 | -------------------------------------------------------------------------------- /piLooper/synthLeadVoiceThree.pd: -------------------------------------------------------------------------------- 1 | #N canvas 0 22 766 598 10; 2 | #X obj 393 502 *~; 3 | #X obj 408 476 vline~; 4 | #X obj 61 54 unpack 0 0; 5 | #X obj 61 24 inlet; 6 | #X obj 393 533 outlet~; 7 | #X obj 359 332 vline~; 8 | #X obj 396 38 sel 1 0; 9 | #X obj 228 223 *~ 2; 10 | #X obj 228 245 -~ 1; 11 | #X obj 228 200 phasor~; 12 | #X msg 704 318 0 500; 13 | #X obj 338 420 *~ 0.5; 14 | #X obj 402 411 *~ 0.5; 15 | #X obj 334 364 vcf~ 10, f 9; 16 | #X obj 148 233 *~ 2; 17 | #X obj 148 255 -~ 1; 18 | #X obj 148 210 phasor~; 19 | #X msg 516 299 0 100; 20 | #X obj 148 282 *~; 21 | #X obj 148 187 * 0.99; 22 | #X msg 560 318 1 10 \, 0.5 900 10; 23 | #X msg 359 295 6000 1000 \, 800 1500 1500; 24 | #X obj 186 333 noise~; 25 | #X obj 187 366 *~ 0.05; 26 | #X obj 227 126 * 0.5; 27 | #X connect 0 0 4 0; 28 | #X connect 1 0 0 1; 29 | #X connect 2 0 24 0; 30 | #X connect 2 1 6 0; 31 | #X connect 3 0 2 0; 32 | #X connect 5 0 13 1; 33 | #X connect 6 0 21 0; 34 | #X connect 6 0 20 0; 35 | #X connect 6 1 10 0; 36 | #X connect 6 1 17 0; 37 | #X connect 7 0 8 0; 38 | #X connect 7 0 18 1; 39 | #X connect 8 0 13 0; 40 | #X connect 9 0 7 0; 41 | #X connect 10 0 1 0; 42 | #X connect 11 0 0 0; 43 | #X connect 12 0 0 0; 44 | #X connect 13 0 11 0; 45 | #X connect 13 1 12 0; 46 | #X connect 14 0 15 0; 47 | #X connect 15 0 18 0; 48 | #X connect 16 0 14 0; 49 | #X connect 17 0 5 0; 50 | #X connect 18 0 13 0; 51 | #X connect 19 0 16 0; 52 | #X connect 20 0 1 0; 53 | #X connect 21 0 5 0; 54 | #X connect 22 0 23 0; 55 | #X connect 23 0 13 0; 56 | #X connect 24 0 9 0; 57 | #X connect 24 0 19 0; 58 | -------------------------------------------------------------------------------- /piLooper/synthLeadVoiceTwo.pd: -------------------------------------------------------------------------------- 1 | #N canvas 122 134 872 658 10; 2 | #X obj 393 502 *~; 3 | #X obj 408 476 vline~; 4 | #X obj 61 54 unpack 0 0; 5 | #X obj 61 24 inlet; 6 | #X obj 393 533 outlet~; 7 | #X obj 359 320 vline~; 8 | #X obj 396 38 sel 1 0; 9 | #X obj 61 253 *~ 2; 10 | #X obj 61 275 -~ 1; 11 | #X obj 166 187 osc~; 12 | #X obj 61 230 phasor~; 13 | #X msg 517 296 0 800; 14 | #X obj 151 236 +~; 15 | #X obj 151 259 osc~; 16 | #X msg 704 318 0 500; 17 | #X obj 166 160 * 2; 18 | #X obj 284 177 osc~; 19 | #X obj 251 236 +~; 20 | #X obj 251 259 osc~; 21 | #X obj 279 212 *~ 200; 22 | #X obj 61 302 *~ 0.9; 23 | #X obj 166 212 *~ 500; 24 | #X obj 284 150 * 2; 25 | #X obj 338 420 *~ 0.5; 26 | #X obj 240 183 * 0.98; 27 | #X msg 560 318 0.7 10 \, 0.1 900 10; 28 | #X obj 427 380 *~ 0.5; 29 | #X msg 359 295 6000 10 \, 1000 1000 10; 30 | #X obj 334 364 vcf~ 10, f 9; 31 | #X connect 0 0 4 0; 32 | #X connect 1 0 0 1; 33 | #X connect 2 0 10 0; 34 | #X connect 2 0 15 0; 35 | #X connect 2 0 12 0; 36 | #X connect 2 0 22 0; 37 | #X connect 2 0 24 0; 38 | #X connect 2 1 6 0; 39 | #X connect 3 0 2 0; 40 | #X connect 5 0 28 1; 41 | #X connect 6 0 27 0; 42 | #X connect 6 0 25 0; 43 | #X connect 6 1 14 0; 44 | #X connect 6 1 11 0; 45 | #X connect 7 0 8 0; 46 | #X connect 8 0 20 0; 47 | #X connect 9 0 21 0; 48 | #X connect 10 0 7 0; 49 | #X connect 11 0 5 0; 50 | #X connect 12 0 13 0; 51 | #X connect 13 0 23 0; 52 | #X connect 13 0 28 0; 53 | #X connect 14 0 1 0; 54 | #X connect 15 0 9 0; 55 | #X connect 16 0 19 0; 56 | #X connect 17 0 18 0; 57 | #X connect 18 0 23 0; 58 | #X connect 18 0 28 0; 59 | #X connect 19 0 17 1; 60 | #X connect 20 0 28 0; 61 | #X connect 21 0 12 1; 62 | #X connect 22 0 16 0; 63 | #X connect 23 0 0 0; 64 | #X connect 24 0 17 0; 65 | #X connect 25 0 1 0; 66 | #X connect 26 0 0 0; 67 | #X connect 27 0 5 0; 68 | #X connect 28 1 26 0; 69 | --------------------------------------------------------------------------------