Код:
#include <Control_Surface.h>
USBMIDI_Interface midi;
CD74HC4067 muxPots = { A0, {2, 3, 4, 5},};
CD74HC4067 muxPots1 = { A1, {2, 3, 4, 5},};
CD74HC4067 muxPots2 = { A2, {2, 3, 4, 5},};
CD74HC4067 muxPots3 = { A3, {2, 3, 4, 5},};
CCPotentiometer potentiometer[] = {
{muxPots.pin(0),{10, CHANNEL_6}},
{muxPots.pin(1),{11, CHANNEL_6}},
{muxPots.pin(2),{12, CHANNEL_6}},
{muxPots.pin(3),{13, CHANNEL_6}},
{muxPots.pin(4),{14, CHANNEL_6}},
{muxPots.pin(5),{15, CHANNEL_6}},
{muxPots.pin(6),{16, CHANNEL_6}},
{muxPots.pin(7),{17, CHANNEL_6}},
{muxPots.pin(8),{18, CHANNEL_6}},
{muxPots.pin(9),{19, CHANNEL_6}},
{muxPots.pin(10),{20, CHANNEL_6}},
{muxPots.pin(11),{21, CHANNEL_6}},
{muxPots.pin(12),{22, CHANNEL_6}},
{muxPots.pin(13),{23, CHANNEL_6}},
{muxPots.pin(14),{24, CHANNEL_6}},
{muxPots.pin(15),{25, CHANNEL_6}},
{muxPots1.pin(0),{26, CHANNEL_6}},
{muxPots1.pin(1),{27, CHANNEL_6}},
{muxPots1.pin(2),{28, CHANNEL_6}},
{muxPots1.pin(3),{29, CHANNEL_6}},
{muxPots1.pin(4),{30, CHANNEL_6}},
{muxPots1.pin(5),{31, CHANNEL_6}},
{muxPots1.pin(6),{32, CHANNEL_6}},
{muxPots1.pin(7),{33, CHANNEL_6}},
{muxPots1.pin(8),{34, CHANNEL_6}},
{muxPots1.pin(9),{35, CHANNEL_6}},
{muxPots1.pin(10),{36, CHANNEL_6}},
{muxPots1.pin(11),{37, CHANNEL_6}},
{muxPots1.pin(12),{38, CHANNEL_6}},
{muxPots1.pin(13),{39, CHANNEL_6}},
{muxPots1.pin(14),{40, CHANNEL_6}},
{muxPots1.pin(15),{41, CHANNEL_6}},
{muxPots2.pin(0),{42, CHANNEL_6}},
{muxPots2.pin(1),{43, CHANNEL_6}},
{muxPots2.pin(2),{44, CHANNEL_6}},
{muxPots2.pin(3),{45, CHANNEL_6}},
{muxPots2.pin(4),{46, CHANNEL_6}},
{muxPots2.pin(5),{47, CHANNEL_6}},
{muxPots2.pin(6),{48, CHANNEL_6}},
{muxPots2.pin(7),{49, CHANNEL_6}},
{muxPots2.pin(8),{50, CHANNEL_6}},
{muxPots2.pin(9),{51, CHANNEL_6}},
{muxPots2.pin(10),{52, CHANNEL_6}},
{muxPots2.pin(11),{53, CHANNEL_6}},
{muxPots2.pin(12),{54, CHANNEL_6}},
{muxPots2.pin(13),{55, CHANNEL_6}},
{muxPots2.pin(14),{56, CHANNEL_6}},
{muxPots2.pin(15),{57, CHANNEL_6}},
{muxPots3.pin(0),{58, CHANNEL_6}},
{muxPots3.pin(1),{59, CHANNEL_6}},
{muxPots3.pin(2),{60, CHANNEL_6}},
{muxPots3.pin(3),{61, CHANNEL_6}},
{muxPots3.pin(4),{62, CHANNEL_6}},
{muxPots3.pin(5),{63, CHANNEL_6}},
{muxPots3.pin(6),{74, CHANNEL_6}},
{muxPots3.pin(7),{65, CHANNEL_6}},
{muxPots3.pin(8),{75, CHANNEL_6}},
{muxPots3.pin(9),{67, CHANNEL_6}},
{muxPots3.pin(10),{68, CHANNEL_6}},
{muxPots3.pin(11),{69, CHANNEL_6}},
{muxPots3.pin(12),{70, CHANNEL_6}},
{muxPots3.pin(13),{71, CHANNEL_6}},
{muxPots3.pin(14),{72, CHANNEL_6}},
{muxPots3.pin(15),{73, CHANNEL_6}},
};
void setup() {
muxPots.begin();
muxPots1.begin();
muxPots2.begin();
muxPots3.begin();
Control_Surface.begin(); // Initialize Control Surface
}
void loop() {
Control_Surface.loop(); // Update the Control Surface
}
#arduino #controller #MIDI #moog #The_Legend #musicmaker #diy