Re: [Audacity-nyquist] Output stream?
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Alex S. B. <ale...@al...> - 2006-01-20 06:02:38
|
I am not sure if there is a more elegant way to do what you are after, but I think you are on the right track. You can get each sample using snd-fetch and then do an operation like you describe on it, then output the result as a sound. The key to getting the output to work is a function called snd-fromobject. The Nyquist manual has a good section on how to do this called "DSP in Lisp". You can look it up either in your local copy of the help file, or this link: <http://audacity.fuchsi.de/download/edgar/nyquist/nyquist-doc/manual/part5.html#38> The whole process is a little complex, requiring the creation of class and a custom object, but the manual walks you through all the steps. Just put your logic in the "next" method, and set up any variables, counters and so on in the "isnew" method. Take a look and let us know if you need any more help. --Alex Quoting Ryan Hill <rr...@ho...>: > I've got an idea for a plug in. I have almost no idea what it will sound > like, but I can describe what it will do. > > It will run through each sample, (probably using snd-fetch) and find each > point where the sample crosses zero. It will also have been keeping track of > the peak. Each time it reaches a zero crossing, it will output a half-wave > scaled to the dimensions specified by the peak and the zero points on either > side of it. > > Here's a picture. Blue is before, red is after. > http://horriblepain.com/quicks/graph.gif > > But the trick is, everything I've done so far has involved transforming the > sound as a whole. I know I can treat snd-fetch kind of like an input stream, > taking in samples of sound sequentially, but I'm not clear on how I would > output the results, one segment at a time, as it is calculated. > > Or is this a sign of imperative language bias, and I should be approaching > this in an entirely different way? ---------------------- Alex S. Brown, PMP ale...@al... http://www.alexsbrown.com/ |