MIDI Timecode logic

Hi everyone! Massive thanks to the community here and jean-emmanuel for being such a helpful guy and quick to respond and implement new features. I’ve been following OSC for couple of years now, but I think it’s finally ready to replace my Lemur setup.

I have a question about recently implemented MTC. Don’t have any experience in writing JS (more C++/Rust) and I’d love to somehow adapt the logic and timecode display similar to here: node-rtpmidi/blob/master/src/MTC.js

Esentially, I’d love to have a timecode display in hh:mm:ss:ff format. For now, I got to the point where I have the MIDI timecode SysEx displaying in the text field (F0 7F 7F 01 01 20 00 04 00 F7). Using this I was able to understand what it all stands for and how quarter frame message works. Still, I feel quite lost on how to connect the dots and have the fully-functional time display in OSC. Is it better/cleaner to have it in an external module or would having it implemented in “script” be enough? Appreciate the help and I know it might be a useful addition to OSC for everyone, once it’s figured out!

About my setup:
I’m using Cubase and I’m sending MIDI timecode directly from it. Currently using OSC v1.7.0-beta3.

Hi ! Parsing the MTC from the custom module seems better to me: you’d need to parse the incoming sysex MTC and use receive() at some point to transmit the formatted value to a widget. The module you linked is good, I might just use it base some built-in implementation on it :slight_smile:

Thanks @jean-emmanuel! I have managed to get it to display full frame TC, but I’m having issues with quarter frame logic – I don’t quite get the bitwise operations. Here’s the project file, if someone wants to poke around:
mtc_lcd.json (4.2 KB)

Well, I got a little further now.
Full Frame messages work and display nicely.
Quarter Frame messages have some weird issues that I can’t really pinpoint… At first I thought it was an issue with Cubase sending the timecode, but when I checked with Reaper – the latter receives and displays it fine.
mtc_lcd v1.01.json (4.2 KB)

Here’s the video of the behaviour:

Quarter Frames are a bit trickier indeed… I won’t go into details now because the built-in implementation is almost done and likely to be included in next release.

1 Like

How lovely! Waiting patiently!

Now you can send/receive MTC messages : https://openstagecontrol.ammd.net/docs/midi/midi-messages/#mtc-timecode
Incoming quarter frames are consolidated into full frames automatically.

Yes - thank you!
Got it to work earlier today! I noticed that sometimes it doesn’t quite catch the playback (but as soon as it’s stopped the full frame is parsed and displays instantly.
Any kind of debug trace I could provide for this?

Here’s a video of the behaviour:

Yeah, I found some mistakes in my code, should be better in v1.7.2 :wink:

1 Like