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
Allocate and initialize LTC audio encoder.

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
Copy the accumulated encoded audio to the given sample-buffer and flush the internal buffer.

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
Copy the accumulated encoded audio to the given sample-buffer and flush the internal buffer.

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
Move the encoder to the previous timecode frame.

This is useful for encoding reverse LTC.

LTCEncoderMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Timecode MBS Tools Plugin 20.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The destructor.

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
Generate LTC audio for given byte of the LTC-frame and place it into the internal buffer.

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)

LTCEncoderMBS.EncodeFrame

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Timecode MBS Tools Plugin 20.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encode a full LTC frame at fixed speed.

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
Encode a full LTC frame at fixed speed.

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
Change the encoder settings without re-allocating any library internal data structure (realtime safe).

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.

LTCEncoderMBS.FlushBuffer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Timecode MBS Tools Plugin 20.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reset the write-pointer of the encoder-buffer.

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
Retrieve a pointer to the accumulated encoded audio-data.

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
Move the encoder to the next timecode frame.

Some examples using this method:

LTCEncoderMBS.Reset

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Timecode MBS Tools Plugin 20.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Resets ecoder state.

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
Configure a custom size for the internal buffer.

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
Set encoder signal rise-time / signal filtering.

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
Set the volume of the generated LTC signal.

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.


The biggest plugin in space...