Timecode in TouchDesigner
Timecode is a way of expressing time as a combination of hours, minutes, seconds, and frames. It can be expressed in a string, for example
03:22:11:10, or as a bit pattern, as in LTC timecode embedded in audio streams. The prevalent standard for timecode, SMPTE Timecode, was originally designed for video tape machines, tapes and broadcast transmissions.
In TouchDesigner we try to represent time everywhere possible as timecode, though the fundamental time units are expressed as frames on the timeline and Absolute Time.
Timecode in TouchDesigner is represented in a
tdu.Timecode object. These objects are built into some operators, or can be created as their own entities in python.
Numerous operators that deal with time in various ways have a
.timecode member that report the timecode of the data in that operator in various formats and units.
The Experimental:Timecode CHOP contains a
.timecode member and is an easy-to-use UI to set the current timecode of the CHOP, do some simple arithmetic with timecodes, and convert between different representations of timecode. It gets its timecode values from (1) its parameters, (2) channels coming into the CHOP, (3) other operators, or (4) expressions.
Timecode anywhere in TouchDesigner can be conformed (with limitations) into the SMPTE standard for timecode, or by setting a flag on a
.timecode object, it can be allowed to non-conform, like go past 24 hours, express negative time, or be set to above 100 frames per second.
The tdu.Timecode Object
See: Experimental:Timecode Class
Operators with a .timecode Member
- Timecode CHOP
- Movie File In TOP
- Video Device In TOP
- LTC In CHOP
- LTC Out CHOP (generator)
- Timer CHOP - has 3 members:
.runningLengthTimecode– BACKWARD COMPATIBILITY: these used to return strings but were updated to return a
tdu.Timecodeinstead. There is also
- Stype In CHOP
- Stype TOP
- Timeline CHOP - had a slight revamp
- Time COMP - had a slight revamp
- Sync In CHOP
- DMX In CHOP
- Sync Out or In CHOP tbd
- Mosys OPs have a timestamp
The SMPTE Timecode Standard
Frames in timecode are not the same as frames on the timeline or frames in CHOPs. The timeline can be set to any integer number of frames per second, but timecode coming into or out-of TouchDesigner can have another assumption of frames per second. Typically timecode uses 24, 25, 30, 48, 50 or 60 frames per second, or 29.97 frames per second, implementing what is called "drop frames" in the video industry.