HUI Mackie to MTC timecode

  • Forum
  • HUI Mackie to MTC timecode
0
0

I’m working on a project to slave timecode on my Spirit 328 console to Premier Pro / Audition CC on my Mac. The Spirit 328 supports MTC and LTC. Premier Pro and Audition support HUI by adding it as a control surface. I’ve created a preset in BMT that listens for incoming HUI timecode from PP or Audition, and generates MTC quarter frame messages using a set of 8 translators.

Testing with Audition and Horae (sononum.net), with Horae’s sync source set to BMT, timecode locks beautifully in playback and scrub in either direction. Testing with the Spirit 328, timecode does not lock in playback, but does lock intermittently in forward scrub, so I believe there’s a timing issue. (Using Horae as the MTC master with the Spirit 328, timecode on the Spirit locks accurately.)

Any suggestions for how to overcome the timing issue are welcomed. I may have to punt and use Horae to convert the MTC to LTC, but I’m not thrilled about adding another layer to the conversion.

 

HUI timecode is formatted as:
f0 00 00 66 05 00 11 y0 y1 y2 y3 y4 y5 y6 y7 f7
Where y0 is rightmost digit (frame lsb) and y7 is leftmost (hour msb). Digit value may be preceded by a 1, which needs to be stripped off.

MTP Quarter Frame messages are formatted as:
0nnn dddd
Where nnn is one of 7 possible values indicating what dddd represents:

Value: dddd
0: Current Frames Low Nibble
1: Current Frames High Nibble
2: Current Seconds Low Nibble
3: Current Seconds High Nibble
4: Current Minutes Low Nibble
5: Current Minutes High Nibble
6: Current Hours Low Nibble
7: Current Hours High Nibble and SMPTE Type (0nnn x yy d, where x is unused (0), yy is frame rate (0 for 24, 1 for 25, 2 for 30DF and 3 for 30NDF. For my purposes, I am always using 30NDF.)

My translators are set up as:

Incoming for all translators: Raw midi message
F0 00 00 66 05 00 11 ga gb gc gd ge gf gg gh F7

Translator M0:

Rules:
if ga>15 then ga=ga-16
if gb>15 then gb=gb-16
h0=gb*10
h0=h0+ga
h0=h0%16

Outgoing: MTC Quarter Frame
Message Type 0, Value h0

Translator M1:

Rules:
if ga>15 then ga=ga-16
if gb>15 then gb=gb-16
h1=gb*10
h1=h1+ga
j1=h1%16
j1=h1-j1
j1=j1/16

Outgoing: MTC Quarter Frame
Message Type 1, Value j1

Translator M2:

Rules:
if gc>15 then gc=gc-16
if gd>15 then gd=gd-16
h2=gd*10
h2=h2+gc
h2=h2%16

Outgoing: MTC Quarter Frame
Message Type 2, Value h2

Translator M3:

Rules:
if gc>15 then gc=gc-16
if gd>15 then gd=gd-16
h3=gd*10
h3=h3+gc
j3=h3%16
j3=h3-j3
j3=j3/16

Outgoing: MTC Quarter Frame
Message Type 3, Value j3

Translator M4:

Rules:
if ge>15 then ge=ge-16
if gf>15 then gf=gf-16
h4=gf*10
h4=h4+ge
h4=h4%16

Outgoing: MTC Quarter Frame
Message Type 4, Value h4

Translator M5:

Rules:
if ge>15 then ge=ge-16
if gf>15 then gf=gf-16
h5=gf*10
h5=h5+ge
j5=h5%16
j5=h5-j5
j5=j5/16

Outgoing: MTC Quarter Frame
Message Type 5, Value j5

Translator M6:

Rules:
if gg>15 then gg=gg-16
if gh>15 then gh=gh-16
h6=gh*10
h6=h6+gg
h6=h6%16

Outgoing: MTC Quarter Frame
Message Type 6, Value h6

Translator M7:

Rules:
if gg>15 then gg=gg-16
if gh>15 then gh=gh-16
h7=gh*10
h7=h7+gg
j7=h7%16
j7=h7-j7
j7=j7/16
j7=j7+6

Outgoing: MTC Quarter Frame
Message Type 7, Value j7

Marked as spam
Posted by (Forum: 1, Answers: 3)
April 18, 2018 6:37 pm
175 views
0
Private answer

Using my new rules, this would be the total translator.  Note that 0x7F will convert to it’s decimal equivalent (127) after saving them.

//Strip High Bit MSB
h0=h0&0x7f
//Strip High Bit LSB
h1=h1&0x7f
// Set message type for h0 – message 0
h1=h1&0xf
//Set message type for h1 – message 1
pp=1<<4
h1=pp|h1
// Strip High
h2=h2&0x7f
h3=h3&0x7f
//message type
pp=2<<4
h2=h2|pp
//message type
pp=3<<4
h3=h3|pp
//Strip High
h4=h4&0x7f
h5=h5&0x7f
// message type
pp=4<<4
h4=pp|h4
pp=5<<4
h5=pp|h5
// Strip High
h6=h6&0x7f
h7=h7&0x7f
//message type
pp=6<<4
h6=h6|pp
pp=7<<4
h7=h7|pp

Output F1 h0 F1 h1 F1 h2 F1 h3 F1 h4 F1 h5 F1 h6 F1 h7

 

Marked as spam
Posted by (Forum: 42, Answers: 3457)
April 20, 2018 5:00 pm
Jody, Did this get you closer to a solution?(hopefully you found my typo) // Set message type for h0 – message 0 h1=h1&0xf should have been h0=h0&0xf
( at April 24, 2018 8:25 pm)
0
Private answer

Hi looking at the link I provided, I think the rules should look more like this:

 

//Strip High Bit MSB
h0=h0&0x7f
//Strip High Bit LSB
h1=h1&0x7f
// Set message type for h0 – message 0
h1=h1&0xf
//Set message type for h1 – message 1  shift message type into upper nibble
pp=1<<4
h1=pp|h1
… continue on for other nibbles

Output F1 h0 F1 h1 .., continue on for other nibbles

Marked as spam
Posted by (Forum: 42, Answers: 3457)
April 20, 2018 4:38 pm
0
Private answer

Steve, confirmed that a single translator also works perfectly with Horae slaved to Audition as described above. Spirit 328 Console slaved to Audition still doesn’t work reliably, so this doesn’t resolve the MTC timing issue.

Global vars can be changed to locals, to your previous point.

Incoming: Raw midi message
F0 00 00 66 05 00 11 ga gb gc gd ge gf gg gh F7

Rules:
// M0 & M1
// Strip leading 1 from digit values
if ga>15 then ga=ga-16
if gb>15 then gb=gb-16
// Move frame msb to int 10 position
h1=gb*10
// Add frame lsb to int value
h1=h1+ga
// Calculate frame low bit
h0=h1%16
// Calculate frame high bit
h1=h1-h0
h1=h1/16
// Set message type
h1=h1+16

// M2 & M3
// Strip leading 1 from digit values
if gc>15 then gc=gc-16
if gd>15 then gd=gd-16
// Move second msb to int 10 position
h3=gd*10
// Add second lsb to int value
h3=h3+gc
// Calculate second low bit
h2=h3%16
// Calculate second high bit
h3=h3-h2
h3=h3/16
// Set message types
h2=h2+32
h3=h3+48

// M4 & M5
// Strip leading 1 from digit values
if ge>15 then ge=ge-16
if gf>15 then gf=gf-16
// Move minute msb to int 10 position
h5=gf*10
// Add minute lsb to int value
h5=h5+ge
// Calculate minute low bit
h4=h5%16
// Calculate minute high bit
h5=h5-h4
h5=h5/16
// Set message types
h4=h4+64
h5=h5+80

// M6 & M7
// Strip leading 1 from digit values
if gg>15 then gg=gg-16
if gh>15 then gh=gh-16
// Move hour msb to int 10 position
h7=gh*10
// Add hour lsb to int value
h7=h7+gg
// Calculate hour low bit
h6=h7%16
// Calculate hour high bit
h7=h7-h6
h7=h7/16
// Add SMPTE 30NDF
h7=h7+6
// Set message types
h6=h6+96
h7=h7+112

Outgoing: Raw Midi Message
F1 h0 F1 h1 F1 h2 F1 h3 F1 h4 F1 h5 F1 h6 F1 h7

Marked as spam
Posted by (Forum: 1, Answers: 3)
April 20, 2018 3:01 pm
0
Private answer

Hi Jody,

I probably need to spend more time looking at this as this is quite a complex request but there is one thing I did notice that may cause problems.  You are using the same global variables in multiple translators which is OK, however you should only have one global variable “change” the value as the translators will operate asynchronously and one translator change in the global variable may  adversely effect the other.

For instance in the first two translators:

if ga>15 then ga=ga-15

I suggest that you either capture the value as a local variable or copy the global variable to a local variable and make changes to the local variable instead within rules.

 

Does this make sense?

Steve Caldwell

Bome Q&A Forum Moderator and

Independent Bome programming specialist/consultant

bome@sniz.biz

 

Marked as spam
Posted by (Forum: 42, Answers: 3457)
April 18, 2018 7:16 pm

Thanks Steve, much appreciated. Your comment on the global variables makes sense.

( at April 18, 2018 8:30 pm)

Reading a bit more about how MTC works. Apparently the messages need to be in order so probably best to put everything under one translator,

Input would be the same then rules for all bytes
Output would be something like

F1 ga F1 gb F1 gc F1 gd F1 ge F1 gf F1 gh

after of course modifying the values of each global variable. You could use locals instead since you dont need to share with other translators.

F1 oo F1 pp F1 qq F1 rr F1 ss F1 tt F1 uu

I’m still not 100% on how you are calculating each value. I see you are stripping high bid but then it looks like these are really BCD (Binary Coded Decimal) values) when you are done. I usually put comments before each rule to remind me what I’m doing with each calculation so I can remember when I go back to my project.

( at April 20, 2018 6:39 am)

Thanks Steve, you’re correct, I can use locals since values between the translators don’t need to be shared in the current scenario. The translators are processed in sequence (I’ve confirmed this in test output, but I’ll also experiment with combining them into one translator.

As far as the math, I’ve added comments to the rules below for translators M0 and M1:

M0 rules:
// Strip leading 1 from digit values
if ga>15 then ga=ga-16
if gb>15 then gb=gb-16
// Move frame msb to int 10 position
h0=gb*10
// Add frame lsb to int value
h0=h0+ga
// Calculate frame low bit
h0=h0%16

M1 rules:
// Strip leading 1 from digit values
if ga>15 then ga=ga-16
if gb>15 then gb=gb-16
// Move frame msb to int 10 position
h1=gb*10
// Add frame lsb to int value
h1=h1+ga
// Calculate frame low bit
j1=h1%16
// Calculate frame high bit
j1=h1-j1
j1=j1/16

These repeat for M2-M7 rule pairs (ss, mm, hh), except that dec 6 (bin 0110) is added to the var j7 in the M7 translator to account for the 30NDF SMPTE type .

( at April 20, 2018 1:44 pm)

Did you compare the log output of the working configuration and non-working configuration?

In MT Pro you can set up MIDI thru path and turn on logging even with the working config and then compare with the non-working config (using translators). I have to think you will see a difference that will be obvious.

Also, even though the translators execute in order in MT Pro, at some point there may be other MIDI traffic hence there will be no guarantee the MTC messages will all come through together in the future so best to put everything under one translator.

Also if you want rewind/reverse scrubbing to work, you may need a different MTC translator for that.
As I understand the messages are send in different order .

I found this article which seems to explain MTC in detail. Again I’m no expert in MTC so I’m just interpreting what I read here. I guess I may need to experiment with MTC a bit to better understand how in works completely.

https://web.archive.org/web/20110629053759/http://web.media.mit.edu/~meyers/mcgill/multimedia/senior_project/MTC.html

( at April 20, 2018 3:41 pm)