How to operate on samples directly, e.g. spec f(t)?

Hi tophat,

Generally one would avoid doing that unless it is a last resort. :wink:

There’s two main ways of doing sample-wise DSP in Nyquist. There’s the frustratingly awkward, difficult and slow way, and there’s the much easier and very slow way.

The slow way is by creating a DSP object. Object orientated programming in Nyquist is possible, but horrible :stuck_out_tongue:
There’s an example here: A Study in Pink - #4 by steve

The other way is to grab a load of samples in an array. This is made easy with snd-fetch-array (Nyquist Functions) and snd-from-array (Nyquist Functions).
One thing to be a bit careful about is that with 18 bytes per sample, a large array can be pretty heavy on ram.

An even easier (and even slower) way to access individual samples is with snd-fetch (Nyquist Functions).

Audacity 2.0.5 is now available (a recommended update) Audacity ® | Download for Mac OS