Re: [Audacity-nyquist] newest rectifier plugs
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
|
From: <edg...@we...> - 2005-11-29 19:43:27
|
Thanks to Alex S. Brown: > If you try to keep the whole sound in memory and use snd-fetch to move > through it, the RAM use for your script will grow dramatically with the > length of the sound. The intention was just the opposite: I wanted to use snd-fetch to avoid keeping the whole sound in memory. > Depending on your algorithm, there may be ways around this effect, but > generally snd-fetch does not let you go backwards or do random access > within the sound. I only whould need a simple sequencial function that reads one sample after the other, sum it up in a single varible (or two in case of stereo) and immediately after reading and adding the sample the snd-fetch memory could be freed again (or garbage collected). I know there is a problem that snd-fetch affects the samples so I'm not sure wether I have to snd-copy the whole sound into memory before I can work on it with snd-fetch. This of course whould turn the whole snd-fetch theory quite useless. Unfortunately I cannot reduce the sample frequency to 100 Hz or similar so I assume a snd-fetch analyzer routine whold be very slow. > The DSP in XLisp chapter is excellent to start working with those functions, > but the memory utilization of these functions takes some time to understand. I know ... (but this is no valid excuse not to learn it) > There may be a built-in function of Nyquist that does a similar calculation Unfortunately there is not, I had the same problem several times ago, at the moment, as far as I know, only the maximum peak is available. The snd-avg function for example calculates the geometrical average (RMS) what is fine for dynamic compressors but unfortunately useless in this case. > If anyone has suggestions, please jump in! I hate posting a reply only > about the problems of a suggested approach. doesn't matter - thank you for your reply - edgar message to david: just got the code changes, I will test it immediately, answer follows in about half an hour. the rest is transcription aud...@li... schrieb am 29.11.05 19:50:13: > > I cannot speak to your DC/filter issues, but I have used the snd-fetch function > quite a bit working on sound detection. I would warn you that snd-fetch is best > used as a one-pass method to examine and manipulate a sound. If you try to keep > the whole sound in memory and use snd-fetch to move through it, the RAM use for > your script will grow dramatically with the length of the sound. Basically, > Nyquist will read the entire sound into memory and hold onto the whole thing > until the script is done. > > Depending on your algorithm, there may be ways around this effect, but generally > snd-fetch does not let you go backwards or do random access within the sound. I > believe Nyquist will accumulate all the samples in RAM if you try to hold onto > the sound variable while using snd-fetch to move through it. > > The DSP in XLisp chapter is excellent to start working with those functions, but > the memory utilization of these functions takes some time to understand. The > plug-ins that ship with Audacity actually suffers from some of these problems. > Others on this mailing list helped me a lot to fix up my plug-ins. > > I think your proposal of using snd-fetch to add the samples into a single > variable would either destroy the sound variable or accumulate all samples in > memory if you tried to keep a copy of the sound variable. There may be a > built-in function of Nyquist that does a similar calculation, without the > memory problems. Something like snd-avg might help, although sometimes these > functions have the same memory-use problems as snd-fetch. > > If anyone has suggestions, please jump in! I hate posting a reply only about the > problems of a suggested approach. > > Quoting edg...@we...: > [snip] > > Now there are two problems. First, Nyquist is designed to work in one pass > > only. This not a bad idea because this way cou can work with a minimum of > > memory because all audio data can be left on the hard disc, in principle > > only the actual sample is needed. But this leads to the next problem: if > > you want to write a two pass filter you have to keep the sound in memory > > between the first and the second pass by assigning it for example to a > > global variable what quickly can lead to a memory overflow depending to > > the length of the audio. > > > > There could be a solution by using the snd-fetch function with that you can > > access single sample values. For example like fetch the first sample and > > save its value in a variable, then fetch the second sample, add it to the > > value in the variable and store the result again in the same variable. By > > adding up all samples one after the other in the same variable and dividing > > the variable value at the end by the number of samples that is given by the > > len variable you could calculate the average off all samples with only one > > variable. > > > > But this is only a theory because I never have worked with the snd-fetch > > function and neither with the xlisp object system that is needed for this. > > Maybe Steven or Sami (or whoever reads this) knows how to do. Or maybe > > this is a reason to learn more about the xlisp object system. > > > > The snd-fetch function and how this could work is explained in the Nyquist > > manual under "DSP in XLisp". > > ---------------------- > 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&alloc_id=16865&op=click > _______________________________________________ > Audacity-nyquist mailing list > Aud...@li... > https://lists.sourceforge.net/lists/listinfo/audacity-nyquist -- The author of this email does not necessarily endorse the following advertisements, which are the sole responsibility of the advertiser: ______________________________________________________________ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 |