fixed octave shift buttons
This commit is contained in:
@@ -64,3 +64,6 @@ dkms.conf
|
|||||||
.vscode/ipch
|
.vscode/ipch
|
||||||
.vscode
|
.vscode
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
|
|
||||||
|
# Libreoffice
|
||||||
|
.~lock.*
|
||||||
Binary file not shown.
+23
-20
@@ -60,27 +60,28 @@ CCPotentiometer potentiometers[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
byte matrix[16][6][2] = {
|
byte matrix[16][6][2] = {
|
||||||
/* 0 | 1 | 2 | 3 | 4 | 5 */
|
/* 0 | 1 | 2 | 3 | 4 | 5 */
|
||||||
/*0*/ {{1, 0}, {1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}},
|
/*0*/ {{1, 0}, {1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}},
|
||||||
/*1*/ {{1, 6}, {1, 7}, {1, 8}, {1, 9}, {1, 10}, {1, 11}},
|
/*1*/ {{1, 6}, {1, 7}, {1, 8}, {1, 9}, {1, 10}, {1, 11}},
|
||||||
/*2*/ {{1, 18}, {1, 19}, {1, 20}, {1, 21}, {1, 22}, {1, 23}},
|
/*2*/ {{1, 18}, {1, 19}, {1, 20}, {1, 21}, {1, 22}, {1, 23}},
|
||||||
/*3*/ {{1, 48}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
/*3*/ {{1, 48}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
||||||
/*4*/ {{1, 42}, {1, 43}, {1, 44}, {1, 45}, {1, 46}, {1, 47}},
|
/*4*/ {{1, 42}, {1, 43}, {1, 44}, {1, 45}, {1, 46}, {1, 47}},
|
||||||
/*5*/ {{1, 36}, {1, 37}, {1, 38}, {1, 39}, {1, 40}, {1, 41}},
|
/*5*/ {{1, 36}, {1, 37}, {1, 38}, {1, 39}, {1, 40}, {1, 41}},
|
||||||
/*6*/ {{1, 30}, {1, 31}, {1, 32}, {1, 33}, {1, 34}, {1, 35}},
|
/*6*/ {{1, 30}, {1, 31}, {1, 32}, {1, 33}, {1, 34}, {1, 35}},
|
||||||
/*7*/ {{1, 24}, {1, 25}, {1, 26}, {1, 27}, {1, 28}, {1, 29}},
|
/*7*/ {{1, 24}, {1, 25}, {1, 26}, {1, 27}, {1, 28}, {1, 29}},
|
||||||
/*8*/ {{1, 12}, {1, 13}, {1, 14}, {1, 15}, {1, 16}, {1, 17}},
|
/*8*/ {{1, 12}, {1, 13}, {1, 14}, {1, 15}, {1, 16}, {1, 17}},
|
||||||
/*a*/ {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
/*9*/ {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
||||||
/*b*/ {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
/*a*/ {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
||||||
/*c*/ {{2, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
/*b*/ {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
||||||
/*d*/ {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
/*c*/ {{2, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
||||||
/*e*/ {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
/*d*/ {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
||||||
/*f*/ {{2, 1}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
/*e*/ {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
||||||
|
/*f*/ {{2, 1}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}},
|
||||||
};
|
};
|
||||||
|
|
||||||
bool ref[16][6] = {{false}};
|
bool ref[16][6] = {{false}};
|
||||||
|
|
||||||
unsigned char shift = 0;
|
unsigned char shift = 12;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
for (size_t i = 0; i < KEYBOARD_INSIZE; ++i) {
|
for (size_t i = 0; i < KEYBOARD_INSIZE; ++i) {
|
||||||
@@ -128,13 +129,16 @@ void button_matrix_mgt(void) {
|
|||||||
#ifndef DEBUG_MATRIX
|
#ifndef DEBUG_MATRIX
|
||||||
byte type = matrix[i][j][0];
|
byte type = matrix[i][j][0];
|
||||||
byte key = matrix[i][j][1];
|
byte key = matrix[i][j][1];
|
||||||
|
#ifdef __PLATFORMIO_BUILD_DEBUG__
|
||||||
|
midi.sendNoteOn({type, CHANNEL_3}, key);
|
||||||
|
#endif /* __PLATFORMIO_BUILD_DEBUG__ */
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
midi.sendNoteOn({key + shift, channel}, NOTE_VELOCITY);
|
midi.sendNoteOn({key + shift, channel}, NOTE_VELOCITY);
|
||||||
} else if (type == 2) {
|
} else if (type == 2) {
|
||||||
// todo : note off
|
// todo : note off
|
||||||
if (key == 0 && shift >= 12) {
|
if (key == 0 && shift >= 12) {
|
||||||
shift -= 12;
|
shift -= 12;
|
||||||
} else if (key == 1 && shift <= 0xFF - 47 - 12) {
|
} else if (key == 1 && shift <= 6 * 12) {
|
||||||
shift += 12;
|
shift += 12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,8 +168,7 @@ void capa_sensor_mgt(void) {
|
|||||||
int static lasttouched;
|
int static lasttouched;
|
||||||
int currtouched = capa_sensor.touched();
|
int currtouched = capa_sensor.touched();
|
||||||
|
|
||||||
for (uint8_t i = 0; i < 12; i++)
|
for (uint8_t i = 0; i < 12; i++) {
|
||||||
{
|
|
||||||
// it if *is* touched and *wasnt* touched before, alert!
|
// it if *is* touched and *wasnt* touched before, alert!
|
||||||
if ((currtouched & _BV(i)) && !(lasttouched & _BV(i))) {
|
if ((currtouched & _BV(i)) && !(lasttouched & _BV(i))) {
|
||||||
midi.sendCC({i, channel}, ON);
|
midi.sendCC({i, channel}, ON);
|
||||||
|
|||||||
Reference in New Issue
Block a user