Hello all,
after reading a lot this is my first post in this wonderfull forum.
I want to build a midi controller for vMix and for this I cannibalized an old Sony vision mixer panel and now have a T-bar and 64 buttons with two LEDs each. For now I use a Arduino Mega 2560 that will be replaced by a Teensy 4.1 later.
I am an absolute beginner in terms of Arduino and programming. With the Controlsurface Library I have managed the input-side wonderfully so far and would now like to implement the control of the LEDs.
//https://tttapa.github.io/Control-Surface-doc/Doxygen/d0/dcc/AbsoluteRotaryEncoder_8ino-example.html
//https://github.com/tttapa/Control-Surface/blob/master/examples/1.%20MIDI%20Output/2.%20Buttons%20%26%20Switches/1.%20Momentary%20Push%20Buttons/NoteButtonMatrix/NoteButtonMatrix.ino
//https://github.com/tttapa/Control-Surface/blob/master/src/MIDI_Outputs/CCAbsoluteEncoder.hpp
#include <Encoder.h> // Include the Encoder library.
#include <Control_Surface.h>
//USBMIDI_Interface midi;
HairlessMIDI_Interface midi;
// Instantiate a CCAbsoluteEncoder object
CCAbsoluteEncoder enc = {
{2, 3}, // pins
MIDI_CC::Pan, // MIDI address (CC number + optional channel)
1, // optional multiplier if the control isn't fast enough
8, // optional pulses per step
};
// The note numbers corresponding to the buttons in the matrix
const AddressMatrix<4, 4> addresses = {{
{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13, 14, 15, 16},
}};
NoteButtonMatrix<4, 4> buttonmatrix = {
{38, 40, 42, 44}, // row pins
{46, 48, 50, 52}, // column pins
addresses, // address matrix
CHANNEL_1, // channel and cable number
};
void setup() {
Control_Surface.begin();
}
void loop() {
Control_Surface.loop();
}
I can send note-on commands to the Arduino with vMix. However, I don't have enough pins for the 128 LEDs (64 buttons with two LEDs each). After some internet research I came across the MAX7219. Unfortunately, my programming skills are not sufficient for this (each LED should be controlled individually with a note-on or note-off command).
Can someone help me or point me into the right direction?
TIA, Flo
4x4_Keypad_Rotary.ino (1.23 KB)