List Info

Thread: Re: dotimes - how does it work in plugins?




Re: dotimes - how does it work in plugins?
country flaguser name
Germany
2008-03-09 22:04:04
Second correction today:

'dotimes' in combination with 'setf' seems not to introduce
unnecessary
memory allocation with Nyquist in Audacity as long as no
memory-problematic
functions (i.e. 'peak' and 'snd-fetch' or any functions
which rely on them)
are used within the loop.

Plain english version:

(dotimes (i 1 s) (setf s (notch2 s 100 1)))

causes no more memory allocation than:

(dotimes (i 1000 s) (setf s (notch2 s 100 1)))

...but will take ages to compute. Audacity displayed an
estimated time
of more than 30 minutes for a 10 minutes white noise
track...

'dotimes' is a built-in macro which probably expands to the
nested code
I had written as a 'no-memory-problem' solution.

Because it is a built-in macro I still have found no way how
to 'grindef'
(expands lambda expressions) or 'macroexpand' the generated
code so
the real explanation why this is so, is still missing...

- edgar

---------- original message was: ----------

> Edgar: a solution for a 'harmonics-notch' without
memory problems could be:
> 
> (notch2 (notch2 (notch2 s hz3 [q]) hz2 [q]) hz1 [q])
> 
> where h1 is the fundamental, h2 is the first, h3 the
second harmonics etc.
> The code looks a bit stupid but with Audacity and audio
tracks with more
> than only a few minutes length it works much better
than 'dotimes' code.





-- 
The author of this email does not necessarily endorse the
following advertisements, which are the sole responsibility
of the advertiser:

____________________________________________________________
___________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30
Tage
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220


------------------------------------------------------------
-------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Audacity-nyquist mailing list
Audacity-nyquistlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audaci
ty-nyquist

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )