That's true, but it does not solve the original issue (see the first post in the thread). The half wave rectifier was only one part of the job - the code in the previous post does more than that.Storer wrote:Was just looking at this thread and noticed the rather complex code for a half-wave rectifier.
There is already such a function built into Nyquist: (s-max sound1 sound2). This takes two sounds (mono or multi-channel), or a sound and a FLONUM (or two FLONUM's for that matter) and for corresponding samples in the sounds, it returns the maximum. So the expression (s-max s 0.0) will replace all the negative valued samples with zero.
To grab only the negative side of the signal, use (s-min s 0.0).
Molding a tone to a given audio sample (matching silences)
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Re: Molding a tone to a given audio sample (matching silence
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)