-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
The display contents are sent using SysEx, so it's best to have a closer look at those messages. The format is explained here: https://tttapa.github.io/Control-Surface-doc/Doxygen/d5/d2e/classMCU_1_1LCD.html
Indeed, the DAW just sends a SysEx message to the controller that says something along the lines of: "please write the characters 'XYZ' to position n on the LCD display". The controller itself does not do any text processing, it just displays the characters it received. These characters can be accessed using the Here's an example, integrated with the rest of the reverse engineering code: #include <Control_Surface.h>
// A MIDI over USB interface
USBMIDI_Interface midi;
bool channelMessageCallback(ChannelMessage cm) {
MIDIMessageType type = cm.getMessageType();
if (type == MIDIMessageType::NoteOn || type == MIDIMessageType::NoteOff) {
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;
}
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;
}
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;
}
bool realTimeMessageCallback(RealTimeMessage rt) {
Serial << F("Real-Time: ") << hex << rt.message << dec << F(" on cable ")
<< rt.cable.getOneBased() << endl;
return false;
}
MCU::LCD<> lcd;
void setup() {
// Make sure that the Serial interface is fast enough, so it doesn't stall the
// MIDI application
Serial.begin(1000000);
Control_Surface.begin();
Control_Surface.setMIDIInputCallbacks(channelMessageCallback, //
sysExMessageCallback, //
sysCommonMessageCallback, //
realTimeMessageCallback); //
}
void loop() {
Control_Surface.loop();
if (lcd.getDirty()) {
Serial << "LCD text updated: " << lcd.getText() << endl;
lcd.clearDirty();
}
} |
Beta Was this translation helpful? Give feedback.
-
Pieter, this is awesome! I can see everything I was hoping for: Now I "only" have to figure out how to send it to the display(s). It's still very much trial and error for me, basically stitching together code snippets, but this looks very promising. Thanks so much :) |
Beta Was this translation helpful? Give feedback.
-
Hi Pieter, I'm sorry, but I'm lost. I followed this #76 (comment) and edited LCDDisplay.hpp accordingly. Then I found the different constructors for LCDDisplay, where this one: LCDDisplay(DisplayInterface &display, const MCU::LCD<> &lcd,
const OutputBank &bank, uint8_t track, uint8_t line,
PixelLocation loc, uint8_t textSize, uint16_t color) looks like it should give me the possibility to divide the text in two lines (0, 1) and pick which one to send to the display. At the moment, the sketch works with this: MCU::LCDDisplay lcddisps[] {
// track (1), position (0, 40), font size (1)
{display, lcd, bank, 1, {0, 40}, 1, WHITE},
{display, lcd, bank, 2, {64, 40}, 1, WHITE},
}; If I just add the number for the line in the sketch, like: MCU::LCDDisplay lcddisps[] = {
// track (1), line(0), position (0, 40), font size (1)
{display, lcd, bank, 1, 0, {0, 40}, 1, WHITE},
{display, lcd, bank, 2, 0, {64, 40}, 1, WHITE},
}; my arduino will start to blink, not work at all and cause Cubase to crash. I also noticed that the things that are displayed at the moment (track names for example) are sent in the second line (line 1) of the MCU display by Cubase. So if you find the time to help me out, I would be very grateful. |
Beta Was this translation helpful? Give feedback.
The display contents are sent using SysEx, so it's best to have a closer look at those messages. The format is explained here: https://tttapa.github.io/Control-Surface-doc/Doxygen/d5/d2e/classMCU_1_1LCD.html
Indeed, the DAW just sends a SysEx message to the controller that says something along the lines of: "please write the characters 'XYZ' to position n on the LCD display". The controller itself does not do any text processing, it just displays the characters it received. These characte…