Other / Note timing
Returns the current number of the oscillator period for the active voice line, starting from 0. The count is based on the current effective note pitch, so pitch wheel and glide changes are included.
No arguments.
isbigger(mod(nperiod(), 2), 1, saw(X), sin(X))
nperiod() is useful for period-synchronous switching, alternating waveform cycles, or creating oscillator-grain logic that follows the played note. Unlike pos(), which is sample time, nperiod() advances in whole pitch periods.