Re: [linux-audio-user] Bandlimited oscillator plugins for LADSPA ('blop-0.1.0')

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-user] Bandlimited oscillator plugins for LADSPA ('blop-0.1.0')
From: mike rawes (
Date: Fri May 17 2002 - 14:52:27 EEST

[Thinking this should go to linux-audio-dev, so I've
cc'd it for now]

 --- Paul Winkler <> wrote: > On
Thu, May 16, 2002 at 07:01:54PM +0100, Mike Rawes
> wrote:
> > On Thu, 16 May 2002 13:18:03 +0300
> > <> wrote:
> >
> > > [...] when you take two saws with difference in
phase and
> > > differentiate you'll get (variable with phase
difference) pulse
> > > wave.
> >
> > This is exactly what the 'blop' pulse plugin does.
I did a similar thing
> > with a pair of parabolas to get a waveform that
morphs from sawtooth to
> > triangle with phase difference.
> How efficient are these techniques?

At the moment, not very:

I use a set of bandlimited wavetables, each of which
contains a fixed number of harmonics, and have a
maximum playback frequency (=Nyquist/Max harmonic).

A good description of the method by Joe Wright is
found here:

Each cycle (which is either per-sample or per block,
depending on the type of frequency port: Audio or

1. The wavetable to playback is looked up in a binary
(AVL) tree using the frequency as a key against the
maximum playback frequency (This needs to be replaced
with something less elaborate).

2. A sample is retreived from a wavetable using the
3rd order spline code from (as of
blop-0.1.1. Previous v0.1.0 was linear)

3. To avoid harmonics jumping out of nowhere when
pitch sliding down or disappearing when pitching up, a
corresponding sample (same phase) is retrieved from an
adjacent wavetable using the same method. This is then
mixed linearly with the first sample.

4. To get a variable pulse, steps 2 and 3 are repeated
with the shifted phase. The result is subtracted from
the first sample (not phase shifted).

5. Finally, because the differentiation causes DC
shift (for a pulse), or amplitude scaling (for a
variable slope triangle), an additional operation is
performed to correct this.

One AVL tree lookup,
Four cubic spline interpolations,
Two linear interpolations,
A difference,
A small correction fudge (a few adds and multiplies)

So, in sum, could be simpler!

I'd be interested to see how you did yours (in
particular the anti-aliasing hack - do you use


> I just spent the
> better part
> of a day fixing up one of my old csound orcs (now a
> SAOL orc) which
> does square or PWM waves, with an antialiasing hack
> which
> I haven't seen elsewhere, is computationally very
> simple,
> and sounds pretty darn good if I do say so myself...
> especially now that it's not completely borken.
> I used a totally incorrect earlier version for years
> and
> just lived with the aliasing, until I realized the
> other
> day that I'd done everything totally backwards. ;)
> I'll post the sfront orc/sco if anyone's interested,
> it's a very short text file. I also have a 192 k
> bzipped
> test output file which is interesting to listen to
> (and look at a plot of)... I'll send that to anyone
> who asks,
> too.
> --
> Paul Winkler
> home:
> "Muppet Labs, where the future is made - today!"

Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts

New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri May 17 2002 - 14:40:14 EEST