I'm trying to convert a casio ctk-1500 keyboard into a basic midi keyboard with the Control Surface library, i thought id worked out the 16 pin key matrix as 9x7 but after soldering to a pi pico the outputs i get in synesthesia jump up in weird intervals.
I'm using a barely modified version of the default button matrix example sketch, and i soldered the matrix pins directly to gpio 1-16 after some trouble with using multiplexers but i cant wrap my head around the scan matrix issue. When tested with a multimeter, red on pin one and black on pin 16 shows a voltage when button 16 is pressed, then moving black to pin 15 button 7 gives a voltage. Any help on how columns/rows are identified would be appreciated
EDIT:
i tried an 8x8 matrix instead, im still having issues where sequentially button 1 presses midi note 24, button2= note 32 and so on but if i try swapping the column and row pins in code no keys function at all
#include <Control_Surface.h>
USBMIDI_Interface midi;
// The note numbers corresponding to the buttons in the matrix
//CHECK COLUMN ROWS
const AddressMatrix<8, 8> addresses {{
{24, 25, 26, 27, 28, 29, 30, 31},
{32, 33, 34, 35, 36, 37, 38, 39},
{40, 41, 42, 43, 47, 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, 76, 77, 77, 78},
{79, 80, 81, 82, 83, 84, 85, 86},
}};
NoteButtonMatrix<8, 8> buttonmatrix {
{9, 10, 11, 12, 13, 14, 15, 16}, // row pins
{1, 2, 3, 4, 5, 6, 7, 8}, // column pins
addresses, // address matrix
Channel_1, // channel and cable number
};
void setup() {
Control_Surface.begin();
}
void loop() {
Control_Surface.loop();
}