I was writing some new input processor modules today for my new plug-in which uses two channels and ran into a bit
of a “snag” about determining if a user was using mono or stereo tracks.
The (IF (ARRAYP S) (YADDA YADDA)) would work if using the (IF (T) (NIL)) form of this IF statement (in this case),
but I never dug the IF THEN ELSE form of IF so I was searching for a better sollution.
Anyway, I tried
(IF (ATOM S) (YADDA YADDA))
and this worked, but also returned “true” for stereo tracks.
I was much disappointed when I tried:
(IF (SOUNDP S) (PRINT "YES"))
To my surprise, this actually works (printing “YES” for mono tracks) and returns NIL/“false” for stereo tracks.
As SOUNDP is undocumented (as far as I know), I thought i’d mention it here…
Also, this worked in Audacity 1.2.6 so I’m not sure if 1.3 supports it still…
Oh yeah, I guess it IS in the manual. I did a Bing search on it and came up with nothing so I guess I figured it wasn’t in there.
Good to know though. Things like this always escape me. Like the time I couldn’t find the (floatp) code anywhere and had to
think of creative uses for (integerp). Finally, after like six months I finally found (floatp), thus saving some coding time.