mirror of
https://git.alemi.dev/cv-keyboard.git
synced 2024-11-24 01:14:48 +01:00
Merge pull request #1 from alemigliardi/testing
Alpha 1 - code is stable enough and all features have been reimplemented
This commit is contained in:
commit
12261d38b5
4 changed files with 977 additions and 114 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
|
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
.vscode/arduino.json
|
.vscode/arduino.json
|
||||||
.vscode/c_cpp_properties.json
|
.vscode/c_cpp_properties.json
|
||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
.vscode/ipch/2a8fc4e60d41b99f/mmap_address.bin
|
|
||||||
.vscode/ipch/a05e84ed92aede25/mmap_address.bin
|
|
||||||
.vscode/ipch/f3a41dbca76912c5/WIRING_DIGITAL.ipch
|
|
||||||
.vscode/ipch/f3a41dbca76912c5/mmap_address.bin
|
.vscode/ipch/f3a41dbca76912c5/mmap_address.bin
|
||||||
|
.vscode/ipch/f3a41dbca76912c5/WIRING_DIGITAL.ipch
|
||||||
|
.vscode/ipch/a05e84ed92aede25/mmap_address.bin
|
||||||
|
.vscode/ipch/2a8fc4e60d41b99f/mmap_address.bin
|
591
cvkeyboard.ino
591
cvkeyboard.ino
|
@ -1,165 +1,540 @@
|
||||||
#define noteOffset 36
|
|
||||||
#define DRUMNOTE 60
|
|
||||||
#define MINUTE 60000
|
|
||||||
#define MIDICLOCK 0xf8
|
|
||||||
|
|
||||||
#include <CapacitiveSensor.h>
|
|
||||||
#include <MIDI.h>
|
#include <MIDI.h>
|
||||||
#include <HID.h>
|
#include <HID.h>
|
||||||
|
#include <Wire.h>
|
||||||
|
#include <EEPROM.h>
|
||||||
|
#include <Adafruit_MPR121.h>
|
||||||
|
|
||||||
|
#define BPQN 24 // Ableton sends 24, VCV rack only one, by standard should be 24?
|
||||||
|
|
||||||
|
#define NOTEOffset 36
|
||||||
|
#define DRUMSHIFT 6
|
||||||
|
#define drumOffset 60
|
||||||
|
|
||||||
|
#define MINUTE 60000
|
||||||
|
#define INTERVAL 15 // How many minutes between autosave
|
||||||
|
#define MIDICLOCK 0xf8
|
||||||
|
|
||||||
|
#define MAXKEYS 48
|
||||||
|
#define MAXDPAD 7
|
||||||
|
#define MAXSTEP 64
|
||||||
|
#define MAXCHANNEL 6
|
||||||
|
#define NKEYS 12
|
||||||
|
#define NOCTAVES 4
|
||||||
|
#define NBITS 6
|
||||||
|
|
||||||
|
#define DEBOUNCE 100
|
||||||
|
|
||||||
MIDI_CREATE_DEFAULT_INSTANCE();
|
MIDI_CREATE_DEFAULT_INSTANCE();
|
||||||
|
|
||||||
typedef struct OctaveStatus { // This struct is for an octave status. Each bool is for 1 note
|
typedef struct SequencerStep* link;
|
||||||
bool stat[12];
|
|
||||||
int nOct;
|
|
||||||
} octst;
|
|
||||||
|
|
||||||
|
typedef struct SavePoint {
|
||||||
|
int headAddr[MAXCHANNEL];
|
||||||
|
int tailAddr[MAXCHANNEL];
|
||||||
|
} save_p;
|
||||||
|
|
||||||
|
typedef struct SequencerStep {
|
||||||
|
int kboard_s[4];
|
||||||
|
int dpad_s;
|
||||||
|
unsigned short stepnumber;
|
||||||
|
link next;
|
||||||
|
} step;
|
||||||
|
|
||||||
|
save_p saveH;
|
||||||
|
|
||||||
// PIN DECLARATIONS
|
// PIN DECLARATIONS
|
||||||
int note[12] = { // Pins used to read each note (C is 0, B is 11)
|
int NOTE[NKEYS] = { // Pins used to read each note (C is 0, B is 11)
|
||||||
22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44 };
|
22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44 };
|
||||||
int octave[4] = { // Pins associated to each octave's contact bar
|
int OCTAVE[NOCTAVES] = { // Pins associated to each OCTAVE's contact bar
|
||||||
12, 9, 8, 10 };
|
12, 9, 8, 10 };
|
||||||
int sendPin[3] = { // Pins used as sender for capacitive touch buttons
|
int LEDS[NBITS] = { // Pins used for leds
|
||||||
5, 4, 16 };
|
5, 4, 2, 14, 16, 18 };
|
||||||
int receivePin[3] = { // Pins used as receiver for capacitive touch buttons
|
int OW = 3; // Pin used for overwrite switch
|
||||||
6, 3, 17 };
|
int NEXT = 51; // Pin used for next step switch
|
||||||
|
int DEL = 11; // Capacitive button used for DELETE button
|
||||||
|
int PLUS = 10; // Capacitive button used for PLUS button
|
||||||
|
int MINUS = 9; // Capacitive button used for MINUS button
|
||||||
|
int ARP = 7; // Capacitive button used for ARP button
|
||||||
|
|
||||||
// GLOBAL SETTINGS
|
// USEFUL ITERABLES
|
||||||
bool raw; // Signal is sent when key is detected
|
int pentathonic[10] = { // Used to quantize drum notes
|
||||||
|
0, 2, 5, 7, 9, 12, 14, 17, 19, 21 };
|
||||||
|
int loadingDisplay[6] = {
|
||||||
|
1, 3, 7, 15, 31, 63};
|
||||||
|
|
||||||
// PLACEHOLDERS
|
// PLACEHOLDERS
|
||||||
byte velocity = 100; //
|
byte velocity = 100; //
|
||||||
byte channel = 1; //
|
|
||||||
int bpm = 360; //
|
int bpm = 360; //
|
||||||
unsigned long gate = 50; // ms of keypress if arpeggiator
|
|
||||||
unsigned long nextBeat = 0; // Used to keep track of beats. Useless if receiving MIDI clock.
|
|
||||||
|
|
||||||
// SYSTEM VARIABLES
|
// SEQUENCER POINTERS AND RELATED ARRAYS
|
||||||
int arp = 0; // Keeps track of last played note if arpeggiating
|
link head[6];
|
||||||
|
link current[6];
|
||||||
|
link previous;
|
||||||
|
unsigned short nstep[6]; // Keeps track of the sequencer steps
|
||||||
|
bool mute[6];
|
||||||
|
byte channel; // Current selected channel. Drums are shifted of DRUMSHIFT channels (so channels can only be 6)
|
||||||
|
|
||||||
|
// SYSTEM VARIABLES
|
||||||
|
int arp[2]; // arp[0] = OCTAVE, arp[1] = KEY (arp[0] for iterations, arp[1] for shifting)
|
||||||
int midiclock = 0; // Used to sync with MIDI clock
|
int midiclock = 0; // Used to sync with MIDI clock
|
||||||
int semA = 0; // Basic semaphore implementation with global counter
|
bool arpeggiating = LOW; // Goes HIGH if the user is requesting an arpeggio
|
||||||
int semB = 0;
|
bool plus_step = LOW; // This is used to remember the addition of a step
|
||||||
int npressed; // Number of keys pressed, used to avoid doing anything when no keys are pressed
|
bool minus_step = LOW; // This is used to remember the deletion of a step
|
||||||
bool kboard[49]; // Last status of keyboard
|
bool clear_step = LOW; // This is used to remember the clearing of a step
|
||||||
bool bCapStat[3]; // Last status of Capacitive Buttons
|
bool chan_up = LOW; // Only for now because I have few buttons :C
|
||||||
CapacitiveSensor* bCap[3];
|
bool next_step = LOW; // Used to wait for a full switch cycle
|
||||||
|
bool overwrite = LOW;
|
||||||
|
int sem_beat = 0; // Basic semaphore used to sync with MIDI beat
|
||||||
|
int sem_gate = 0; // Basic semaphore used for gate timing
|
||||||
|
unsigned long last_gate; // Gate start time for last sequencer step
|
||||||
|
unsigned long last_next;
|
||||||
|
unsigned long last_save;
|
||||||
|
unsigned long gate_length = 200; // ms of keypress if arpeggiator
|
||||||
|
bool dpadhit = LOW; // If any drum pad has been hit in this cycle, this is true
|
||||||
|
int npressed; // Number of keys pressed, used to avoid doing anything when no keys are pressed
|
||||||
|
int kboard[4]; // Last status of keyboard
|
||||||
|
int dpad; // Last status of Capacitive Buttons
|
||||||
|
int cap_read;
|
||||||
|
int difference = 0; // Used in many places, might as well be a global variable
|
||||||
|
|
||||||
|
Adafruit_MPR121 cap = Adafruit_MPR121();
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
for (int cOctave = 0; cOctave < 4; cOctave++) {
|
display(loadingDisplay[0]);
|
||||||
pinMode(octave[cOctave], OUTPUT);
|
for (int cOCTAVE = 0; cOCTAVE < NOCTAVES; cOCTAVE++) pinMode(OCTAVE[cOCTAVE], OUTPUT);
|
||||||
}
|
for (int cNOTE = 0; cNOTE < NKEYS; cNOTE++) pinMode(NOTE[cNOTE], INPUT);
|
||||||
for (int cNote = 0; cNote < 12; cNote++) {
|
for (int cLED = 0; cLED < NBITS; cLED++) pinMode(LEDS[cLED], OUTPUT);
|
||||||
pinMode(note[cNote], INPUT);
|
pinMode(OW, INPUT_PULLUP); // Used for overwrite switch
|
||||||
}
|
pinMode(NEXT, INPUT_PULLUP);
|
||||||
for (int cButton = 0; cButton < 3; cButton++) { // Capacitive Buttons configuration
|
display(loadingDisplay[1]);
|
||||||
bCap[cButton] = new CapacitiveSensor(sendPin[cButton], receivePin[cButton]); // Initialized
|
|
||||||
bCap[cButton]->set_CS_AutocaL_Millis(0xFFFFFFFF); // No recalibration
|
|
||||||
bCap[cButton]->set_CS_Timeout_Millis(200); // Timeout set to 200ms (instead of 2s)
|
|
||||||
bCapStat[cButton] = LOW; // Button starts LOW
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int cStat = 0; cStat < 49; cStat++) kboard[cStat] = LOW; // All keyboard keys start LOW
|
|
||||||
|
|
||||||
MIDI.begin(MIDI_CHANNEL_OFF);
|
MIDI.begin(MIDI_CHANNEL_OFF);
|
||||||
Serial.begin(115200);
|
Serial.begin(115200); // Uncomment this if you use Hairless and set baud rate
|
||||||
|
display(loadingDisplay[2]);
|
||||||
pinMode(2, INPUT_PULLUP); // Used for RAW switch
|
for (int i = 0; i < 6; i++){
|
||||||
|
current[i] = NULL;
|
||||||
|
head[i] = NULL;
|
||||||
|
nstep[i] = 0;
|
||||||
|
mute[i] = LOW;
|
||||||
|
}
|
||||||
|
display(loadingDisplay[3]);
|
||||||
|
for (int cOCTAVE = 0; cOCTAVE < NOCTAVES; cOCTAVE++) kboard[cOCTAVE] = 0;
|
||||||
|
dpad = 0;
|
||||||
|
arp[0] = 0;
|
||||||
|
arp[1] = 0;
|
||||||
|
cap_read = 0;
|
||||||
|
channel = (byte) 1;
|
||||||
|
display(loadingDisplay[4]);
|
||||||
|
while (!cap.begin(0x5A)) delay(10); // If MPR121 is not ready, wait for it
|
||||||
|
display(loadingDisplay[5]);
|
||||||
|
loadAll();
|
||||||
|
last_save = millis();
|
||||||
|
last_gate = millis();
|
||||||
|
last_next = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
sync();
|
sync();
|
||||||
|
cap_read = cap.touched();
|
||||||
|
|
||||||
for (int cButton = 0; cButton < 3; cButton++) {
|
if ((cap_read >> 8) & 1) { // Only for now!
|
||||||
bCapStat[cButton] = evalButton(bCap[cButton], bCapStat[cButton], DRUMNOTE + cButton);
|
for (int i=0; i<NBITS; i++) digitalWrite(LEDS[i], LOW);
|
||||||
|
digitalWrite(LEDS[channel-1], HIGH);
|
||||||
}
|
}
|
||||||
npressed = 0;
|
else if (current[channel-1] == NULL) display(analogRead(channel));
|
||||||
raw = digitalRead(2);
|
else display(current[channel-1]->stepnumber);
|
||||||
for (int cOctave = 0; cOctave < 4; cOctave++) {
|
|
||||||
digitalWrite(octave[cOctave], HIGH);
|
|
||||||
npressed += eval(scan(cOctave));
|
|
||||||
digitalWrite(octave[cOctave], LOW);
|
|
||||||
}
|
|
||||||
if (raw) return;
|
|
||||||
if (npressed < 1) return;
|
|
||||||
|
|
||||||
if (semA > 0) {
|
plus_step = plus_step || (bool) ((cap_read >> PLUS) & 1);
|
||||||
semA--;
|
minus_step = minus_step || (bool) ((cap_read >> MINUS) & 1);
|
||||||
arp++;
|
clear_step = clear_step || (bool) ((cap_read >> DEL) & 1);
|
||||||
while (kboard[arp] == LOW) {
|
arpeggiating = (bool) ((cap_read >> ARP) & 1);
|
||||||
arp++;
|
overwrite = digitalRead(OW);
|
||||||
if (arp == 49) arp = 0;
|
|
||||||
|
if (chan_up != (bool) ((cap_read >> 8) & 1)) { // Used to increase channel with a button because I don't have a rotary switch (yet!)
|
||||||
|
chan_up = (bool) ((cap_read >> 8) & 1);
|
||||||
|
if (chan_up == HIGH) {
|
||||||
|
channel++;
|
||||||
|
if (channel > 6) channel = (byte) 1;
|
||||||
}
|
}
|
||||||
playNote(arp, HIGH);
|
|
||||||
}
|
}
|
||||||
if (semB > 0) {
|
|
||||||
semB--;
|
if (sem_beat > 0) {
|
||||||
playNote(arp, LOW);
|
sem_beat--;
|
||||||
|
|
||||||
|
if (sem_gate > 0) { // If step was shorter than GATE, close all open notes before next step
|
||||||
|
sem_gate--;
|
||||||
|
if (arpeggiating) playNote((arp[0]*NKEYS)+arp[1], LOW, channel);
|
||||||
|
for (int chan = 0; chan < 6; chan++) {
|
||||||
|
if (current[chan] == NULL) continue;
|
||||||
|
for (int i = 0; i < NOCTAVES; i++)
|
||||||
|
for (int j = 0; j < NKEYS; j++) // IF note was played AND user is not playing on this channel AND this note is not kept played
|
||||||
|
if (((current[chan]->kboard_s[i] >> j) & 1) && !(chan+1 != channel && ((kboard[i]>>j) & 1)) && !((current[chan]->next->kboard_s[i] >> j) & 1))
|
||||||
|
playNote((i*NKEYS)+j, LOW, (byte) chan+1);
|
||||||
|
|
||||||
|
for (int i = 0; i < MAXDPAD; i++)
|
||||||
|
if (((current[chan]->dpad_s >> i) & 1) && !(chan+1 != channel && ((dpad>>i) & 1)))
|
||||||
|
playDrum(i, LOW, (byte) chan+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (plus_step && minus_step) {
|
||||||
|
plus_step = LOW;
|
||||||
|
minus_step = LOW;
|
||||||
|
}
|
||||||
|
if (plus_step) {
|
||||||
|
plus_step = LOW;
|
||||||
|
if (nstep[channel-1] < MAXSTEP) insertStep(channel-1);
|
||||||
|
}
|
||||||
|
if (minus_step) {
|
||||||
|
minus_step = LOW;
|
||||||
|
if (nstep[channel-1] > 0) deleteStep(channel-1);
|
||||||
|
}
|
||||||
|
if (clear_step) {
|
||||||
|
clear_step = LOW;
|
||||||
|
if (current[channel-1] != NULL) {
|
||||||
|
for (int i = 0; i < NOCTAVES; i++) current[channel-1]->kboard_s[i] = 0;
|
||||||
|
current[channel-1]->dpad_s = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nextStep(); // ALL STEPS INCREMENTED
|
||||||
|
display(current[channel-1]->stepnumber);
|
||||||
|
|
||||||
|
if (arpeggiating) {
|
||||||
|
while (npressed > 0) {
|
||||||
|
arp[1]++;
|
||||||
|
if (arp[1] == NKEYS) {
|
||||||
|
arp[1] = 0;
|
||||||
|
arp[0]++;
|
||||||
|
}
|
||||||
|
if (arp[0] == NOCTAVES) arp[0] = 0;
|
||||||
|
|
||||||
|
if ((kboard[arp[0]] >> arp[1]) & 1) {
|
||||||
|
playNote((arp[0]*NKEYS)+arp[1], HIGH, channel);
|
||||||
|
if (overwrite && current[channel-1] != NULL) {
|
||||||
|
for (int i=0; i<NOCTAVES; i++) current[channel-1]->kboard_s[i] = 0;
|
||||||
|
current[channel-1]->kboard_s[arp[0]] = current[channel-1]->kboard_s[arp[0]] | (1 << arp[1]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int chan = 0; chan < 6; chan++) {
|
||||||
|
if (mute[chan]) continue;
|
||||||
|
if (current[chan] != NULL) { // PLAY all step notes in all unmuted channels
|
||||||
|
for (int i = 0; i < NOCTAVES; i++)
|
||||||
|
for (int j = 0; j < NKEYS; j++)
|
||||||
|
if (((current[chan]->kboard_s[i] >> j) & 1) && !(chan+1 == channel && npressed > 0))
|
||||||
|
playNote((i*NKEYS)+j, HIGH, (byte) chan+1);
|
||||||
|
|
||||||
|
for (int i = 0; i < MAXDPAD; i++) // Drums are played nonetheless because drums already layered won't overrule
|
||||||
|
if ((current[chan]->dpad_s >> i) & 1)
|
||||||
|
playDrum(i, HIGH, (byte) chan+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
last_gate = millis();
|
||||||
|
sem_gate++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sem_gate > 0 && (millis() - last_gate) > gate_length) {
|
||||||
|
sem_gate--;
|
||||||
|
if (arpeggiating) playNote((arp[0]*NKEYS)+arp[1], LOW, channel);
|
||||||
|
for (int chan = 0; chan < 6; chan++) {
|
||||||
|
if (current[chan] == NULL) continue;
|
||||||
|
for (int i = 0; i < NOCTAVES; i++)
|
||||||
|
for (int j = 0; j < NKEYS; j++)
|
||||||
|
if (((current[chan]->kboard_s[i] >> j) & 1) && !(chan+1 != channel && ((kboard[i]>>j) & 1)))
|
||||||
|
playNote((i*NKEYS)+j, LOW, (byte) chan+1);
|
||||||
|
|
||||||
|
for (int i = 0; i < MAXDPAD; i++)
|
||||||
|
if (((current[chan]->dpad_s >> i) & 1) && !(chan+1 != channel && ((dpad>>i) & 1)))
|
||||||
|
playDrum(i, LOW, (byte) chan+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dpadhit = LOW;
|
||||||
|
difference = dpad ^ cap_read;
|
||||||
|
for (int c = 0; c < MAXDPAD; c++) {
|
||||||
|
if ((difference>>c) & 1) playDrum(c, ((cap_read>>c) & 1), channel);
|
||||||
|
if (dpadhit || ((cap_read>>c) & 1)) dpadhit = HIGH;
|
||||||
|
if (difference != 0) dpad = cap_read;
|
||||||
|
}
|
||||||
|
|
||||||
|
npressed = 0;
|
||||||
|
for (int cOCTAVE = 0; cOCTAVE < 4; cOCTAVE++) {
|
||||||
|
digitalWrite(OCTAVE[cOCTAVE], HIGH);
|
||||||
|
npressed += eval(scan(), cOCTAVE);
|
||||||
|
digitalWrite(OCTAVE[cOCTAVE], LOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current[channel-1] != NULL && overwrite) {
|
||||||
|
if (!arpeggiating && npressed > 0)
|
||||||
|
for (int i = 0; i < NOCTAVES; i++) {
|
||||||
|
difference = kboard[i] ^ current[channel-1]->kboard_s[i];
|
||||||
|
if (difference != 0) current[channel-1]->kboard_s[i] = kboard[i];
|
||||||
|
}
|
||||||
|
if (dpadhit) current[channel-1]->dpad_s = current[channel-1]->dpad_s | dpad; // Drum hits aren't exclusive!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hardware specific functions
|
||||||
|
|
||||||
octst scan(int nOct) { // This function reads the 12 note pins and returns a struct
|
int scan() { // This function reads the 12 NOTE pins and returns a struct
|
||||||
int c; // with 1 bool for each note
|
int output = 0;
|
||||||
octst output;
|
for (int c = 0; c < NKEYS; c++) {
|
||||||
|
if (digitalRead(NOTE[c])) output = output | (1<<c);
|
||||||
output.nOct = nOct;
|
|
||||||
|
|
||||||
for (c = 0; c < 12; c++) {
|
|
||||||
output.stat[c] = digitalRead(note[c]);
|
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
int eval(octst input) {
|
void display(int number){
|
||||||
|
for(int i = 0; i < NBITS; i++) {
|
||||||
|
digitalWrite(LEDS[i], number & (unsigned short) 1);
|
||||||
|
number = number >> 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NOTE Functions
|
||||||
|
|
||||||
|
int eval(int input, int nOct) {
|
||||||
int pressed = 0;
|
int pressed = 0;
|
||||||
int snote = input.nOct * 12;
|
int sNOTE = nOct * 12;
|
||||||
|
difference = kboard[nOct] ^ input;
|
||||||
|
|
||||||
for (int c = 0; c < 12; c++) {
|
for (int c = 0; c < 12; c++) {
|
||||||
if (input.stat[c] ^ kboard[c + snote]) {
|
if (!arpeggiating && ((difference>>c) & 1)) playNote(c + sNOTE, ((input>>c) & 1), channel);
|
||||||
if (raw) playNote(c + snote, input.stat[c]);
|
if (((input>>c) & 1)) pressed++;
|
||||||
kboard[c + snote] = input.stat[c];
|
|
||||||
}
|
|
||||||
if (kboard[c + snote] == HIGH) pressed++;
|
|
||||||
}
|
}
|
||||||
|
if (difference != 0) kboard[nOct] = input;
|
||||||
return pressed;
|
return pressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void playNote(int c, bool status) {
|
void playNote(int c, bool status, byte chan) {
|
||||||
byte n = c + noteOffset;
|
byte n = c + NOTEOffset;
|
||||||
if (status == HIGH) {
|
if (status == HIGH) {
|
||||||
MIDI.sendNoteOn(n, velocity, channel);
|
MIDI.sendNoteOn(n, velocity, chan);
|
||||||
}
|
}
|
||||||
else if (status == LOW) {
|
else if (status == LOW) {
|
||||||
MIDI.sendNoteOff(n, velocity, channel);
|
MIDI.sendNoteOff(n, velocity, chan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool evalButton(CapacitiveSensor* b, bool value, byte note) {
|
void playDrum(int c, bool status, byte chan) {
|
||||||
long sensor = b->capacitiveSensor(1);
|
// The note is first quantized to a pentathonic and then scaled up to start at C4.
|
||||||
|
byte n = (byte) (pentathonic[c] + drumOffset);
|
||||||
if (sensor > 15) {
|
if (status == HIGH) {
|
||||||
if (value) return HIGH;
|
MIDI.sendNoteOn(n, velocity, chan + (byte) DRUMSHIFT);
|
||||||
else {
|
|
||||||
MIDI.sendNoteOn(note, velocity, (byte)7);
|
|
||||||
return HIGH;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else if (status == LOW) {
|
||||||
if (!value) return LOW;
|
MIDI.sendNoteOff(n, velocity, chan + (byte) DRUMSHIFT);
|
||||||
else {
|
|
||||||
MIDI.sendNoteOff(note, velocity, (byte)7);
|
|
||||||
return LOW;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sync functions
|
||||||
|
|
||||||
void sync() {
|
void sync() {
|
||||||
if (Serial.available() && Serial.read() == MIDICLOCK) {
|
|
||||||
midiclock++;
|
if (millis() > last_save + (unsigned long) MINUTE*INTERVAL) {
|
||||||
if (midiclock == 11 && semA == 0) semA++;
|
saveAll();
|
||||||
else if (midiclock == 5 && semB == 0) semB++;
|
last_save = millis();
|
||||||
else if (midiclock == 12) midiclock = 0;
|
}
|
||||||
|
|
||||||
|
if (next_step != (bool) !digitalRead(NEXT)) { // Used to increase channel with a button because I don't have a rotary switch (yet!)
|
||||||
|
next_step = (bool) !digitalRead(NEXT);
|
||||||
|
if (millis() > last_next+DEBOUNCE && next_step == HIGH) {
|
||||||
|
last_next = millis();
|
||||||
|
sem_beat++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Serial.available()) {
|
||||||
|
if (Serial.read() == MIDICLOCK) {
|
||||||
|
//sem_beat++;
|
||||||
|
midiclock++;
|
||||||
|
if (midiclock == BPQN) {
|
||||||
|
midiclock = 0;
|
||||||
|
sem_beat++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// List management functions
|
||||||
|
|
||||||
|
link newStep() {
|
||||||
|
return (link)malloc(sizeof(struct SequencerStep));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool insertStep(byte chan) {
|
||||||
|
// Creates a new enpty step and places it as next step in the channel passed as argument
|
||||||
|
link newS = newStep();
|
||||||
|
link buffer;
|
||||||
|
|
||||||
|
if (newS == NULL) {
|
||||||
|
display(63);
|
||||||
|
delay(500);
|
||||||
|
return LOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < NOCTAVES; i++) newS->kboard_s[i] = 0;
|
||||||
|
newS->dpad_s = 0;
|
||||||
|
|
||||||
|
if (head[chan] == NULL) {
|
||||||
|
newS->next = newS;
|
||||||
|
newS->stepnumber = (unsigned short) 0;
|
||||||
|
current[chan] = newS;
|
||||||
|
head[chan] = newS;
|
||||||
|
nstep[chan] = 1;
|
||||||
|
return HIGH;
|
||||||
|
}
|
||||||
|
|
||||||
|
newS->stepnumber = current[chan]->stepnumber +1;
|
||||||
|
buffer = current[chan]->next;
|
||||||
|
current[chan]->next = newS;
|
||||||
|
newS->next = buffer;
|
||||||
|
|
||||||
|
int c = 0;
|
||||||
|
buffer = head[chan];
|
||||||
|
|
||||||
|
buffer->stepnumber = c;
|
||||||
|
c++;
|
||||||
|
buffer = buffer->next;
|
||||||
|
while(buffer != head[chan]) {
|
||||||
|
buffer->stepnumber = c;
|
||||||
|
c++;
|
||||||
|
buffer = buffer->next;
|
||||||
|
}
|
||||||
|
nstep[chan] = c;
|
||||||
|
|
||||||
|
return HIGH;
|
||||||
|
}
|
||||||
|
|
||||||
|
void nextStep() {
|
||||||
|
for (int chan=0; chan < 6; chan++) {
|
||||||
|
if (head[chan] == NULL) continue;
|
||||||
|
current[chan] = current[chan]->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool deleteStep(byte chan) {
|
||||||
|
if (nstep[chan] < 1) return LOW;
|
||||||
|
|
||||||
|
if (nstep[chan] == 1) {
|
||||||
|
free(current[chan]);
|
||||||
|
head[chan] = NULL;
|
||||||
|
current[chan] = NULL;
|
||||||
|
return HIGH;
|
||||||
|
}
|
||||||
|
|
||||||
|
link buffer = current[chan];
|
||||||
|
while (buffer->next != current[chan]) buffer = buffer->next; // Search for previous step
|
||||||
|
buffer->next = current[chan]->next; // Skip step which is being deleted
|
||||||
|
if (current[chan] == head[chan]) head[chan] = head[chan]->next; // If deleting head, head moves forward
|
||||||
|
free(current[chan]); // Step is actually deleted
|
||||||
|
current[chan] = buffer; // Current step becomes previous step
|
||||||
|
|
||||||
|
int c = 0;
|
||||||
|
buffer = head[chan];
|
||||||
|
|
||||||
|
buffer->stepnumber = c;
|
||||||
|
c++;
|
||||||
|
buffer = buffer->next;
|
||||||
|
while(buffer != head[chan]) {
|
||||||
|
buffer->stepnumber = c;
|
||||||
|
c++;
|
||||||
|
buffer = buffer->next;
|
||||||
|
}
|
||||||
|
nstep[chan] = c;
|
||||||
|
return HIGH;
|
||||||
|
}
|
||||||
|
|
||||||
|
// SAVING FUNCTIONS
|
||||||
|
|
||||||
|
void saveAll() {
|
||||||
|
int currAddr = (int) sizeof(save_p);
|
||||||
|
link buffer;
|
||||||
|
|
||||||
|
for (int c=0; c<MAXCHANNEL; c++) {
|
||||||
|
display(loadingDisplay[c]);
|
||||||
|
if (current[c] == NULL) {
|
||||||
|
saveH.headAddr[c] = -1;
|
||||||
|
saveH.tailAddr[c] = -1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
buffer = head[c];
|
||||||
|
saveH.headAddr[c] = currAddr;
|
||||||
|
currAddr = saveStep(buffer, currAddr);
|
||||||
|
buffer = buffer->next;
|
||||||
|
while (buffer != head[c]) {
|
||||||
|
currAddr = saveStep(buffer, currAddr);
|
||||||
|
buffer = buffer->next;
|
||||||
|
}
|
||||||
|
saveH.tailAddr[c] = currAddr;
|
||||||
|
}
|
||||||
|
saveHead(saveH);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loadAll() {
|
||||||
|
saveH = loadHead();
|
||||||
|
int currAddr = saveH.headAddr[0];
|
||||||
|
link buffer;
|
||||||
|
for (int c=0; c<MAXCHANNEL; c++) {
|
||||||
|
display(loadingDisplay[c]);
|
||||||
|
if (saveH.headAddr[c] < 0) continue;
|
||||||
|
head[c] = newStep();
|
||||||
|
current[c] = head[c];
|
||||||
|
currAddr = saveH.headAddr[c];
|
||||||
|
currAddr = loadStep(head[c], currAddr);
|
||||||
|
buffer = head[c];
|
||||||
|
while (currAddr < saveH.tailAddr[c]) {
|
||||||
|
link newS = newStep();
|
||||||
|
currAddr = loadStep(newS, currAddr);
|
||||||
|
buffer->next = newS;
|
||||||
|
buffer = newS;
|
||||||
|
}
|
||||||
|
buffer->next = head[c];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
save_p loadHead() {
|
||||||
|
save_p save;
|
||||||
|
byte* pointer = (byte*) (void*) &save;
|
||||||
|
int addr = 0;
|
||||||
|
for (int i=0; i < (int) sizeof(save_p); i++) {
|
||||||
|
*pointer = EEPROM.read(addr);
|
||||||
|
addr++;
|
||||||
|
pointer++;
|
||||||
|
}
|
||||||
|
return save;
|
||||||
|
}
|
||||||
|
|
||||||
|
void saveHead(save_p save) {
|
||||||
|
byte* pointer = (byte*) (void*) &save;
|
||||||
|
int addr = 0;
|
||||||
|
for (int i=0; i < (int) sizeof(save_p); i++){
|
||||||
|
EEPROM.update(addr, *pointer);
|
||||||
|
addr++;
|
||||||
|
pointer++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int saveStep(link curr_step, int addr) {
|
||||||
|
step buffer = *curr_step;
|
||||||
|
buffer.next = (link) (addr + (int) sizeof(SequencerStep));
|
||||||
|
byte* pointer = (byte*) (void*) &buffer;
|
||||||
|
for (int i=0; i < (int) sizeof(SequencerStep); i++) {
|
||||||
|
EEPROM.update(addr, *pointer);
|
||||||
|
pointer++;
|
||||||
|
addr++;
|
||||||
|
}
|
||||||
|
return addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
int loadStep(link step, int addr) {
|
||||||
|
byte* pointer = (byte*) (void*) step;
|
||||||
|
for (int i=0; i<(int) sizeof(SequencerStep); i++) {
|
||||||
|
*pointer = EEPROM.read(addr);
|
||||||
|
pointer++;
|
||||||
|
addr++;
|
||||||
|
}
|
||||||
|
return addr;
|
||||||
|
}
|
256
hex/Arduino-usbserial-mega.hex
Normal file
256
hex/Arduino-usbserial-mega.hex
Normal file
|
@ -0,0 +1,256 @@
|
||||||
|
:10000000A2C00000BBC00000B9C00000B7C0000023
|
||||||
|
:10001000B5C00000B3C00000B1C00000AFC0000018
|
||||||
|
:10002000ADC00000ABC00000A9C000005AC4000071
|
||||||
|
:100030001EC40000A3C00000A1C000009FC00000BB
|
||||||
|
:100040009DC000009BC0000099C0000097C0000048
|
||||||
|
:1000500095C0000093C0000091C0000014C10000D2
|
||||||
|
:100060008DC000008BC0000089C0000087C0000068
|
||||||
|
:1000700085C0000083C0000081C000007FC0000078
|
||||||
|
:100080007DC000007BC0000079C0000077C0000088
|
||||||
|
:1000900075C0000073C000001201100102000008CA
|
||||||
|
:1000A0004123100001000102DC0109023E000201AF
|
||||||
|
:1000B00000C0320904000001020201000524000111
|
||||||
|
:1000C0001004240206052406000107058203080027
|
||||||
|
:1000D000FF09040100020A000000070504024000B5
|
||||||
|
:1000E00001070583024000010403090432034100B3
|
||||||
|
:1000F00072006400750069006E006F002000280027
|
||||||
|
:100100007700770077002E006100720064007500B0
|
||||||
|
:1001100069006E006F002E0063006300290000007C
|
||||||
|
:100120002403410072006400750069006E006F00D6
|
||||||
|
:1001300020004D006500670061002000320035009E
|
||||||
|
:1001400036003000000011241FBECFEFD2E0DEBF2A
|
||||||
|
:10015000CDBF11E0A0E0B1E0E0EDFFE002C005900E
|
||||||
|
:100160000D92A631B107D9F712E0A6E1B1E001C0C6
|
||||||
|
:100170001D92AF32B107E1F7F1D028C741CF9C0102
|
||||||
|
:10018000DC01AE57BF4FED91FC9111974191119653
|
||||||
|
:10019000FC93EE9380589F4FE817F90711F42D93C5
|
||||||
|
:1001A0003C939FB7F894F901EC57FF4F8081815041
|
||||||
|
:1001B00080839FBF842F0895DF92EF92FF920F9369
|
||||||
|
:1001C0001F93FC018489813019F0823021F405C02D
|
||||||
|
:1001D00040E3D42E04C0DD2402C030E2D32E838954
|
||||||
|
:1001E000823011F488E0D82A8589873031F0883050
|
||||||
|
:1001F00031F0863031F482E003C084E001C086E053
|
||||||
|
:10020000D82A1092C9001092C8001092CA00E78440
|
||||||
|
:10021000F0880189128980E0E81681EEF80680E016
|
||||||
|
:10022000080780E0180719F420E130E00FC0C8018A
|
||||||
|
:10023000B701969587957795679560587B47814E6E
|
||||||
|
:100240009F4FA8019701A0D6215030403093CD0098
|
||||||
|
:100250002093CC00D092CA0080E0E81681EEF80628
|
||||||
|
:1002600080E0080780E0180711F082E001C080E01C
|
||||||
|
:100270008093C80088E98093C9001F910F91FF9077
|
||||||
|
:10028000EF90DF9008951F920F920FB60F921124F6
|
||||||
|
:100290002F938F939F93EF93FF939091CE008EB304
|
||||||
|
:1002A0008430F1F4E0919901F0919A019083E0910A
|
||||||
|
:1002B0009901F0919A01CF01019690939A01809350
|
||||||
|
:1002C00099018959914021F489E191E092838183D8
|
||||||
|
:1002D0009FB7F89480919D018F5F80939D019FBF90
|
||||||
|
:1002E000FF91EF919F918F912F910F900FBE0F90E3
|
||||||
|
:1002F0001F901895FC01858580FF02C05F980895C6
|
||||||
|
:100300005F9A089580E091E0D5C580E091E088C5CE
|
||||||
|
:1003100084B7877F84BF28E10FB6F89420936000EC
|
||||||
|
:10032000109260000FBE87E690E09093CD0080931E
|
||||||
|
:10033000CC0086E08093CA001092C8002093C900C8
|
||||||
|
:10034000539A5A9A8AB180638AB98BB180638BB908
|
||||||
|
:1003500083D284E085BD5F9A579A08950F931F93C7
|
||||||
|
:10036000CF93DF93D5DF2FB7F8948EE991E0909388
|
||||||
|
:100370001F0280931E0290932102809320022FBFC0
|
||||||
|
:100380002FB7F89489E191E090939A0180939901B5
|
||||||
|
:1003900090939C0180939B012FBF7894CEE9D1E08C
|
||||||
|
:1003A00003E08FB7F894909122028FBF903809F143
|
||||||
|
:1003B00080E091E0ABD497FD1CC0E0911E02F0916B
|
||||||
|
:1003C0001F028083E0911E02F0911F02CF0101966F
|
||||||
|
:1003D00090931F0280931E028E51924011F4D2839B
|
||||||
|
:1003E000C1839FB7F894809122028F5F809322028D
|
||||||
|
:1003F0009FBF8FB7F89410919D018FBFA89902C03D
|
||||||
|
:10040000113678F1A89A80919D01882361F05D985A
|
||||||
|
:100410000093160108C089E191E0B1DE682F80E009
|
||||||
|
:1004200091E0DAD411501123B1F78091160188239D
|
||||||
|
:1004300051F0809116018150809316018091160130
|
||||||
|
:10044000882309F45D9A80911701882351F08091E7
|
||||||
|
:10045000170181508093170180911701882309F4B7
|
||||||
|
:100460005C9A8FB7F894909122028FBF992369F01C
|
||||||
|
:100470008EE991E084DE982F8091C80085FFFCCF43
|
||||||
|
:100480009093CE005C980093170180E091E095D4A2
|
||||||
|
:100490002AD487CFDA01923049F0933061F091305D
|
||||||
|
:1004A000F9F4E8E9F0E022E130E01EC0EAEAF0E029
|
||||||
|
:1004B0002EE330E019C0813049F0813018F08230ED
|
||||||
|
:1004C00079F408C0E8EEF0E0849107C0ECEEF0E0CB
|
||||||
|
:1004D000849103C0E0E2F1E08491282F30E004C071
|
||||||
|
:1004E000E0E0F0E020E030E0ED93FC93C9010895F6
|
||||||
|
:1004F00028E030E040E003C04F5F220F331F281791
|
||||||
|
:100500003907D0F3842F8295807F08958093E90086
|
||||||
|
:100510008091EB0081608093EB001092ED0060937E
|
||||||
|
:10052000EC004093ED008091EE00881F8827881F23
|
||||||
|
:1005300008951092F40090E09093E9001092F0007A
|
||||||
|
:100540001092E8001092ED008091EB008E7F809376
|
||||||
|
:10055000EB009F5F953081F70895809127028823F3
|
||||||
|
:100560008CF403C08EB38823B1F08091E80082FF41
|
||||||
|
:10057000F9CF8091E8008B778093E80008958EB3DF
|
||||||
|
:10058000882349F08091E80080FFF9CF8091E8004E
|
||||||
|
:100590008E778093E800089594E68091EC0080FFC8
|
||||||
|
:1005A00005C08091E80080FF05C023C08091E8006D
|
||||||
|
:1005B00082FD1FC08EB3882311F482E008958EB3AC
|
||||||
|
:1005C000853011F483E008958091EB0085FF02C02F
|
||||||
|
:1005D00081E008958091E10082FFDFCF8091E1000A
|
||||||
|
:1005E0008B7F8093E100992311F484E0089591506A
|
||||||
|
:1005F000D4CF80E008959C0140912D0250912E02AD
|
||||||
|
:100600004617570718F4F90120E038C06115710545
|
||||||
|
:1006100011F0AB01F8CF8091E8008E778093E8006D
|
||||||
|
:1006200040E050E0F0CF8091E80083FF02C081E01D
|
||||||
|
:1006300008958091E80082FD2DC08EB3882381F15A
|
||||||
|
:100640008EB3853079F18091E80080FF17C09091DA
|
||||||
|
:10065000F20006C081918093F100415050409F5FAD
|
||||||
|
:100660004115510511F09830A8F320E0983009F4B5
|
||||||
|
:1006700021E08091E8008E778093E80041155105D4
|
||||||
|
:1006800091F6222381F606C08EB3882349F08EB3FB
|
||||||
|
:10069000853041F08091E80082FFF6CF80E0089538
|
||||||
|
:1006A00082E0089583E008959C0140912D025091CD
|
||||||
|
:1006B0002E024617570710F490E03BC061157105F4
|
||||||
|
:1006C00011F0AB01F9CF8091E8008E778093E800BC
|
||||||
|
:1006D00040E050E0F1CF8091E80083FF02C081E06C
|
||||||
|
:1006E00008958091E80082FD30C08EB3882399F18F
|
||||||
|
:1006F0008EB3853091F18091E80080FF1AC080911F
|
||||||
|
:10070000F20009C0F9012F5F3F4FE491E093F1003F
|
||||||
|
:10071000415050408F5F4115510511F0883090F3E2
|
||||||
|
:1007200090E0883009F491E08091E8008E77809322
|
||||||
|
:10073000E8004115510579F6992369F606C08EB394
|
||||||
|
:10074000882349F08EB3853041F08091E80082FF24
|
||||||
|
:10075000F6CF80E0089582E0089583E008959C013B
|
||||||
|
:100760006115710529F48091E8008B778093E8008A
|
||||||
|
:10077000F90120C08091E80083FF02C081E0089564
|
||||||
|
:100780008EB3882339F18EB3853031F18091E80042
|
||||||
|
:1007900082FFF0CF06C08091F100819361507040DC
|
||||||
|
:1007A00021F08091F2008823B1F78091E8008B77E7
|
||||||
|
:1007B0008093E80061157105E9F606C08EB38823C1
|
||||||
|
:1007C00049F08EB3853041F08091E80080FFF6CF8C
|
||||||
|
:1007D00080E0089582E0089583E0089542D044D0F7
|
||||||
|
:1007E0001EBA10922502109224021092230284E075
|
||||||
|
:1007F00089BD89B5826089BD09B400FEFDCF8091B5
|
||||||
|
:10080000D800982F9F779093D80080688093D80065
|
||||||
|
:10081000809163008E7F809363008091D8008F7DEC
|
||||||
|
:100820008093D8008091E0008E7F8093E0008091DB
|
||||||
|
:10083000E1008E7F8093E1008091E20081608093EF
|
||||||
|
:10084000E2008091E100877F8093E1008091E200E7
|
||||||
|
:1008500088608093E2000895C1DF81E080932602E2
|
||||||
|
:1008600008951092E20008951092E10008951F92F9
|
||||||
|
:100870000F920FB60F9211241F932F933F934F9314
|
||||||
|
:100880005F936F937F938F939F93AF93BF93EF93F8
|
||||||
|
:10089000FF93E9EEF0E0108117701082E0EFF0E0D6
|
||||||
|
:1008A0008081877F80837894C3D0F894A9EEB0E0EC
|
||||||
|
:1008B0001C92E0EFF0E08081886080831C93FF91C0
|
||||||
|
:1008C000EF91BF91AF919F918F917F916F915F91C8
|
||||||
|
:1008D0004F913F912F911F910F900FBE0F901F903E
|
||||||
|
:1008E00018951F920F920FB60F9211242F933F93DA
|
||||||
|
:1008F0004F935F936F937F938F939F93AF93BF9328
|
||||||
|
:10090000EF93FF938091E10080FF1BC08091E20094
|
||||||
|
:1009100080FF17C08091E1008E7F8093E10080917D
|
||||||
|
:10092000E2008E7F8093E2008091E20080618093FC
|
||||||
|
:10093000E2008091D80080628093D80019BC1EBA72
|
||||||
|
:10094000D1D18091E10084FF29C08091E20084FF31
|
||||||
|
:1009500025C084E089BD89B5826089BD09B400FEE7
|
||||||
|
:10096000FDCF8091D8008F7D8093D8008091E100E9
|
||||||
|
:100970008F7E8093E1008091E2008F7E8093E20081
|
||||||
|
:100980008091E20081608093E200809125028823BB
|
||||||
|
:1009900011F481E001C084E08EBBA4D18091E1001C
|
||||||
|
:1009A00083FF27C08091E20083FF23C08091E10094
|
||||||
|
:1009B000877F8093E10082E08EBB109225028091B8
|
||||||
|
:1009C000E1008E7F8093E1008091E2008E7F809332
|
||||||
|
:1009D000E2008091E20080618093E200AADD80E085
|
||||||
|
:1009E00060E042E093DD8091F00088608093F00049
|
||||||
|
:1009F00079D18091E10082FF0AC08091E20082FFFC
|
||||||
|
:100A000006C08091E1008B7F8093E1006BD1FF9164
|
||||||
|
:100A1000EF91BF91AF919F918F917F916F915F9176
|
||||||
|
:100A20004F913F912F910F900FBE0F901F901895EF
|
||||||
|
:100A30001F93DF93CF93CDB7DEB7AC970FB6F89483
|
||||||
|
:100A4000DEBF0FBECDBFE7E2F2E08091F1008193FF
|
||||||
|
:100A500022E0EF32F207C9F7809127023091280295
|
||||||
|
:100A6000353009F487C0363040F43130C9F13130C7
|
||||||
|
:100A700070F0333009F01DC133C0383009F4EFC0D5
|
||||||
|
:100A8000393009F4FEC0363009F013C192C0803805
|
||||||
|
:100A900021F0823809F00DC108C0909123028091A5
|
||||||
|
:100AA0002402882399F0926011C080912B028770F4
|
||||||
|
:100AB0008093E9008091EB0090E025E09695879582
|
||||||
|
:100AC0002A95E1F7982F91701092E9008091E80043
|
||||||
|
:100AD000877F8093E8009093F1001092F100CAC0E4
|
||||||
|
:100AE000882319F0823009F0E4C090E08F71907093
|
||||||
|
:100AF000009721F0029709F0DDC00CC08091290217
|
||||||
|
:100B0000813009F0D7C010922402333069F5809308
|
||||||
|
:100B100024022AC080912902882331F520912B02DA
|
||||||
|
:100B2000277009F4C7C02093E9008091EB0080FF93
|
||||||
|
:100B3000C1C0333021F48091EB00806213C08091FA
|
||||||
|
:100B4000EB0080618093EB0081E090E002C0880FB1
|
||||||
|
:100B5000991F2A95E2F78093EA001092EA008091AB
|
||||||
|
:100B6000EB0088608093EB001092E9008091E80030
|
||||||
|
:100B7000877F83C0882309F09CC01091290280914F
|
||||||
|
:100B8000E800877F8093E800E8DC04C08EB3882308
|
||||||
|
:100B900009F490C08091E80080FFF8CF812F8F7713
|
||||||
|
:100BA00011F492E001C093E09EBB80688093E30063
|
||||||
|
:100BB00081C08058823008F07CC0809129029091D9
|
||||||
|
:100BC0002A0223E08C3D920799F55FB7F894DE0185
|
||||||
|
:100BD00015964EE020E030E061E2E42FF0E0609313
|
||||||
|
:100BE0005700849120FF03C082958F704F5F982F2C
|
||||||
|
:100BF0009F70892F805D8A3308F0895F8C931196EE
|
||||||
|
:100C00001C9211972F5F3F4F12962431310529F71F
|
||||||
|
:100C10005FBF8AE28B8383E08C838091E800877FCB
|
||||||
|
:100C20008093E800CE0103966AE270E0E4DC11C034
|
||||||
|
:100C300060912B02AE014F5F5F4F2CDCBC0100972F
|
||||||
|
:100C4000C9F18091E800877F8093E80089819A81CB
|
||||||
|
:100C50002BDD8091E8008B778093E8002BC08038F3
|
||||||
|
:100C600041F58091E800877F8093E800809125021C
|
||||||
|
:100C70008093F1008091E8008E778093E8006DDC2E
|
||||||
|
:100C800019C08823B1F490912902923098F4809190
|
||||||
|
:100C9000E800877F8093E800909325025EDC8091D6
|
||||||
|
:100CA0002502882311F483E001C084E08EBB2DDB94
|
||||||
|
:100CB00001C028DB8091E80083FF0AC08091EB002F
|
||||||
|
:100CC00080628093EB008091E800877F8093E8004A
|
||||||
|
:100CD000AC960FB6F894DEBF0FBECDBFCF91DF91BB
|
||||||
|
:100CE0001F91089508951F938EB3882361F010918A
|
||||||
|
:100CF000E9001092E9008091E80083FF01C098DECE
|
||||||
|
:100D000017701093E9001F9108950895FC018EB3A8
|
||||||
|
:100D1000843021F587859089A189B2890097A10542
|
||||||
|
:100D2000B105E1F085818093E9008091E80082FFC0
|
||||||
|
:100D300015C08091F200882319F42FEF3FEF04C013
|
||||||
|
:100D40008091F100282F30E08091F200882341F457
|
||||||
|
:100D50008091E8008B778093E80002C02FEF3FEF8F
|
||||||
|
:100D6000C9010895FC018EB3843011F587859089FF
|
||||||
|
:100D7000A189B2890097A105B105D1F08181809345
|
||||||
|
:100D8000E9008091F2008823A9F09091E800809119
|
||||||
|
:100D9000E8008E778093E80095FD0CC0FDDB982F6E
|
||||||
|
:100DA000882349F48091E8008E778093E80003C09F
|
||||||
|
:100DB00092E001C090E0892F0895FC018EB3843049
|
||||||
|
:100DC00051F487859089A189B2890097A105B10561
|
||||||
|
:100DD00011F0CF01C7CF08951F93FC01162F8EB3DA
|
||||||
|
:100DE0008430D9F487859089A189B2890097A105BB
|
||||||
|
:100DF000B10599F081818093E9008091E80085FD3B
|
||||||
|
:100E000008C08091E8008E778093E800C5DB8823D6
|
||||||
|
:100E100029F41093F10080E001C082E01F91089551
|
||||||
|
:100E20000F931F93CF93DF93EC010D96FC0189E0A4
|
||||||
|
:100E3000DF011D928A95E9F72A813B8109818C8126
|
||||||
|
:100E4000882311F410E001C014E0C90151DB182B14
|
||||||
|
:100E50001260802F61E8412F59DB882329F12E8110
|
||||||
|
:100E60003F810D818885882311F410E001C014E0D2
|
||||||
|
:100E7000C9013EDB182B1260802F60E8412F46DB52
|
||||||
|
:100E8000882391F02A853B8509858C85882311F478
|
||||||
|
:100E900010E001C014E0C9012BDB182B1260802F79
|
||||||
|
:100EA00061EC412F33DB01C080E0DF91CF911F91D6
|
||||||
|
:100EB0000F910895CF93DF93EC018091E80083FFB9
|
||||||
|
:100EC00060C0888190E020912B0230912C0228177D
|
||||||
|
:100ED000390709F056C080912802813261F08232D0
|
||||||
|
:100EE00020F4803209F04DC019C0823269F183329A
|
||||||
|
:100EF00009F047C038C080912702813A09F041C00B
|
||||||
|
:100F00008091E800877F8093E800CE010F9667E02C
|
||||||
|
:100F100070E071DB8091E8008B7713C0809127022D
|
||||||
|
:100F2000813279F58091E800877F8093E800CE01D7
|
||||||
|
:100F30000F9667E070E013DCCE013ED98091E800A7
|
||||||
|
:100F40008E778093E8001DC0809127028132C9F41A
|
||||||
|
:100F50008091E800877F8093E800809129028D8747
|
||||||
|
:100F6000CE01C8D90DC080912702813251F4809101
|
||||||
|
:100F7000E800877F8093E800CE0160912902C5DEFA
|
||||||
|
:100F8000ECDADF91CF910895A1E21A2EAA1BBB1BC8
|
||||||
|
:100F9000FD010DC0AA1FBB1FEE1FFF1FA217B30745
|
||||||
|
:100FA000E407F50720F0A21BB30BE40BF50B661F5B
|
||||||
|
:100FB000771F881F991F1A9469F76095709580951F
|
||||||
|
:100FC00090959B01AC01BD01CF010895F894FFCF2E
|
||||||
|
:100FD0000003400000044000000208000000000080
|
||||||
|
:060FE0000000000000000B
|
||||||
|
:00000001FF
|
232
hex/arduino_midi.hex
Normal file
232
hex/arduino_midi.hex
Normal file
|
@ -0,0 +1,232 @@
|
||||||
|
:1000000096C00000AFC00000ADC00000ABC0000053
|
||||||
|
:10001000A9C00000A7C00000A5C00000A3C0000048
|
||||||
|
:10002000A1C000009FC000009DC0000006C50000E8
|
||||||
|
:1000300099C0000097C0000095C0000093C0000068
|
||||||
|
:1000400091C000008FC000008DC000008BC0000078
|
||||||
|
:1000500089C0000087C0000085C000008DC100007D
|
||||||
|
:1000600081C000007FC000007DC000007BC0000098
|
||||||
|
:1000700079C000001A036100720064007500690015
|
||||||
|
:100080006E006F005F006D00690064006900000091
|
||||||
|
:100090002003680069006400750069006E006F004D
|
||||||
|
:1000A0002000700072006F006A0065006300740039
|
||||||
|
:1000B00000000403090409026500020100C03209BE
|
||||||
|
:1000C00004000000010100000924010001090001F1
|
||||||
|
:1000D000010904010002010300000724010001419D
|
||||||
|
:1000E0000006240201010006240202020009240382
|
||||||
|
:1000F00001030102010009240302040101010009B6
|
||||||
|
:1001000005020240000500000525010101090581E5
|
||||||
|
:100110000240000500000525010103120110010045
|
||||||
|
:10012000000008EB03482001000102000100112437
|
||||||
|
:100130001FBECFEFD2E0DEBFCDBF11E0A0E0B1E047
|
||||||
|
:10014000E2E6FEE002C005900D92A030B107D9F7BB
|
||||||
|
:1001500021E0A0E0B1E001C01D92AD31B207E1F7AE
|
||||||
|
:10016000CAD07DC64DCF84B7877F84BF88E10FB6E4
|
||||||
|
:10017000F89480936000109260000FBE8FE190E0D1
|
||||||
|
:100180009093CD008093CC0086E08093CA001092BB
|
||||||
|
:10019000C800E9ECF0E088E18083539A5A9A84E041
|
||||||
|
:1001A00085BD108288E98083469A3E9A90E080E877
|
||||||
|
:1001B0000FB6F89480936100909361000FBE8AB1EE
|
||||||
|
:1001C000806F8AB98BB18F708BB928D45C985D9899
|
||||||
|
:1001D00008958BB18F70806A8BB908958BB18F7041
|
||||||
|
:1001E00080618BB90895CF9342E361E881E057D3F2
|
||||||
|
:1001F000C82F42E360E882E052D3882321F0CC2369
|
||||||
|
:1002000011F090E601C090E98BB18F70892B8BB90A
|
||||||
|
:10021000CF91089580911401843041F581E080935D
|
||||||
|
:10022000E9008091E80080FF21C0809108018823C7
|
||||||
|
:10023000E9F01092080140E050E064E070E084E0F2
|
||||||
|
:1002400091E0D6D11092040110920501109206019E
|
||||||
|
:10025000109207018091E8008E778093E8005D9806
|
||||||
|
:1002600088E893E190930301809302010895CF936E
|
||||||
|
:10027000DF9300D000D0CDB7DEB780911401843079
|
||||||
|
:1002800099F582E08093E9008091E80082FF2CC01C
|
||||||
|
:1002900040E050E064E070E0CE010196F1D18A8147
|
||||||
|
:1002A0009091C80095FFFCCF8093CE008B819091F8
|
||||||
|
:1002B000C80095FFFCCF8093CE008C819091C80040
|
||||||
|
:1002C00095FFFCCF8093CE005C9888E893E19093F3
|
||||||
|
:1002D0000101809300018091F200811105C080919D
|
||||||
|
:1002E000E8008B778093E8000F900F900F900F90AD
|
||||||
|
:1002F000DF91CF91089537DF78947894809102014F
|
||||||
|
:1003000090910301009731F001979093030180933E
|
||||||
|
:10031000020101C05D9A8091000190910101009756
|
||||||
|
:1003200031F00197909301018093000101C05C9A24
|
||||||
|
:100330009EDF70DF78D5E2CF87FF0CC09CE0980F7E
|
||||||
|
:10034000923040F0982F9B7F993F21F0803F18F426
|
||||||
|
:10035000807F089580E00895982F9F7E282F2F7C1E
|
||||||
|
:10036000203839F0803E29F081E0903C19F080E09F
|
||||||
|
:1003700001C081E0817008951F920F920FB60F9215
|
||||||
|
:1003800011242F933F934F935F936F937F938F939A
|
||||||
|
:100390009F93AF93BF93CF93DF93EF93FF9380919E
|
||||||
|
:1003A0001401843009F0DFC0C091CE0040910B01F0
|
||||||
|
:1003B000411178C0C0930D01D0910A018D2FBCDF8F
|
||||||
|
:1003C000CBDF882349F0C7FD07C0D0930D01C09350
|
||||||
|
:1003D0000E0181E080930B01C0910D018C2FACDFE9
|
||||||
|
:1003E000813F91F188F4803B89F138F4803971F1D3
|
||||||
|
:1003F000803A61F1803869F529C0803D29F1803E5D
|
||||||
|
:1004000029F1803C31F520C0883F69F030F4833F0A
|
||||||
|
:10041000D9F0E0F0863F39F01CC08A3FD0F08D3F24
|
||||||
|
:1004200010F08E3FB0F08FE080930401C09305017F
|
||||||
|
:10043000109206011092070181E08093080110924A
|
||||||
|
:100440000B01109209018FC092E001C093E09093DC
|
||||||
|
:10045000090190910B0160910901492F50E0262F6D
|
||||||
|
:1004600030E02150310942175307C4F082958F7054
|
||||||
|
:1004700080930401C093050180910E0180930601D1
|
||||||
|
:10048000633029F480910F018093070102C010921C
|
||||||
|
:10049000070110920B01109209011BC09F5F9093FE
|
||||||
|
:1004A0000B0161C0C7FF19C0CD3F28F4CA3F28F433
|
||||||
|
:1004B000C83F99F402C0CE3F80F08C2F3DDF82957B
|
||||||
|
:1004C0008F7080930401C093050110920601109271
|
||||||
|
:1004D000070181E08093080146C0242F30E0F90134
|
||||||
|
:1004E000E35FFE4FC083D09109018D2F90E001970B
|
||||||
|
:1004F00028173907ACF1C0910D018C2F1DDF982F03
|
||||||
|
:1005000092959F7090930401C093050190910E0104
|
||||||
|
:1005100090930601D33029F490910F019093070135
|
||||||
|
:1005200002C01092070110920B011092090191E094
|
||||||
|
:1005300090930801803B71F038F4803959F0803A8B
|
||||||
|
:1005400049F0803851F406C0803D21F0803E11F022
|
||||||
|
:10055000803C19F4C0930A0106C010920A0103C03E
|
||||||
|
:100560004F5F40930B01FF91EF91DF91CF91BF91CE
|
||||||
|
:10057000AF919F918F917F916F915F914F913F913B
|
||||||
|
:100580002F910F900FBE0F901F901895292F332792
|
||||||
|
:100590002230310559F02330310569F02130310521
|
||||||
|
:1005A000F9F482E190E02BE131E01EC085E690E0B5
|
||||||
|
:1005B00026EB30E019C099278130910541F0823057
|
||||||
|
:1005C000910541F0892B61F4E2EBF0E005C0E0E930
|
||||||
|
:1005D000F0E002C0E4E7F0E0849190E09F0104C005
|
||||||
|
:1005E00080E090E020E030E0FA013183208308953C
|
||||||
|
:1005F000CF92DF92EF92FF920F931F93CF93DF93EF
|
||||||
|
:100600007C018B01EA01A1D1811131C0209731F029
|
||||||
|
:1006100088819981081B190BE80EF91EC12CD12C79
|
||||||
|
:100620000115110519F18091E80085FD14C0809134
|
||||||
|
:10063000E8008E778093E800F6D3209741F0888118
|
||||||
|
:1006400099818C0D9D1D9983888385E010C07DD193
|
||||||
|
:10065000882331F30CC0F70181917F018093F10071
|
||||||
|
:1006600001501109FFEFCF1ADF0ADACF80E0DF91E6
|
||||||
|
:10067000CF911F910F91FF90EF90DF90CF90089551
|
||||||
|
:10068000CF92DF92EF92FF920F931F93CF93DF935E
|
||||||
|
:100690007C018B01EA0159D1811131C0209731F0E1
|
||||||
|
:1006A00088819981081B190BE80EF91EC12CD12CE9
|
||||||
|
:1006B0000115110519F18091E80085FD14C08091A4
|
||||||
|
:1006C000E8008B778093E800AED3209741F08881D3
|
||||||
|
:1006D00099818C0D9D1D9983888385E010C035D14B
|
||||||
|
:1006E000882331F30CC08091F100F70181937F01E1
|
||||||
|
:1006F00001501109FFEFCF1ADF0ADACF80E0DF9156
|
||||||
|
:10070000CF911F910F91FF90EF90DF90CF900895C0
|
||||||
|
:1007100020911B0130911C012617370748F0611505
|
||||||
|
:10072000710539F42091E8002E772093E80001C08C
|
||||||
|
:10073000B90120E061157105D1F130911401332325
|
||||||
|
:1007400009F443C0353009F442C03091E80033FD6C
|
||||||
|
:1007500040C03091E80032FF06C08091E80082FF7F
|
||||||
|
:1007600029C080E008953091E80030FFE3CF209168
|
||||||
|
:10077000F20030E0FC01281B390BCF01820F931FE0
|
||||||
|
:100780006115710549F08830910530F481918093AD
|
||||||
|
:10079000F10061507109F1CF21E0089709F020E0E4
|
||||||
|
:1007A0008091E8008E778093E800CF01C3CF2111BC
|
||||||
|
:1007B000C4CFD3CF80911401882339F0853039F02C
|
||||||
|
:1007C0008091E80083FFC9CF04C082E0089583E0F0
|
||||||
|
:1007D000089581E0089520911B0130911C01261796
|
||||||
|
:1007E000370748F06115710539F42091E8002E773C
|
||||||
|
:1007F0002093E80001C0B90120E061157105D9F12D
|
||||||
|
:1008000030911401332309F444C0353009F443C056
|
||||||
|
:100810003091E80033FD41C03091E80032FF06C05E
|
||||||
|
:100820008091E80082FF2AC080E008953091E800BE
|
||||||
|
:1008300030FFE3CF2091F20030E0FC01281B390BA0
|
||||||
|
:10084000C9018E0F9F1F6115710551F08830910508
|
||||||
|
:1008500038F484918093F100319661507109F0CFA2
|
||||||
|
:1008600021E0089709F020E08091E8008E778093DE
|
||||||
|
:10087000E800CF01C2CF2111C3CFD2CF80911401A4
|
||||||
|
:10088000882339F0853039F08091E80083FFC8CFA4
|
||||||
|
:1008900004C082E0089583E0089581E00895982FD0
|
||||||
|
:1008A000953058F59093E900981739F07091EC0065
|
||||||
|
:1008B0002091ED005091F00003C0242F762F50E0DE
|
||||||
|
:1008C00021FF19C03091EB003E7F3093EB00309157
|
||||||
|
:1008D000ED003D7F3093ED003091EB0031603093BF
|
||||||
|
:1008E000EB007093EC002093ED005093F00020910A
|
||||||
|
:1008F000EE0027FF07C09F5FD3CF8F708093E90082
|
||||||
|
:1009000081E0089580E008958091150187FD05C07C
|
||||||
|
:100910008091E80080FF0EC012C08091E80082FD47
|
||||||
|
:1009200005C0809114018111F8CF08958091E800ED
|
||||||
|
:100930008B7708C0809114018111EACF08958091CE
|
||||||
|
:10094000E8008E778093E80008958091E40090910C
|
||||||
|
:10095000E50045E62091EC0020FF21C02091E80051
|
||||||
|
:1009600020FD21C020911401222389F0253089F037
|
||||||
|
:100970002091EB0025FD0FC02091E4003091E500AF
|
||||||
|
:100980002817390739F3415041F0C901E3CF82E01C
|
||||||
|
:10099000089583E0089581E0089584E0089520910A
|
||||||
|
:1009A000E80022FFDFCF80E0089541D043D080915E
|
||||||
|
:1009B000D8008F778093D8008091D800806880938A
|
||||||
|
:1009C000D8008091D8008F7D8093D80084E089BDC5
|
||||||
|
:1009D00086E089BD09B400FEFDCF1092140110928B
|
||||||
|
:1009E0001001109212011092110142E060E080E0CB
|
||||||
|
:1009F00056DF8091E1008E7F8093E1008091E200DC
|
||||||
|
:100A000081608093E2008091E20088608093E20040
|
||||||
|
:100A10008091E0008E7F8093E0000895E3E6F0E0AF
|
||||||
|
:100A200080818E7F808381E080931301BECF1092FE
|
||||||
|
:100A3000E20008951092E10008951F920F920FB600
|
||||||
|
:100A40000F9211242F933F934F935F936F937F9354
|
||||||
|
:100A50008F939F93AF93BF93EF93FF938091E100A8
|
||||||
|
:100A600082FF0AC08091E20082FF06C08091E1000F
|
||||||
|
:100A70008B7F8093E100D6D18091E10080FF17C089
|
||||||
|
:100A80008091E20080FF13C08091E2008E7F80930E
|
||||||
|
:100A9000E2008091E20080618093E2008091D800C2
|
||||||
|
:100AA00080628093D80019BC1092140197DB80916A
|
||||||
|
:100AB000E10084FF2FC08091E20084FF2BC084E01E
|
||||||
|
:100AC00089BD86E089BD09B400FEFDCF8091D800C4
|
||||||
|
:100AD0008F7D8093D8008091E1008F7E8093E1002C
|
||||||
|
:100AE0008091E2008F7E8093E2008091E20081603D
|
||||||
|
:100AF0008093E20080911001882311F084E007C008
|
||||||
|
:100B00008091E30087FF02C083E001C081E0809311
|
||||||
|
:100B100014015FDB8091E10083FF22C08091E2003D
|
||||||
|
:100B200083FF1EC08091E100877F8093E10082E017
|
||||||
|
:100B300080931401109210018091E1008E7F8093C8
|
||||||
|
:100B4000E1008091E2008E7F8093E2008091E200DC
|
||||||
|
:100B500080618093E20042E060E080E0A0DE62D14C
|
||||||
|
:100B6000FF91EF91BF91AF919F918F917F916F9185
|
||||||
|
:100B70005F914F913F912F910F900FBE0F901F905B
|
||||||
|
:100B800018951F93CF93DF93CDB7DEB7AA970FB613
|
||||||
|
:100B9000F894DEBF0FBECDBFE5E1F1E08091F1003A
|
||||||
|
:100BA000819321E0ED31F207C9F73CD18091E80053
|
||||||
|
:100BB00083FF20C19091150180911601853009F4C1
|
||||||
|
:100BC00077C030F4813081F168F0833069F112C16F
|
||||||
|
:100BD000883009F4E1C0893009F4F0C0863009F0AA
|
||||||
|
:100BE00009C188C0903881F0923809F003C1809122
|
||||||
|
:100BF00019018F708093E9008091EB0085FB8827B5
|
||||||
|
:100C000080F91092E90006C08091110190911201C3
|
||||||
|
:100C1000911182609091E800977F9093E800809313
|
||||||
|
:100C2000F1001092F100C3C0292F2D7F09F0E2C01E
|
||||||
|
:100C3000992319F0923061F0DDC090911701913045
|
||||||
|
:100C400009F0D8C0833009F090E0909312012AC0D7
|
||||||
|
:100C500090911701911126C0209119012F7009F46C
|
||||||
|
:100C6000C9C02093E9009091EB0090FF1BC0833036
|
||||||
|
:100C700021F48091EB00806213C08091EB008061D1
|
||||||
|
:100C80008093EB0081E090E0022E01C0880F0A946F
|
||||||
|
:100C9000EAF78093EA001092EA008091EB00886006
|
||||||
|
:100CA0008093EB001092E9008091E800877F82C07A
|
||||||
|
:100CB0009111A0C0109117011F778091E3008078F7
|
||||||
|
:100CC000812B8093E3008091E800877F8093E80088
|
||||||
|
:100CD0001BDE8091E80080FFFCCF8091E3008068FC
|
||||||
|
:100CE0008093E300112311F083E001C082E0809340
|
||||||
|
:100CF000140180C09058923008F07CC08091170198
|
||||||
|
:100D0000909118018C3D23E0920771F583E08A836E
|
||||||
|
:100D10008AE289834FB7F894DE01139620E03EE023
|
||||||
|
:100D200051E2E32FF0E050935700E49120FF03C01D
|
||||||
|
:100D3000E295EF703F5FEF708E2F90E0EA3010F099
|
||||||
|
:100D4000C79601C0C0968D939D932F5F243149F7BC
|
||||||
|
:100D50004FBF8091E800877F8093E8006AE270E0EF
|
||||||
|
:100D6000CE010196D5DC12C0AE014F5F5F4F60919E
|
||||||
|
:100D700019010CDC009709F43DC02091E800277FA1
|
||||||
|
:100D80002093E800BC0189819A8125DD8091E800EB
|
||||||
|
:100D90008B778093E8002EC0903861F58091E80051
|
||||||
|
:100DA000877F8093E800809110018093F10080910B
|
||||||
|
:100DB000E8008E778093E800A7DD1CC091111AC06F
|
||||||
|
:100DC000909117019230B0F48091E800877F809372
|
||||||
|
:100DD000E8009093100198DD80911001811104C00A
|
||||||
|
:100DE0008091E30087FF02C084E001C081E080932E
|
||||||
|
:100DF0001401F9D98091E80083FF0AC08091E800CE
|
||||||
|
:100E0000877F8093E8008091EB0080628093EB0005
|
||||||
|
:100E1000AA960FB6F894DEBF0FBECDBFDF91CF917B
|
||||||
|
:100E20001F9108950895CF93809114018823A9F00C
|
||||||
|
:100E30008091E9008F709091EC0090FF02C090E8E3
|
||||||
|
:100E400001C090E0C92FC82B1092E9008091E80002
|
||||||
|
:100E500083FD97DECF70C093E900CF910895F89499
|
||||||
|
:020E6000FFCFC2
|
||||||
|
:00000001FF
|
Loading…
Reference in a new issue