Thanks to Steve (from the Steinberg forums) I found out that using the Mackie Control
remote device (in Cubase), Bars and beats
information can be sent to an external MIDI device (to the Mackie Control Surface Pro or... O-S-C).
These are my observations:
When I advance the Project Cursor (the playhead) exactly one bar, the O-S-C console shows me that the MIDI port receives eight CC messages. But this is not always true. For example, I'll list below two exceptions:
- When I am at the 9th bar and I advance the playhead to the 10th bar, I get nine CC messages in the O-S-C console (see "Bar 10" column in the table below).
- When I'm at bar 300 and I jump to bar 1, I get ten CC messages in the O-S-C console (see "Bar 1" in the table below and add two more CC messages:
[ 16, 72, 32 ]
and [ 16, 72, 32 ]
.
I imagine that the widget (in O-S-C) receiving this information (from the Mackie Control
remote device) has to operate with relative values, not absolute.
|
Bar 1 (1. 1. 1. 0) |
Bar 2 (2. 1. 1. 0) |
Bar 3 (3. 1. 1. 0) |
Bar 4 (4. 1. 1. 0) |
Bar 5 (5. 1. 1. 0) |
cc |
[ 16, 64, 48 ] |
[ 16, 64, 48 ] |
[ 16, 64, 48 ] |
[ 16, 64, 48 ] |
[ 16, 64, 48 ] |
cc |
[ 16, 65, 32 ] |
[ 16, 65, 32 ] |
[ 16, 65, 32 ] |
[ 16, 65, 32 ] |
[ 16, 65, 32 ] |
cc |
[ 16, 66, 32 ] |
[ 16, 66, 32 ] |
[ 16, 66, 32 ] |
[ 16, 66, 32 ] |
[ 16, 66, 32 ] |
cc |
[ 16, 67, 113 ] |
[ 16, 67, 113 ] |
[ 16, 67, 113 ] |
[ 16, 67, 113 ] |
[ 16, 67, 113 ] |
cc |
[ 16, 68, 32 ] |
[ 16, 68, 32 ] |
[ 16, 68, 32 ] |
[ 16, 68, 32 ] |
[ 16, 68, 32 ] |
cc |
[ 16, 69, 113 ] |
[ 16, 69, 113 ] |
[ 16, 69, 113 ] |
[ 16, 69, 113 ] |
[ 16, 69, 113 ] |
cc |
[ 16, 70, 32 ] |
[ 16, 70, 32 ] |
[ 16, 70, 32 ] |
[ 16, 70, 32 ] |
[ 16, 70, 32 ] |
cc |
[ 16, 71, 113 ] |
[ 16, 71, 114 ] |
[ 16, 71, 115 ] |
[ 16, 71, 116 ] |
[ 16, 71, 117 ] |
Bar 6 (6. 1. 1. 0) |
Bar 7 (7. 1. 1. 0) |
Bar 8 (8. 1. 1. 0) |
Bar 9 (9. 1. 1. 0) |
Bar 10 (10. 1. 1. 0) |
[ 16, 64, 48 ] |
[ 16, 64, 48 ] |
[ 16, 64, 48 ] |
[ 16, 64, 48 ] |
[ 16, 64, 48 ] |
[ 16, 65, 32 ] |
[ 16, 65, 32 ] |
[ 16, 65, 32 ] |
[ 16, 65, 32 ] |
[ 16, 65, 32 ] |
[ 16, 66, 32 ] |
[ 16, 66, 32 ] |
[ 16, 66, 32 ] |
[ 16, 66, 32 ] |
[ 16, 66, 32 ] |
[ 16, 67, 113 ] |
[ 16, 67, 113 ] |
[ 16, 67, 113 ] |
[ 16, 67, 113 ] |
[ 16, 67, 113 ] |
[ 16, 68, 32 ] |
[ 16, 68, 32 ] |
[ 16, 68, 32 ] |
[ 16, 68, 32 ] |
[ 16, 68, 32 ] |
[ 16, 69, 113 ] |
[ 16, 69, 113 ] |
[ 16, 69, 113 ] |
[ 16, 69, 113 ] |
[ 16, 69, 113 ] |
[ 16, 70, 32 ] |
[ 16, 70, 32 ] |
[ 16, 70, 32 ] |
[ 16, 70, 32 ] |
[ 16, 70, 32 ] |
[ 16, 71, 118 ] |
[ 16, 71, 119 ] |
[ 16, 71, 120 ] |
[ 16, 71, 121 ] |
[ 16, 71, 112 ] |
|
|
|
|
[ 16, 72, 49 ] |
Bar 11 (11. 1. 1. 0) |
Bar 12 (11. 1. 1. 0) |
[ 16, 64, 48 ] |
[ 16, 64, 48 ] |
[ 16, 65, 32 ] |
[ 16, 65, 32 ] |
[ 16, 66, 32 ] |
[ 16, 66, 32 ] |
[ 16, 67, 113 ] |
[ 16, 67, 113 ] |
[ 16, 68, 32 ] |
[ 16, 68, 32 ] |
[ 16, 69, 113 ] |
[ 16, 69, 113 ] |
[ 16, 70, 32 ] |
[ 16, 70, 32 ] |
[ 16, 71, 113 ] |
[ 16, 71, 114 ] |
Here is how to convert these messages in a custom module based on this mcu implementation. In this example the timecode is dispatched accross ten text widgets that replicate the mackie's 10-digits screen, it also possible to pack them and send all the digits to one widget.
module.exports = {
oscInFilter: function(data) {
if (data.host === 'midi' && data.port === 'mcu_port') {
var [channel, control, value] = data.args.map(x=>x.value)
if (control > 63 && control < 74) {
var digit = 73 - control,
msb = value >> 4,
val = value & 0xF
if (msb >> 2) val += '.'
if (!(msb & (1 << 1))) val = ''
// digit -> digit
// val -> digit's value
// assuming 10 text widgets with incrementing preArgs
receive('/timecode', digit, val)
return
}
}
return data
}
}
1 Like
Hurray! It works!
I'd also like to use the MCU json (from your link) along with the js module (mcu.js). Unfortunately, some buttons (including the timecode information) don't work. Can you please give me a hint on how to merge two, hmmmm, filters?
I need to merge this (your code, which works) with the one in the mcu.js file.
I've tried this, but with no luck. This fixes the time display, but makes the other widgets inoperable.
module.exports = {
oscOutFilter: function(data) {
var {host, port, address, args} = data
if (oscToMcu(host, port, address, args)) return
return data
},
oscInFilter: function(data) {
var {host, port, address, args} = data
if (mcuToOsc(host, port, address, args)) return
return data
},
// Your code. I added a comma after the above bracket. This fixes the time display, but makes the other widgets inoperable.
oscInFilter: function(data) {
if (data.host === 'midi' && data.port === 'SKiano-C') {
var [channel, control, value] = data.args.map(x=>x.value)
if (control > 63 && control < 74) {
var digit = 73 - control,
msb = value >> 4,
val = value & 0xF
if (msb >> 2) val += '.'
if (!(msb & (1 << 1))) val = ''
// digit -> digit
// val -> digit's value
// assuming 10 text widgets with incrementing preArgs
receive('/timecode', digit, val)
return
}
}
return data
}
}
The code I posted earlier is basically a simplification of mcu.js that only handles the timecode part. If you don't have a custom module already, just use mcu.js (it does handle the timecode). Note that it's merely a proof of concept, not an active project.
I figured out how to add your code to the mcu.js file, without messing up the rest of it. Now the timecode part is handled as well.
Here's the js file which should be selected as an option for the custom-module field in the Configuration Form of the O-S-C Launcher (if anyone else is interested).
mcu.js (10.4 KB)
P.S. I don't know why, but on my computer (Mojave, Cubase 10.5.20), the timecode display of mcu.json didn't work at all with the original mcu.js file.
1 Like
Is there a script that would show nothing if 0?
1 Like
From the custom module yes, just send and empty string if the value is equal to zero.
1 Like
Thanks guys with this thread. Really helpful! I've been able to add successfully both MTC and MCU timecode.
1 Like
I'm struggling to make it work with Pro Tools. MTC works fine but the sysex for the bar count doesn't have a Control value, so it doesn't even trigger the code. Any idea?
The HUI protocol seems to be a bit different regarding timecode, based on this, here is a module draft, I can't test it but it should help.
var huiTimecode = Array(8).fill('0 ')
module.exports = {
oscInFilter: (data)=>{
if (data.address === '/sysex' && data.args[0].value.includes('f0 00 00 66 05 00 11')) { // hui sysex timecode
var digits = data.args[0].value.split(" ").slice(7).map(x=>{
if (x[0] === '0') return x[1] + ' '
else x[1] + '.'
})
digits.pop() // drop sysex closing byte
var i = 7
for (var d of digits) {
huiTimecode[i] = d
i--
}
receive('/hui_timecode', huiTimecode.join('')) // send timecode as single string for example
return
}
return data
}
}
1 Like
Thanks for the piece of code!
What is "values" as it is not declared before?
I meant to write digits
instead, post edited.
Is there anyway to let a non-coding layman such as myself, know how to set this up from scratch? What to put into the widget fields, etc? Thank you!
P.
I can offer assistance. What have you tried so far?
2 Likes
Thanks Theodor...I guess I don't even know where to begin. I was savvy enough to figure out how to get TC running to a widget, but at a loss when it comes to using a custom module, etc...
P.
Using Cubase BTW
-
Copy these widgets to your session.
Bars & Beats - MCU.json (9.5 KB)
-
Match their target to the virtual MIDI port you're using in the Mackie Control remote (it must be a separate port; one that's not used in other scenarious). If you don't work on a MAC, you need loopMIDI to create a virtual port (you probably knew that...).
-
Install one of these two code editors (you'll need one to edit the custom module in a more peaceful way).
https://www.sublimetext.com/
https://code.visualstudio.com/
-
Create a js file containing the code below. You can use any text editor, but the ones I mentioned above are more comfortable to work with. The name of the file doesn't matter.
Note: replace SKiano-C
in the code with the name of your virtual MIDI port (the one you use in the Mackie remote control as output).
module.exports = {
oscInFilter: function(data) {
if (data.host === 'midi' && data.port === 'SKiano-C') {
var [channel, control, value] = data.args.map(x=>x.value)
if (control > 63 && control < 74) {
var digit = 73 - control,
msb = value >> 4,
val = value & 0xF
if (msb >> 2) val += '.'
if (!(msb & (1 << 1))) val = ''
// digit -> digit
// val -> digit's value
// assuming 10 text widgets with incrementing preArgs
receive('/timecode', digit, val)
return
}
}
}
}
-
Open O-S-C and load the js file you've just created to the custom module slot.
-
That's it!
These instructions wouldn't have been possible without @jean-emmanuel's contributions in this topic, so all credit goes to him.
3 Likes
Hallelujah! It worked! It didn't work at first when I used Text edit to make the js file so I used Visual and worked like a charm. Thank you so much and @jean-emmanuel. I can repay with custom icons if you ever need?? I seem to have figured that out...made the Cubase "e" amongst others. 
New problem now. Running a second Mackie control in Studio Setup(remote devices) makes Cubase think I have 2 fader boards. Which then stops the one I am using from controlling half the tracks. I am already using the one in the first Mackie control. Is there anyway to get the info the widget needs from another "remote device" besides Mackie Control? Maybe Mackie HUI?
Interesting.
In one sentence, I would try to send the same thing to 2 devices, i.e. to the MCU device (the fader board) and O-S-C.
Steps:
- Create a separate virtual MIDI port (only for the purpose mentioned above) using loopMIDI (if you're a Windows user) and name it
MCU-OSC
.
- In Cubase, go to "Studio / Studio Setup / Remote Devices".
- Make sure you have a single Mackie Control remote and then set [only] its output to the virtual MIDI port you created at step 1 (i.e. to "MCU-OSC").
- Use Bome Midi Translator Pro to route the signal of
MCU-OSC
to both the MCU unit (the fader board) and O-S-C. I don't know of any other means of routing a MIDI port to multiple ports.
1 Like