Timecode
Timecode in TouchDesigneredit
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 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.
Tip: See the OP Snippets for the Timecode CHOP.
Tip: A useful box for monitoring timecode: Rosendahl Timecode
The tdu.Timecode Objectedit
See: Timecode Class
Operators with a .timecode Memberedit
- Timecode CHOP
- Movie File In TOP
- Audio File In CHOP
- Video Device In TOP
- LTC In CHOP
- LTC Out CHOP
- Timer CHOP - has 3 members:
.timecode
,.runningTimecode
, and.runningLengthTimecode
– BACKWARD COMPATIBILITY: these used to return strings but were updated to return atdu.Timecode
instead. There is also.masterTimecode
,.playingTimecode
,.cumulativeTimecode
. - Stype In CHOP
- Stype TOP
- Timeline CHOP
- Time COMP
- Sync In CHOP
- DMX In CHOP
- Clock CHOP
- MIDI In CHOP
- OAK-D OPs
The SMPTE Timecode Standardedit
See:
Framesedit
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.
Drop Frameedit
See: https://sonix.ai/resources/what-is-drop-frame-vs-non-drop-frame-timecode/