forked from domdfcoding/circuitpython-mfrc522
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread_tag_midi.pde
More file actions
33 lines (28 loc) · 795 Bytes
/
read_tag_midi.pde
File metadata and controls
33 lines (28 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import themidibus.*;
MidiBus bus;
int tag[] = new int[4];
void setup() {
MidiBus.list();
// 1 -> numero dans liste des input
//MidiBus(java.lang.Object parent, int in_device_num, int out_device_num)
bus = new MidiBus(this, 1,2);
bus.sendNoteOff(new Note(0,64,127));
}
void draw() {
}
void controllerChange(int channel, int number, int value) {
switch(number) {
case 7:
tag[floor(number/2)] += value;
println("uuid :",hex(tag[0],2),hex(tag[1],2),hex(tag[2],2),hex(tag[3],2));
break;
default:
//println(number,value,hex(value),"générique");
if (number%2 == 0) { // debut de chiffre
tag[floor(number/2)] = value*128;
} else {
tag[floor(number/2)] += value;
}
}
//resetMotif();
}