nsamp

nsamp —
Returns the number of samples loaded into a stored function table number.

Description

Returns the number of samples loaded into a stored function table number.

Syntax

nsamp(x) (init-rate args only)

Performance

Returns the number of samples loaded into stored function table number x by GEN01. This is useful when a sample is shorter than the power-of-two function table that holds it. New in Csound version 3.49.

As of Csound version 5.02, nsamp works with deferred-length function tables (see
GEN01).

nsamp differs from ftlen in that nsamp gives the number of sample frames loaded, while ftlen gives the total number of samples. For example, with a stereo sound file of 10000 samples, ftlen() would return 19999 (i.e. a total of 20000 mono samples, not including a guard point), but nsamp() returns 10000.