Monitor the project cursor position of Cubase with OSC

In Cubase Pro v10.5.20 I have this thing called a Transport Bar. On it I can see the current position (in Bars and Beats) of the Project Cursor. I'd like to see this also on my OSC client (my touchscreen tablet which is connected to the OSC server). Is this possible in the current OSC version (v1.8.7)?

Cubase, beside the Generic Remote, has this window with a couple of settings:

I think the question is can Cubase send this information through MIDI or OSC messages , if it can, then O-S-C will should be able to receive it; as for midi time code messages, the "mtc" parameter must be added to O-S-C's midi config to enable them.

I found here some information about MTC in Open Stage Control.
Thank you.

I've set Cubase to send MTC to O-S-C.
Proof:

I've added a text indicator widget and filled the fields like this:

But nothing is shown in the text indicator field, when Cubase is playing back.

The address should be /mtc (as seen in the server's logs). /mtc timecode, as seen in the documentation is a representation of the osc message converted from the midi event (address + argument/value)

I must say it crossed my mind to delete the second word ("timecode").
I made it work! Now I need to figure out a way to send Bars and Beats information to O-S-C.

EDIT:
I've created a new topic on the Steinberg Forums asking how to send from Cubase Bars and Beats information (using MIDI). This is the link.

EDIT 2:
I got banned from the Steinberg Forums. That's why the above link doesn't work. Starting february 23 (when it will be my birthay) 2021, my account will get unblocked and the link to the topic will work again (I hope).

1 Like

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:

  1. 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).
  2. 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.

Understood. Thank you.

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.