Bezier curves for graphics, theory, and, sound wave applications are
rather different. Perhaps this will be usefull in deciding which is
I don't see any reason to use a Bezier curve for smoothing. Global
effects are generally unwanted for interpolation. But for wave
synthesis, Bernstien polynomials may be just thing. Expert comment has
to be in context. There seem to be a few flaws in the aurgument, even if
it is only used for smoothing
"1. Undesirable properties of Bézier curves are their numerical
instability for large numbers of control points, and the fact that
moving a single control point changes the global shape of the curve.
2. The former is sometimes avoided by smoothly patching together
low-order Bézier curves."
1. The constants are determined by binomial coefficients, for large
values, Sterling's aproximation might be used.
2. What the text says is true for a graphics package. It is called a
bicubic patch. Each region may have a different color or reflection
coefficient; and there may be thousands of squares stitched together
like a quilt. Indeed! there may be numerical instability.
There can be a three dimensional object in four-space if you want to do
research on the frontiers of mathematics, otherwise the version for wave
files is the simplest case.
A SURFACE in 3-d: This is for graphics, as mentioned above. This might
be of some use in modeling waves in a ripple tank, though the theory of
interference patterns done by other means.
A CURVE in 2-d: This has two parameters, two control points in Windows
paint. There can be many control points, sometimes called a spline. DO
not use two parameters for sound files since there may be two or more
values, for one value of time. If you want two parameters, use separate
One parameter in 2-d: There can be many control points. Over 130 may be
awkward for Nyquist. Note that musical instrument waveforms are
sometimes called beat frequencies, multiple tracks might be appropriate.
Is it HARD?
A plug-in formula can seems to be the usual thing. For many control
points you have to inspect the formula and do the monkey see, monkey do
For Audacity the pairs, (t, bt) would be pushed into list, and used in a
pwl function. bt is just one line of calculations but; would be rather
long, if there are many control points--and you are using a plug-in
A flexible program where the user specifies the number of control points
is not without some effort, though it is hardly intractable.
bt = 0#
t = 0
p1 = 1#: p2 = 3#: p3 = 0#: p4 = 1#
For i = 1 To 11
bt = (1 - t) ^ 3 * p1 + 3 * (1 - t) ^ 2 * t * p2 + 3 * (1 - t) * t ^ 2 *
p3 + t ^ 3 * p4
Cells(i, 1) = t
Cells(i, 2) = bt
t = t + 0.1
On Wed, 28 Jul 2010 14:38:31 -0400, "Roger Dannenberg" <rbd@...>
> Sorry I didn't respond to this while it was fresh. I filed this request
> for smooth envelopes away to possibly implement or at least think more
> about. From mathworld.wolfram.com, " Undesirable properties of Bézier
> curves are their numerical instability for large numbers of control
> points, and the fact that moving a single control point changes the
> global shape of the curve. The former is sometimes avoided by smoothly
> patching together low-order Bézier curves." But patching together
> low-order curves also creates discontinuities at least in higher
> derivatives, and I'm not too clear on the band-limit properties of
> Bézier curves. Furthermore, it's relatively expensive to implement
> high-order polynomials as functions of time without a primitive to do
> it. I think a better idea is to use piece-wise linear functions as
> provided in Nyquist. This has been a standard approach in computer music
> and audio signal processing for decades. If the discontinuities worry
> you, then you can run the pwl function through a low-pass filter using
> any of the Nyquist primitives, which are fast, efficient, and give you
> simple control over how much smoothing is done. One particular case
> where pwl functions are a problem is for quick onsets. If you want to
> smoothly turn on a signal without a click or pop, the usual technique is
> a "raised cosine", or (1 - cos(t))/2, which generates a sort of
> "S"-curve from 0 to 1. In my experience, this is noticeably better than
> a simple linear ramp. You can find an implementation for RAISED-COSINE
> and examples of its use in nyquist/demos/fft_tutorial.htm.