/ HALion Developer Resource / HALion Script / Reference /
ms2samples
ms2samples(ms)
Description
Function to convert a duration in milliseconds to the equivalent number of samples. The conversion takes into account the sample rate at which the plug-in runs.
Available in: Processor.
Arguments
Argument | Description | Value Type |
---|---|---|
ms | The duration in milliseconds. | number |
Return Values
Returns the number of samples that is the equivalent of the specified duration in milliseconds.
Example
-- Print the duration 1000 ms in number of samples.
function onNote(event)
print(ms2samples(1000), "samples")
end
See also: samples2ms, ms2beat, beat2ms