Platforms to show: All Mac Windows Linux Cross-Platform
Back to LTCEncoderMBS class.
LTCEncoderMBS.Constructor(SampleRate as Double, FPS as Double, TVStandard as Integer, Flags as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
EncoderReinit internally see, see notes there.
SampleRate: audio sample rate (eg. 48000)
FPS: video-frames per second (e.g. 25.0)
TVStandard: the TV standard to use for Binary Group Flag bit position
flags: binary combination of flags like LTC_NO_PARITY and LTC_BGF_DONT_TOUCH.
LTCEncoderMBS.CopyBuffer as MemoryBlock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Allocates new MemoryBlock and puts bytes inside.
Returns nil if there is no data.
Some examples using this method:
LTCEncoderMBS.CopyBufferString as String
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Allocates new memory for string and puts bytes inside.
Some examples using this method:
LTCEncoderMBS.DecrementTimecode as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is useful for encoding reverse LTC.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
LTCEncoderMBS.EncodeByte(byte as UInt8, speed as Double) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
see also GetBuffer and BufferPtr
LTC has 10 bytes per frame: 0 <= bytecnt < 10 use TimeCode property to set the current frame before Encoding.
The default output signal is @ -3dBFS (38..218 at 8 bit unsigned). see also SetVolume
if speed is < 0, the bits are encoded in reverse.
slowdown > 10.0 requires custom buffer sizes; see \ref SetBufferSize.
byte: byte of the LTC-frame to encode 0..9
speed: vari-speed, < 1.0 faster, > 1.0 slower ; must be != 0
Returns true on success, -1 if byte is invalid or buffer overflow (speed > 10.0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is equivalent to calling EncodeByte 10 times for bytes 0..9 with speed 1.0.
Note: The internal buffer must be empty before calling this function.
Otherwise it may overflow. This is usually the case if it is read with GetBuffer after calling this function.
The default internal buffersize is exactly one full LTC frame at speed 1.0.
See also:
Some examples using this method:
LTCEncoderMBS.EncodeFrame(Speed as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is equivalent to calling EncodeByte 10 times for bytes 0..9 with given speed.
Speed should be around 1.0 for normal speed.
Note: The internal buffer must be empty before calling this function.
Otherwise it may overflow. This is usually the case if it is read with GetBuffer after calling this function.
The default internal buffersize is exactly one full LTC frame at speed 1.0.
See also:
LTCEncoderMBS.EncoderReinit(SampleRate as Double, FPS as Double, TVStandard as Integer, Flags as Integer) as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Changing the fps and or sample-rate implies a buffer flush, and biphase state reset.
This call will fail if the internal buffer is too small to hold one full LTC frame. Use SetBufferSize to prepare an internal buffer large enough to accommodate all SampleRate, fps combinations that you would like to re-init to.
The LTC frame payload data is not modified by this call, however, the flag-bits of the LTC-Frame are updated:
If fps equals to 29.97 or 30000.0/1001.0, the LTCFrame's 'dfbit' bit is set to 1 to indicate drop-frame timecode.
Unless the LTC_BGF_DONT_TOUCH flag is set the BGF1 is set or cleared depending on LTC_TC_CLOCK and BGF0,2 according to LTC_USE_DATE and the given standard.
ColFrame is cleared and the parity recomputed (unless LTC_NO_PARITY is given).
SampleRate: audio sample rate (eg. 48000)
FPS: video-frames per second (e.g. 25.0)
TVStandard: the TV standard to use for Binary Group Flag bit position
Flags: binary combination of flags.
Returns 0 on success.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
LTCEncoderMBS.GetBuffer(byref size as Integer, flush as boolean) as Ptr
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
size: if set, the number of valid bytes in the buffer is stored in the buffer.
Flush: call FlushBuffer - reset the buffer write-pointer.
Returns pointer to encoder-buffer.
LTCEncoderMBS.IncrementTimecode as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Flushes buffer, reset biphase state.
LTCEncoderMBS.SetBufferSize(SampleRate as Double, FPS as Double) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is needed if you are planning to call EncoderReinit or if you want to keep more than one LTC frame's worth of data in the library's internal buffer.
The buffer-size is (1 + sample_rate / fps) bytes. resizing the internal buffer will flush all existing data in it - alike \ref FlushBuffer.
SampleRate: audio sample rate (eg. 48000)
FPS: video-frames per second (e.g. 25.0)
Returns 0 on success, -1 if allocation fails (which makes the encoder unusable, call discard the object or realloc the buffer)
LTCEncoderMBS.SetFilter(RiseTime as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
LTC signal should have a rise time of 40us +/- 10 us. by default the encoder honors this and low-pass filters the output depending on the sample-rate.
If you want a perfect square wave, set 'rise_time' to 0.
Note EncoderReinit resets the filter-time-constant to use the default 40us for the given sample-rate, overriding any value previously set with SetFilter.
RiseTime the signal rise-time in us (10^(-6) sec), set to 0 for perfect square wave, default 40.0
LTCEncoderMBS.SetVolume(dBFS as double) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Timecode | MBS Tools Plugin | 20.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Typically LTC is sent at 0dBu ; in EBU callibrated systems that corresponds to -18dBFS. - by default libltc creates -3dBFS
since libltc generated 8bit audio-data, the minimum dBFS is about -42dB which corresponds to 1 bit.
0dB corresponds to a signal range of 127
1..255 with 128 at the center.
dBFS: the volume in dB full-scale (<= 0.0)
Returns true on success, false if the value was out of range
The items on this page are in the following plugins: MBS Tools Plugin.