Well, I can only imagine the sound data sample by sample. Whatever I want to do, I'd do it sample by sample. Working with "sound" as a concept probably includes a lot of ready made sound functions. I know nothing about them. Guess there are tutorials and manuals.
One thing I'd like to do is something I've discussed here earlier, see this topic. Briefly it's a rotation effect. You rotate a 3D sound curve. The three dimensions are time, left channel and right channel. The rotation happens around the time axis. The mathematics is very simple trigonometry, but it has to be performed on each single sample pair.
Control tracks for various effects
Re: Control tracks for various effects
Yes there are a lot of ready made functions which have been written in highly optimised (computer generated) C++ code.jotti wrote:Working with "sound" as a concept probably includes a lot of ready made sound functions.
Yes, there is extensive documentation: http://wiki.audacityteam.org/wiki/Nyquist_Documentationjotti wrote:I know nothing about them. Guess there are tutorials and manuals.
Let's look at a simple example:jotti wrote:Well, I can only imagine the sound data sample by sample. Whatever I want to do, I'd do it sample by sample.
Say we want to increase the value of each sample +0.1
In Nyquist, rather than looping through sample by sample in LISP code and adding 0.1, we can just add 0.1 to the sound.
So if the sound is bound to the symbol "S", then to increment each sample by +0.1 all we need to write is:
Code: Select all
(sum S 0.1)Taking a slightly more complex example, say we want to multiply each sample value by 1/t where "t" is the time relative to the duration (t=0 at the start, t=1 at the end).
Rather than looping through the sound sample by sample, we can create a control signal that rises from 0 at t=0 to 1.0 at t=1
Code: Select all
(pwlv 0 1 1)Code: Select all
(mult s (pwlv 0 1 1))This is hugely simpler to write, much faster and much more efficient than looping through the sound sample-wise.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Control tracks for various effects
Ok. I guess all my ideas for sound effects are on such a low level that there are no ready made functions. I'm kind of thinking of creating these "highly optimised (computer generated) C++ code" myself. Though I don't know what this "computer generated" code means. My idea of a rotating stereo effect is one thing I bet there is no Nyquist function for. And if there are some C/C++ libraries for LADSPA plugins, where you operate on "sound" instead of individual samples, I bet there are no rotating stereo effect functions there either.
Re: Control tracks for various effects
There is no Nyquist function specifically for that task, but I've had a quick read through your old post and implementing your algorithm appears to be quite possible in Nyquist without resorting to sample-wise processing. I expect that it is also possible to program as a LADSPA plug-in.jotti wrote:My idea of a rotating stereo effect is one thing I bet there is no Nyquist function for.
If you want to develop this effect as a Nyquist effect then I can help you with that.
If you want to develop this effect as a LADSPA effect then I can't offer much help as I don't know C/C++.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)