I had worked a week on using Control_Surface.h to DYI a (Mackie Control Universal) MCU MIDI CC controller: 3 buttons for play,record and stop. also have 3 slider potentiometers, for semding midi cc control change message(CC1,CC3,CC11).
the buttons are ok now . but the slider potentiometers just can not work.
anyone here please help me out of that, I'll be appreciate.
thsnks
Did you try a simple analogRead() sketch to prove that your slide pots were wired correctly? The software can't do anything without the hardware working.
The following picture is my wiring diagram, because I failed to successfully upgrade the firmware of Uno Mini so I chose to use Teensy4 . and also have some data which is from using “Mackie-Control-universal-reverse-Engineering.ino” on Reaper. these data should be similar to the using USBMIDI_Interface USBMIDI, right? and I can't tell which instruction is used to control the MIDI CC controller.
Please help me to figure it out?! Thank you very much!
#include <Control_Surface.h>
/*
Mackie-Control-Universal-Reverse-Engineering
Sketch that reads the MIDI input from the USB MIDI Interface and prints it to the Serial monitor, including the Mackie Control Universal note names.
This is useful to discover what kinds of messages your DAW is sending.
Boards:
AVR, AVR USB, Nano Every, Due, Nano 33 IoT, Nano 33 BLE, Teensy 3.x, ESP32
*/
int ledpin = 15;
// A MIDI over USB interface
USBMIDI_Interface midi;
bool channelMessageCallback(ChannelMessage cm) {
MIDIMessageType type = cm.getMessageType();
if (type == MIDIMessageType::NOTE_ON || type == MIDIMessageType::NOTE_OFF) {
Serial << hex << cm.header << ' ' << cm.data1 << ' ' << cm.data2 << dec
<< "\t(" << MCU::getMCUNameFromNoteNumber(cm.data1) << ")"
<< F(" on cable ") << cm.cable.getOneBased() << endl;
} else {
Serial << hex << cm.header << ' ' << cm.data1 << ' ' << cm.data2 << dec
<< F(" on cable ") << cm.cable.getOneBased() << endl;
}
return false; // Return true to indicate that handling is done,
// and Control_Surface shouldn't handle it anymore.
// If you want Control_Surface to handle it as well,
// return false.
}
bool sysExMessageCallback(SysExMessage se) {
Serial << F("System Exclusive message: [") << se.length << "] " //
<< AH::HexDump(se.data, se.length) //
<< F(" on cable ") << se.cable.getOneBased() << endl;
return false; // Return true to indicate that handling is done,
// and Control_Surface shouldn't handle it anymore.
// If you want Control_Surface to handle it as well,
// return false.
}
bool sysCommonMessageCallback(SysCommonMessage sc) {
Serial << F("System Common message: ") << hex << sc.getMessageType();
if (sc.getNumberOfDataBytes() >= 1)
Serial << sc.getData1();
if (sc.getNumberOfDataBytes() >= 2)
Serial << sc.getData2();
Serial << dec << F(" on cable ") << sc.cable.getOneBased() << endl;
return false; // Return true to indicate that handling is done,
// and Control_Surface shouldn't handle it anymore.
// If you want Control_Surface to handle it as well,
// return false.
}
bool realTimeMessageCallback(RealTimeMessage rt) {
Serial << F("Real-Time: ") << hex << rt.message << dec << F(" on cable ")
<< rt.cable.getOneBased() << endl;
return false; // Return true to indicate that handling is done,
// and Control_Surface shouldn't handle it anymore.
// If you want Control_Surface to handle it as well,
// return false.
}
void setup() {
// Make sure that the Serial interface is fast enough, so it doesn't stall the
// MIDI application
pinMode(ledpin,OUTPUT);
Serial.begin(1000000);
Control_Surface.begin();
Control_Surface.setMIDIInputCallbacks(channelMessageCallback, //
sysExMessageCallback, //
sysCommonMessageCallback, //
realTimeMessageCallback); //
digitalWrite(ledpin, HIGH);
}
void loop() {
Control_Surface.loop();
}
90 32 00 (FLIP) on cable 1
90 33 00 (GLOBAL_VIEW) on cable 1
90 64 00 (ZOOM) on cable 1
90 65 00 (SCRUB) on cable 1
b0 4b 30 on cable 1
b0 4a 31 on cable 1
System Exclusive message: [120] F0 00 00 66 14 12 00 52 45 41 50 45 52 21 20 49 6E 69 74 69 61 6C 69 7A 69 6E 67 2E 2E 2E 20 50 6C 65 61 73 65 20 77 61 69 74 2E 2E 2E 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 F7 on cable 1
System Exclusive message: [9] F0 00 00 66 14 20 00 03 F7 on cable 1
System Exclusive message: [9] F0 00 00 66 14 20 01 03 F7 on cable 1
System Exclusive message: [9] F0 00 00 66 14 20 02 03 F7 on cable 1
System Exclusive message: [9] F0 00 00 66 14 20 03 03 F7 on cable 1
System Exclusive message: [9] F0 00 00 66 14 20 04 03 F7 on cable 1
System Exclusive message: [9] F0 00 00 66 14 20 05 03 F7 on cable 1
System Exclusive message: [9] F0 00 00 66 14 20 06 03 F7 on cable 1
System Exclusive message: [9] F0 00 00 66 14 20 07 03 F7 on cable 1
System Exclusive message: [15] F0 00 00 66 14 12 31 20 20 20 20 20 20 20 F7 on cable 1
System Exclusive message: [9] F0 00 00 66 14 20 07 03 F7 on cable 1
d0 7f 00 on cable 1
e8 52 5b on cable 1
90 4a 00 (AUTOMATION_READ_OFF) on cable 1
90 4b 00 (AUTOMATION_WRITE) on cable 1
90 4c 00 (AUTOMATION_TRIM) on cable 1
90 4d 00 (AUTOMATION_TOUCH) on cable 1
90 4e 00 (AUTOMATION_LATCH) on cable 1
e0 52 5b on cable 1
b0 30 06 on cable 1
90 10 00 (MUTE_1) on cable 1
90 08 00 (SOLO_1) on cable 1
System Exclusive message: [15] F0 00 00 66 14 12 00 4B 6F 6E 74 61 6B 20 F7 on cable 1
90 00 7f (REC_RDY_1) on cable 1
90 18 7f (SELECT_1) on cable 1
90 4a 00 (AUTOMATION_READ_OFF) on cable 1
90 4b 00 (AUTOMATION_WRITE) on cable 1
90 4c 7f (AUTOMATION_TRIM) on cable 1
90 4d 00 (AUTOMATION_TOUCH) on cable 1
90 4e 00 (AUTOMATION_LATCH) on cable 1
90 73 00 (RUDE_SOLO) on cable 1
90 5a 00 (SOLO) on cable 1
90 71 00 (SMPTE) on cable 1
90 72 7f (BEATS) on cable 1
90 5f 00 (RECORD) on cable 1
90 5e 00 (PLAY) on cable 1
90 5d 7f (STOP) on cable 1
90 5f 00 (RECORD) on cable 1
90 5e 00 (PLAY) on cable 1
90 5d 7f (STOP) on cable 1
System Exclusive message: [8] F0 00 00 66 14 08 00 F7 on cable 1
The control change messages for the V-pots only get sent from the controller to the DAW, so you won't see them in the output from the sketch you posted, which only prints incoming messages.
If you want to see the outgoing messages, you'll have to add a USBDebugMIDI_Interface or USBDebugMIDI_Output.
Looks like the wiring is correct and you get the right MIDI messages.
If your DAW doesn't understand them, then you'll have to either configure it differently, or send different messages from the Arduino.
As mentioned earlier, if you're using the MCU protocol, you cannot use potentiometers, you need incremental encoders. (Only the motorized volume faders are potentiometers on a Mackie Control Universal.)