Timecode handling in Nuendo XML files: Attempting to understand Track Archive Event Start values

Hey there!

This is a bit of a niche question but I’m hoping someone might have a sliver of insight; if any Nuendo developers are in here I would greatly appreciate your feedback!

When Nuendo saves a track archive XML the position of events is stored as:
float name=“Start” value=“3695.9005416666668679681606590747833251953125”
Likewise, the timecode Start in Nuendo itself (for the above entry) is: 01:01:32:05

My question is, “What is being stored? How did we go from 01:01:32:05 to 3695.90–?”

I assume it’s stored as seconds via a 64bit floating point value but I think I’m wrong on that because the math just ain’t mathin’.

What for you ask?

Well, I’ve built an application that takes an ADR script, agnostic of format, and converts it into a track archive of marker tracks with cooresponding cues ready for a record session. To accomplish this, I construct a track archive XML in Nuendo’s format. However, when I bring them into Nuendo, my marker timecodes are always off by roughly 3 seconds give or take. Sadly, I can’t just add the difference and call it a day.

The conversion from timcode to seconds in my program looks like this:
(hours * 3600.0 + minutes * 60.0 + seconds) + ( frames / frame_rate)

If I run my timecode of 01:01:31:05 through the above equation we get:
3692.1666666666665
Which is pretty dang close to Nuendo’s, albeit with less precision:
3695.9005416666668679681606590747833251953125

You’ll notice the key difference is about 3.8 seconds!

The framerate being used is 23.98, which is also what the project is set to in Nuendo, I tried 23.976 but that didn’t work either.

So IF Nuendo is storing the location of events as a floating point number of seconds, then how are they calculating that? Of course there’s floating point precision to consider, but I highly doubt rounding errors would result in a discrepency of multiple seconds.

Now I know what you might be thinking, why not just use the ADR Api? Good question!

Answer is: I would if I could. I can’t find the documentation for such a thing anywhere and it looks like others on the forum havent had much luck either. :melting_face:

Thanks for reading and I appreciate any help I can get!

1 Like

Have you tried with any other fr? I.e. 24.

Also there is a figure missing in your post (the first one) but I think it is the same figure you mention later.

I’m viewing on phone now but will follow up tomorrow.

Hey! Edited my response. The missing entry should be there now, also corected the difference. I believe I did try 24, but I know I tried 30 and had the same issue. I can try again when I’m back at the office.

1 Like

If you place an event at exactly 1 second (23,98 fps), the start value is

1,0009999999999998898658759571844711899757385253906

Then you have your 3695. :innocent:

2 Likes

Wow. How did I not think of that!!
You deserve a cookie, thank you so much it works!

I’m ususally not a fan of magic numbers but it’s easy to implement and it gets the job done, right?

Cheers!

1 Like

Nice one guys. :pray:t3::pray:t3::pray:t3:

1 Like

Just a comment, but I bet it is easier to use edl or even easier csv to do this than dealing with the numeric dance in a track archive?

1 Like

You’d think!

But the “numeric dance” only needed to be figured out once for the logic of the app.

Otherwise it’s more about creating a custom solution for our use case. We recieve ADR scripts for clients and studios in a variety of formats. Be it word documents, icloud notes, excel spreadhseets, pdfs, text files, and csv’s too. Unless it is a csv with a delimiter and structure compatible with Nuendo, all of the setup for a session must be done manually, which for tv shows and large format productions can take upwards of an hour or even three hours; especially in our studio where we do a a lot of foreign language dubbing.

This app uses AI to parse through any type of script, looking for character names, dialogue, timecodes and directorial notes. The app then packages each character on their own marker track with cooresponding cues and relevant notes and dialogue loaded in.

This saves us and our assistants a lot of time! So it was worth the effort spent coding :smiling_face:

EDIT: I could export to a .csv that Nuendo could read easy enough (which I think is what you meant), but track archive makes it easier to do a lot of characters en masse.

Cool. Thanks for explaining. Sounds like a interesting project.
If we did a lot of dubbing and script handling I’d be tempted to try to get to know more about it (I still am interested but only in a curious way as I don’t see a need for your tool for what we do).

Was the Ai coding difficult or can AI actually help with the analysis and how to code (I know it can to an extent, I have used AI for scripting beyond my own knowledge level)?

So if you are comfortable telling more about it I’m interested, if you are not comfortable that is totally fine to.

1 Like

I am honoured to have been able to contribute to such a meaningful project. :+1:

Who do I contact to get my cookie? :wink:

2 Likes

Yes! I use AI in the scripting process as well, it handles a lot of “busy-work” for me that I don’t really want to do, things like coming up with regular expressions, structuring types and error handlers. But it is far from magic and most of the work still has to be done by hand. Otherwise, in order to get any kind of reliable code from it you have to really break things down into pieces.

As far as the actual integration though, it was fairly easy to setup a developer account with OpenAi and use their API to connect with their models, for this one I used GPT 3-5 Turbo which is their latest lightweight model, it’s pretty fast and with the right prompt it can reliably hunt for the universal constants of any scipt: character/actor name, timecode, and a string of dialogue. I also have it grab director’s notes but this can be hit or miss. Engineering the prompt to get the output I wanted took a fair amount of time, although the whole app came together in about a week.

1 Like