Tall order here. At least that’s how it feels after trying the same thing a dozen plus different ways, so not in humbly here and looking for some insight.
I’ve been building out a custom touch screen controller that lives on another machine (2024 MacMini - bare minimum specs for simplicity). It’s got its own simple iConnectivity MioXC single port USB/MIDI interface that goes into the main host machine’s (2019 MacPro - loaded) primary MIDI Interface (MOTU MIDI Express XT). Sending MIDI CC’s and Notes out of my application works beautifully. No issue there. Minimal reliance on MIDI Remote implementation. Not much more than mapping via a custom script.
What I’m trying to do is get the name of the currently selected track (any track type but ideally MIDI) out of Cubase and over SysEx to a text field in my application.
The wild part, is that with my current script, and application side code, I do get something when selecting any track that isn’t a MIDI track. That something is roughly 250 arbitrary, seemingly noise characters of MIDI data. None of it SysEx data (after debugging and filtering on both a programmatic and hardware level).
That said, I’ll attach the current script below as it is. Again - it’s certainly sending something when selecting anything but a MIDI track (sends nothing when selecting a MIDI track). I just don’t know what that something is. lol. So if anyone at all has any insight or can possibly spot any and all mistakes or oversights I’m likely making, I’d be forever grateful. Also open to any and all questions anyone may have. Cheers!
//-----------------------------------------------------------------------------
// 1. DRIVER SETUP - create driver object, midi ports, and detection information
//-----------------------------------------------------------------------------
var midiremote_api = require(‘midiremote_api_v1’);
var deviceDriver = midiremote_api.makeDeviceDriver(‘Aurora Soundworks’, ‘ControlONE’, ‘Brett St. James’);
var midiInput = deviceDriver.mPorts.makeMidiInput();
var midiOutput = deviceDriver.mPorts.makeMidiOutput();
deviceDriver.makeDetectionUnit().detectPortPair(midiInput, midiOutput)
.expectInputNameEquals(‘MIDI Express XT Port 7’)
.expectOutputNameEquals(‘MIDI Express XT Port 7’);
//-----------------------------------------------------------------------------
// 2. SURFACE LAYOUT - create control elements and midi bindings
//-----------------------------------------------------------------------------
var page = deviceDriver.mMapping.makePage(‘ControlONE Custom Mapping’);
var selectedTrackChannel = page.mHostAccess.mTrackSelection.mMixerChannel;
function sendTrackNameAsSysEx(activeDevice, trackName) {
// Convert track name to an array of byte values
var nameBytes = trackName.split(‘’).map(function (char) {
return char.charCodeAt(0);
});
// Create SysEx message with the track name data
var sysExMessage = [0xF0, 0x7D, 0x00].concat(nameBytes).concat(0xF7); // Example Manufacturer ID 0x7D
// Send SysEx message using the active device
activeDevice.mMidiOutput.sendMidi(sysExMessage);
}
// Function to send track color as raw bytes in SysEx message
function sendTrackColorAsSysEx(activeDevice, r, g, b, a) {
// Create a SysEx message with the RGBA color values
var sysExMessage = [0xF0, 0x7D, 0x01, r, g, b, a, 0xF7]; // Example Manufacturer ID 0x7D
// Send the SysEx message using the active device
activeDevice.mMidiOutput.sendMidi(sysExMessage);
}
// Track Name Change Event
selectedTrackChannel.mOnTitleChange = function (activeDevice, activeMapping, objectTitle) {
sendTrackNameAsSysEx(activeDevice, objectTitle);
}
// Track Color Change Event
selectedTrackChannel.mOnColorChange = function (activeDevice, activeMapping, r, g, b, a, isActive) {
sendTrackColorAsSysEx(activeDevice, r, g, b, a);
}
//-----------------------------------------------------------------------------
// 3. BUTTON SETUP - create buttons and bind to MIDI messages
//-----------------------------------------------------------------------------
// Button 1
var button1 = deviceDriver.mSurface.makeButton(0, 0, 1, 2)
button1.mSurfaceValue.mMidiBinding
.setInputPort(midiInput)
.bindToControlChange(10, 14)
[quote=“Brett_St_James, post:1, topic:927113, full:true”]
Tall order here. At least that’s how it feels after trying the same thing a dozen plus different ways, so not in humbly here and looking for some insight.
I’ve been building out a custom touch screen controller that lives on another machine (2024 MacMini - bare minimum specs for simplicity). It’s got its own simple iConnectivity MioXC single port USB/MIDI interface that goes into the main host machine’s (2019 MacPro - loaded) primary MIDI Interface (MOTU MIDI Express XT). Sending MIDI CC’s and Notes out of my application works beautifully. No issue there. Minimal reliance on MIDI Remote implementation. Not much more than mapping via a custom script.
What I’m trying to do is get the name of the currently selected track (any track type but ideally MIDI) out of Cubase and over SysEx to a text field in my application.
The wild part, is that with my current script, and application side code, I do get something when selecting any track that isn’t a MIDI track. That something is roughly 250 arbitrary, seemingly noise characters of MIDI data. None of it SysEx data (after debugging and filtering on both a programmatic and hardware level).
That said, I’ll attach the current script below as it is. Again - it’s certainly sending something when selecting anything but a MIDI track (sends nothing when selecting a MIDI track). I just don’t know what that something is. lol. So if anyone at all has any insight or can possibly spot any and all mistakes or oversights I’m likely making, I’d be forever grateful. Also open to any and all questions anyone may have. Cheers!
//-----------------------------------------------------------------------------
// 1. DRIVER SETUP - create driver object, midi ports, and detection information
//-----------------------------------------------------------------------------
var midiremote_api = require(‘midiremote_api_v1’);
var deviceDriver = midiremote_api.makeDeviceDriver(‘Aurora Soundworks’, ‘ControlONE’, ‘Brett St. James’);
var midiInput = deviceDriver.mPorts.makeMidiInput();
var midiOutput = deviceDriver.mPorts.makeMidiOutput();
deviceDriver.makeDetectionUnit().detectPortPair(midiInput, midiOutput)
.expectInputNameEquals(‘MIDI Express XT Port 7’)
.expectOutputNameEquals(‘MIDI Express XT Port 7’);
//-----------------------------------------------------------------------------
// 2. SURFACE LAYOUT - create control elements and midi bindings
//-----------------------------------------------------------------------------
var page = deviceDriver.mMapping.makePage(‘ControlONE Custom Mapping’);
var selectedTrackChannel = page.mHostAccess.mTrackSelection.mMixerChannel;
function sendTrackNameAsSysEx(activeDevice, trackName) {
// Convert track name to an array of byte values
var nameBytes = trackName.split(‘’).map(function (char) {
return char.charCodeAt(0);
});
// Create SysEx message with the track name data
var sysExMessage = [0xF0, 0x7D, 0x00].concat(nameBytes).concat(0xF7); // Example Manufacturer ID 0x7D
// Send SysEx message using the active device
activeDevice.mMidiOutput.sendMidi(sysExMessage);
}
// Function to send track color as raw bytes in SysEx message
function sendTrackColorAsSysEx(activeDevice, r, g, b, a) {
// Create a SysEx message with the RGBA color values
var sysExMessage = [0xF0, 0x7D, 0x01, r, g, b, a, 0xF7]; // Example Manufacturer ID 0x7D
// Send the SysEx message using the active device
activeDevice.mMidiOutput.sendMidi(sysExMessage);
}
// Track Name Change Event
selectedTrackChannel.mOnTitleChange = function (activeDevice, activeMapping, objectTitle) {
sendTrackNameAsSysEx(activeDevice, objectTitle);
}
// Track Color Change Event
selectedTrackChannel.mOnColorChange = function (activeDevice, activeMapping, r, g, b, a, isActive) {
sendTrackColorAsSysEx(activeDevice, r, g, b, a);
}
//-----------------------------------------------------------------------------
// 3. BUTTON SETUP - create buttons and bind to MIDI messages
//-----------------------------------------------------------------------------
// Button 1
var button1 = deviceDriver.mSurface.makeButton(0, 0, 1, 2)
button1.mSurfaceValue.mMidiBinding
.setInputPort(midiInput)
.bindToControlChange(10, 14)