/ HALion Developer Resource / HALion Script / Reference /

samples2ms

samples2ms(samples)

Description

Function to convert a number of samples to the equivalent duration in milliseconds. The sample rate at which the plug-in runs is taken into account.

Available in: Processor.

Arguments

ArgumentDescriptionValue Type
samplesThe number of samples.number

Return Values

Returns the specified number of samples as duration in milliseconds.

Example

-- Print the project sample rate in ms.

function onNote(event)
    fs = getSamplingRate()
    print(samples2ms(fs), "ms")
end

See also: ms2samples, ms2beat, beat2ms