> I'm trying to write my first plugin, but I'm not making much progress. What I
> want to do is "clean" the selected segment by replacing each sample at
> position [i] with the average of samples from [i-n] to [i+n]. That means that
> I need to access the samples directly.
You can use 'snd-avg' (sound-average) for this.
> First, I need to determine the number of channels, as well as the number of
> samples in the channels. I tried using
> (length s)
> but that didn't seem to work. What's the correct way to get the size of an
How to compute the length of a track [or selection] please look at the
'Audacity Nyquist FAQ' I had posted three or four month ago to this list
[see the SourceForge archives].
You can differ between mono and stereo tracks by using 'arrayp s'
If 's' is an array [arrayp returns T] the track is in stereo. In this case the
left channel can be refered by 'aref s 0' and the right channel by 'aref s 1'.
If the track is mono [arrayp returns NIL] you can process the 's' variable
[containing the the Audacity sound] as-is.
> Second, how do I get to the samples? If I grab a given channel, will I get an
> array of samples, or do I have to dig deeper?
If the sound is mono you could just write:
(snd-avg s [Parameters])
and the return value will be automatically given back to Audacity.
For the exact parameters please look into the Nyquist manual
[I don't know myself just 'out of my head'].
If you need more information about XLISP [the language Nyquist is
based on], see:
The most actual Nyquist manual always can be found on
Roger's page at the CMU:
The author of this email does not necessarily endorse the
following advertisements, which are the sole responsibility
of the advertiser:
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!