[Audacity-nyquist] RE: Audacity-nyquist digest, Vol 1 #47 - 5 msgs
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
|
From: Roger B. D. <rb...@cs...> - 2005-04-01 15:43:21
|
Alex, It looks like you are doing the right thing. Yes, when you call=20 (snd-fetch (s2 (s1 s))) it's going to call s2 once per sample, generating a brand-new copy of = (s2 (s1 s)), take the first sample which will always be the same, and loop. = So you did the right thing by calling s2 just once and storing the result = in a local variable. SND-FETCH, unlike most Nyquist functions, does not copy = its argument, so (snd-fetch my-s) will modify my-s incrementally by removing = one sample on every call. But you are still seeing large build-ups in memory. Sometimes Nyquist is = too subtle even for me. Now that you tell me my "solution" doesn't work, I = can see (I think) what the problem is. At any point, even when you exit the = do loop, you could write another expression using "s" and you'd get the original input signal, so Nyquist has to keep "s" around with all its samples. But you don't need "s", so try this, which sets "s" to nil = before starting to fetch samples. (let (my-s) (setq my-s (s2 (s1 s))) ;; copies the value of s (set s nil) ;; don't need s anymore (dotimes (n 100) (snd-fetch my-s)) ) I've never done anything like this before, so this is a new "design = pattern" for Nyquist plug-ins that take sound in and put labels out. I hope it = works. -Roger |