RE: [Audacity-nyquist] snd-average does not work
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Roger D. <rb...@cs...> - 2006-01-11 05:30:17
|
I think you are passing a stereo sound (an array of two values of type SOUND) to snd-avg, which requires a SOUND. You can test for multichannel sounds with TYPE-OF and use (AREF s 0) and (AREF s 1) to get the left and right channels. VECTOR can be used to construct a multichannel sound from two (or more) SOUNDs. -Roger _____ From: aud...@li... [mailto:aud...@li...] On Behalf Of Faisal ... Sent: Tuesday, January 10, 2006 4:32 PM To: aud...@li... Subject: Re: [Audacity-nyquist] snd-average does not work Hello Alex I tried but I am still getting the same message for the plugin. By following your instruction for the prompt, I am now getting the same error as for the plugin. I hope that I am not such a pain but could it be the version of Nyquist or Audacity? On 1/10/06, Alex S. Brown <ale...@al...> wrote: You are almost there. Lisp needs parenthesis around functions and their arguments. Replace this line: snd-avg s blk blk OP-AVERAGE with this one: (snd-avg s blk blk OP-AVERAGE) and you should be on your way! Likewise, when you put the command in at the Nyquist prompt with no parenthesis (like this: "snd-avg s 213 213 OP-AVERAGE"), Nyquist assumes that snd-avg is a variable, and you want to output its result. Since no such variable has been defined, it errors out. If you add the parenthesis (like this: "(snd-avg s 213 213 OP-AVERAGE)"), Nyquist will look for a function named "snd-avg" and will pass the four arguments into it (s, 213, 213, and OP-AVERAGE). This is what you want -- it should work. --Alex P.S. If you have programmed in other languages like BASIC or C, lisp takes a lot of getting used to. Parentheses have a totally different purpose than in any other language I have seen, and they are the key to getting it right. If I see something erroring out because of an unbound variable or invalid function, the first thing I look for is bad parentheses, especially unmatched parentheses. Quoting "Faisal ..." <fmo...@gm...>: > Hello Listers > > Thanks for your feedback so far but I am still having problems. I am using > Audacity 1.2.3 build 17-Nov-2004, forgot to mention in previous email. > > When I type the following in the Nyquist Prompt: > snd-avg s 213 213 OP-AVERAGE > > This is what I get: > > *error: unbound variable - SND-AVG > if continued: try evaluating symbol again > 1> #(#<Sound: #27523a0> #<Sound: #2752628>) > 1> 213 > 1> 213 > 1> 1 > 1> [ gc: total 18640, 3675 free; samples 1KB, 0KB free ]* > > And I could not debug my plugin so I modified it slightly so that I can do > so. > Here is the code: > > > *;nyquist plug-in > ;version 1 > ;type process > ;name "sound averager" > ;action "sound averager" > ;info "By Faisal Mooraby" > ;control blk "Block Size" real "" 100.0 0.0 10000.0 > ;; Note: this effect will use up memory proportional to > ;; delay * count, since that many samples must be buffered > ;; before the first block is freed.* > > *snd-avg s blk blk OP-AVERAGE > * > > and that's what I get from the debuging output: > > *error: bad argument type - #(#<Sound: #27523a0> #<Sound: #2752628>) > Function: #<Subr-SND-AVG: #f11970> > Arguments: > #(#<Sound: #27523a0> #<Sound: #2752628>) > 213 > 213 > 1 > 1> [ gc: total 18640, 3674 free; samples 1KB, 0KB free ] > * > Again, I appreciate your help. > > Faisal Mooraby ---------------------- Alex S. Brown, PMP ale...@al... http://www.alexsbrown.com/ ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637 <http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click> &alloc_id=16865&op=click _______________________________________________ Audacity-nyquist mailing list Aud...@li... https://lists.sourceforge.net/lists/listinfo/audacity-nyquist -- Faisal Mooraby |