Midi Keyboard with Velocity & Aftertouch #932
Unanswered
RandyRyanG
asked this question in
Q&A
Replies: 1 comment 6 replies
-
@tttapa can you assist please, I know you are busy.... |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am just learning to code to go easy on me...
I have a 25key midi keyboard with velocity sensitive keys with aftertouch. I have the keymatrix connected to an arduino micro(32u4). Each key has 2 switches (second switch for velocity) The keymatrix circuit is output to a 16 pin header.
My code is using the NoteButtonmatrix class, I have added a second button matrix for the "velocity" switches. I am using MidiView and I am able to see each key press with a clear time delay between the first and second key switch press. How would I measure the time from the first switch to the second switch to determine the key press velocity? Let me know if I am miss understanding how the 2 switches are intended to work. This is what my code looks like so far.
I would also like to connect the built in FSR strip witch I assume is for aftertouch.
#include <Control_Surface.h>
USBMIDI_Interface MPK25V2;
//A0,A2,A4,11 >>>> NOTE ON SWITCHES (addresses)(buttonmatrix)
//A1,A3,A5,12 >>>> VELOCITY ON SWITCHES (addresses2)(buttonmatrix2)
///--------------------------------------------
// The note numbers corresponding to the buttons in the matrix
const AddressMatrix<4, 8> addresses {{
{44, 45, 46, 47, 48, 49, 50, 51},
{52, 53, 54, 55, 56, 57, 58, 59},
{60, 61, 62, 63, 64, 65, 66, 67},
{68, 69, 70, 71, 72, 73, 74, 75},
}};
NoteButtonMatrix<4, 8> buttonmatrix {
{A0,A2,A4,11}, // row pins
{2,3,4,5,6,7,8,9}, // column pins
addresses, // address matrix
CHANNEL_1, // channel and cable number
};
///---------------------------------------------
const AddressMatrix<4, 8> addresses2 {{
{44, 45, 46, 47, 48, 49, 50, 51},
{52, 53, 54, 55, 56, 57, 58, 59},
{60, 61, 62, 63, 64, 65, 66, 67},
{68, 69, 70, 71, 72, 73, 74, 75},
}};
NoteButtonMatrix<4, 8> buttonmatrix2 {
{A1,A3,A5,12}, // row pins
{2,3,4,5,6,7,8,9}, // column pins
addresses2, // address matrix
CHANNEL_1, // channel and cable number
};
void setup() {
Control_Surface.begin();
}
void loop() {
Control_Surface.loop();
}
Beta Was this translation helpful? Give feedback.
All reactions