Commit 3dc8859d authored by resonance's avatar resonance

v1

parent d875c2ae
This diff is collapsed.
This diff is collapsed.
#N canvas 154 78 1211 697 10;
#X obj 14 -74 cnv 15 970 135 empty empty empty 20 12 0 14 -249661 -66577
#N canvas 152 78 1211 689 10;
#X declare -path ../../../malinette/abstractions/in;
#X declare -path ../../../malinette/abstractions/out;
#X declare -path ../../../malinette/abstractions/seq;
#X declare -path ../../../malinette/abstractions/audio;
#X declare -path ../../../malinette/abstractions/video;
#X declare -path ../../../malinette/abstractions/numbers;
#X declare -path brutbox;
#X declare -path core;
#X declare -path ../../abstractions/core;
#X declare -path ../../abstractions/brutbox;
#X declare -path /brutbox;
#X declare -path /core;
#X declare -path ../abstractions/brutbox;
#X declare -path ../abstractions/core;
#X declare -path abs;
#X declare -path /bb-audio;
#X declare -path ../../abstractions/bb-audio;
#X declare -path ../abstractions/bb-audio;
#X declare -path bb-audio;
#X declare -path ../../../brutbox/abstractions/bb-audio;
#X obj 14 -82 cnv 15 970 135 empty empty empty 20 12 0 14 -249661 -66577
0;
#N canvas 240 118 959 594 bb-preset 0;
#X obj 71 184 r bb-global;
......@@ -577,8 +597,8 @@
#X connect 27 0 35 0;
#X connect 27 1 35 1;
#X coords 0 -1 1 1 49 12 2 100 100;
#X restore 880 -70 pd bb-preset;
#X obj 14 456 cnv 15 970 76 empty empty empty 647 40 1 12 -228856 -66577
#X restore 880 -78 pd bb-preset;
#X obj 14 448 cnv 15 970 76 empty empty empty 647 40 1 12 -228856 -66577
0;
#N canvas 395 146 959 594 bb-preset 0;
#X obj 100 185 / 127;
......@@ -627,9 +647,8 @@
#X connect 16 0 7 0;
#X connect 25 0 24 0;
#X coords 0 -1 1 1 49 12 2 100 100;
#X restore 905 488 pd bb-preset;
#X obj 931 -70 ../../abstractions/bb-include;
#X obj 195 -74 bbinmini 3;
#X restore 905 480 pd bb-preset;
#X obj 195 -82 bbinmini 3;
#N canvas 369 88 690 809 GUIDE 0;
#X obj 46 79 cnv 3 510 3 empty empty R&nB 0 -20 1 30 -228856 -162280
0;
......@@ -682,26 +701,70 @@ sur glissiere;
#X text 45 95 Patch pour Cedric & Josianne. Foyer Les Jeunets \, Parthenay.
Octobre 2016;
#X coords 0 -1 1 1 49 12 2 600 70;
#X restore 904 -45 pd GUIDE;
#X obj 735 -74 bb-micro-in 1;
#X obj 825 -73 bb-micro-in 2;
#X obj 879 -21 harmony;
#X obj 284 456 bb-audio-out 4;
#X obj 644 456 bb-audio-out 8;
#X obj 104 456 bb-audio-out 2;
#X obj 15 456 bb-audio-out 1;
#X obj 555 456 bb-audio-out 7;
#X obj 194 456 bb-audio-out 3;
#X obj 375 456 bb-audio-out 5;
#X obj 465 456 bb-audio-out 6;
#X obj 105 -74 bbinmini 2;
#X obj 15 -74 bbinmini 1;
#X obj 285 -74 bbinmini 4;
#X obj 465 -74 bbinmini 6;
#X obj 555 -74 bbinmini 7;
#X obj 645 -74 bbinmini 8;
#X obj 375 -74 bbinmini 5;
#X obj 881 44 tgl 15 0 bbmainseq empty empty 17 7 0 10 -257985 -1 -1
#X restore 904 -53 pd GUIDE;
#X obj 735 -82 bb-micro-in 1;
#X obj 825 -81 bb-micro-in 2;
#X obj 879 -29 harmony;
#X obj 284 448 bb-audio-out 4;
#X obj 644 448 bb-audio-out 8;
#X obj 104 448 bb-audio-out 2;
#X obj 15 448 bb-audio-out 1;
#X obj 555 448 bb-audio-out 7;
#X obj 194 448 bb-audio-out 3;
#X obj 375 448 bb-audio-out 5;
#X obj 465 448 bb-audio-out 6;
#X obj 105 -82 bbinmini 2;
#X obj 15 -82 bbinmini 1;
#X obj 285 -82 bbinmini 4;
#X obj 465 -82 bbinmini 6;
#X obj 555 -82 bbinmini 7;
#X obj 645 -82 bbinmini 8;
#X obj 375 -82 bbinmini 5;
#X obj 881 36 tgl 15 0 bbmainseq empty empty 17 7 0 10 -257985 -1 -1
0 1;
#X floatatom 902 43 5 0 0 0 - - bbmainseqspeed, f 5;
#X coords 0 697 1 696 85 60 0;
#X floatatom 902 35 5 0 0 0 - - bbmainseqspeed, f 5;
#N canvas 1 78 450 300 INCLUDE 0;
#X obj 101 101 cnv 8 47 10 empty empty INCLUDE 4 5 1 9 -33289 -262144
0;
#X text 102 52 Import paths to find abstractions \; Always use it in
the examples patchs.;
#X obj 513 100 route savetofile;
#X obj 513 120 unpack s s;
#X obj 513 79 iemguts/receivecanvas 1;
#X obj 513 163 s CURRENT-FILE;
#X obj 570 143 s CURRENT-FOLDER;
#X text 509 57 Get and send the new saved file;
#X obj 102 121 declare -path ../../../malinette/abstractions/in;
#X obj 102 141 declare -path ../../../malinette/abstractions/out;
#X obj 102 161 declare -path ../../../malinette/abstractions/seq;
#X obj 102 181 declare -path ../../../malinette/abstractions/audio
;
#X obj 102 201 declare -path ../../../malinette/abstractions/video
;
#X obj 102 221 declare -path ../../../malinette/abstractions/numbers
;
#X text 32 179 MALINETTE;
#X text 34 273 BRUTBOX;
#X obj 101 339 declare -path brutbox;
#X obj 101 360 declare -path core;
#X obj 372 311 declare -path ../../abstractions/core;
#X obj 372 290 declare -path ../../abstractions/brutbox;
#X obj 102 290 declare -path /brutbox;
#X obj 102 311 declare -path /core;
#X obj 372 340 declare -path ../abstractions/brutbox;
#X obj 372 361 declare -path ../abstractions/core;
#X obj 99 496 declare -path abs;
#X text 34 473 dossiers Projet;
#X obj 101 390 declare -path /bb-audio;
#X obj 372 390 declare -path ../../abstractions/bb-audio;
#X obj 372 410 declare -path ../abstractions/bb-audio;
#X obj 101 409 declare -path bb-audio;
#X obj 372 430 declare -path ../../../brutbox/abstractions/bb-audio
;
#X connect 2 0 3 0;
#X connect 3 0 5 0;
#X connect 3 1 6 0;
#X connect 4 0 2 0;
#X coords 0 -1 1 1 49 12 2 100 100;
#X restore 931 -78 pd INCLUDE;
#X coords 0 689 1 688 85 60 0;
// the MIDI channel number to send messages
const int channel = 1;
// the MIDI continuous controller for each analog input
const int controllerA0 = 1; //
const int controllerA1 = 2; //
const int controllerA2 = 3; //
const int controllerA3 = 4; //
const int controllerA4 = 5; //
const int controllerA5 = 6; //
const int controllerA6 = 7; //
const int controllerA7 = 8; //
void setup() {
}
// store previously sent values, to detect changes
int previousA0 = -1;
int previousA1 = -1;
int previousA2 = -1;
int previousA3 = -1;
int previousA4 = -1;
int previousA5 = -1;
int previousA6 = -1;
int previousA7 = -1;
elapsedMillis msec = 0;
void loop() {
// only check the analog inputs 50 times per second,
// to prevent a flood of MIDI messages
if (msec >= 50) {
msec = 0;
int n0 = analogRead(A0) / 8;
int n1 = analogRead(A1) / 8;
int n2 = analogRead(A2) / 8;
int n3 = analogRead(A3) / 8;
int n4 = analogRead(A4) / 8;
int n5 = analogRead(A5) / 8;
int n6 = analogRead(A6) / 8;
int n7 = analogRead(A7) / 8;
// only transmit MIDI messages if analog input changed
if (n0 != previousA0) {
usbMIDI.sendControlChange(controllerA0, n0, channel);
previousA0 = n0;
}
if (n1 != previousA1) {
usbMIDI.sendControlChange(controllerA1, n1, channel);
previousA1 = n1;
}
if (n2 != previousA2) {
usbMIDI.sendControlChange(controllerA2, n2, channel);
previousA2 = n2;
}
if (n3 != previousA3) {
usbMIDI.sendControlChange(controllerA3, n3, channel);
previousA3 = n3;
}
if (n4 != previousA4) {
usbMIDI.sendControlChange(controllerA4, n4, channel);
previousA4 = n4;
}
if (n5 != previousA5) {
usbMIDI.sendControlChange(controllerA5, n5, channel);
previousA5 = n5;
}
if (n6 != previousA6) {
usbMIDI.sendControlChange(controllerA6, n6, channel);
previousA6 = n6;
}
if (n7 != previousA7) {
usbMIDI.sendControlChange(controllerA7, n7, channel);
previousA7 = n7;
}
}
// MIDI Controllers should discard incoming MIDI messages.
// http://forum.pjrc.com/threads/24179-Teensy-3-Ableton-Analog-CC-causes-midi-crash
while (usbMIDI.read()) {
// ignore incoming messages
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment