Molding a tone to a given audio sample (matching silences)

Effects, Recipes, Interfacing with other software, etc.
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
steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Molding a tone to a given audio sample (matching silence

Post by steve » Fri Aug 28, 2009 1:19 am

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).
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.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply