Hi Marco,

I don't have experience implementing BLIT; I have done minBLEP—it's been a 
decade probably, I could comment, but it doesn't seem to be the focus anyway.

On wavetables…I agree with Robert that your memory guess is a bit inflated:

First, I'd start with ~20 Hz, not 8 Hz, for full bandwidth. If you really need 
8 Hz and lower with every harmonic, you can easily special-case the lower 
wavetable—for instance, in the case of a sawtooth, a naive sawtooth will not 
have any noticeable aliasing down there. If you make the lowest table 20 Hz, 
you can run it down to your 8 Hz, of course, at the loss of the top octave+ of 
harmonics (most of which you can't hear). And don't forget that in almost any 
musical use, the waveform either won't have significant energy up there, or 
you'll have a lowpass filter on it that gets rid of the energy up there.

So, 1x sampling is plenty in the lowest (longest wavetable requirement) octave. 
That means a table size of 2048 samples, 8k of memory with floats. Eleven 
wavetable cover audio range, so with constant table size, 88k of memory. Now, 
it's not at all difficult to cut your memory by a large factor by using 
wavetable lengths more critically sampled (second table 1024, etc., although 
I'd add a little back by making the top tables oversampled). So, something like 
a factor of four—22k for the set instead of 88k. Also, you can cut either 
method (variable or fixed table sizes) in half if you decide 40 Hz is low 
enough and you can give up a little in the bottom octave (again, you won't hear 
it on most things, because you'll either use a wave with little energy up 
there, or a lowpass filter).

Still, if it's running on a host computer, memory is cheap. Even the 88k per 
table is no big deal, but you can drop that to a fourth or eighth if you want.

For a square/rectangle wave, just use two phases of saw—no new wavetables.

For sine, you already have it in the top octave of the saw—or any other 
waveform–no new table.

For triangle, the harmonics drop off quickly (inverse square) that you don't 
need as many tables, if you want to optimize; it would be a bigger savings with 
variable tables (about half, just by losing the lowest wavetable).

For arbitrary waveforms, you build only as many tables in a set as the harmonic 
content requires. It's easy enough to have your table-generation algorithm be 
smart about the strength of upper harmonics too, to optimize.

And of course, even if you support 1000 wave types, it's unlikely you'll have 
more than a few loaded into memory at one time.

Check out my tutorial, with code (start for the bottom up):

http://www.earlevel.com/main/category/digital-audio/oscillators/wavetable-oscillators/

I'm trying to finish a short video with examples, to upload soon.

Nigel



On May 16, 2013, at 9:05 AM, Marco Lo Monaco <marco.lomon...@teletu.it> wrote:

> Hi guys, here is a repost of a conversation between me and RBJ under his
> permission, since he couldnt send to the NG via plain text from his browser.
> Pls if some of you guys have some suggestion, it would be very much
> appreciated.
> Marco
> 
> ---------------------------- Original Message ----------------------------
> Subject: [music-dsp] Sweeping tones via alias-free BLIT synthesis and TRI
> gain adjust formula
> From: "Marco Lo Monaco" <marco.lomon...@teletu.it>
> Date: Tue, May 14, 2013 6:34 am
> To: music-dsp@music.columbia.edu
> --------------------------------------------------------------------------
>>> I am here asking what is the best practice to deal with frequency
> modulation via BLIT generation.
> 
> hi Marco,
> 
> i've fiddled with BLIT longer ago. as i recall i generated a string of
> sinc() functions instead of a string of impulses and i integrated them along
> with a little DC bias to get a saw. for squareit were two little BLITs,
> alternating in sign, per cycle, and integrated. and triangle was an
> integrated square. i found generating the BLITs to be difficult, i
> eventually just used wavetables for the BLITs at different ranges. and then
> i thought why not just use wavetable to generate the waveforms directly.
> i know with the sawtooth, the bias going into the integrator had to change
> as the pitch changes. i dunno what to do about leftover "charge" left in the
> integrator other than maybe make the integrator a little bit leaky. so that
> is my only suggestion, if you have the rest of the BLIT already
> licked.
> 
> the net advice i can give you is to consider some other method than BLIT
> (like wavetable) and if you're using BLIT with a digital integrator, you
> might have to make the integrator a little "leaky" so that an DC component
> inside can "leak" out.
> 
> bestest,
> 
> r b-j
> 
> ---------------------------- Original Message ----------------------------
> Subject: R: [music-dsp] Sweeping tones via alias-free BLIT synthesis and TRI
> gain adjust formula
> From: "Marco Lo Monaco" <marco.lomon...@teletu.it>
> Date: Wed, May 15, 2013 4:46 am
> To: r...@audioimagination.com
> --------------------------------------------------------------------------
> 
> Hi Robert,
> I tried with leaky: the thing is that it seems you need to compensate for
> amplitudes if you are using a fixed cutoff leaky integrator (if you filter a
> 12kHz blit, its amplitude with an LPF 5Hz will be much lower than a 100Hz
> blit and compensating the amplitude could generate roundoff noise at high
> freqs). As a hack one could use a varying cutoff depending on the f0 tone to
> be synthesized, but that could have problem again in sweeping tones (an LPF
> changing cutoff at audio rate is not generally artifact free). In both cases
> transient and not steady textbook waveforms are the result, which could be a
> problem if there is a distortion stage following (like a moog ladder with
> its non linearities).
> 
> I tried also with wavetables, and the clean solution is a memory eager,
> starting to midi note 0 (8Hz) you need thousands of harmonics until Nyquist,
> with PWL interpolation with at list 2001pts …you can easily reach 300 MB for
> SQR/TRI/SAW!!! Probably a tradeoff and accepting aliasing a bit is the only
> solution. The open problem there is the click (also happening with sincM)
> that you get when you simply add/cut an harmonic in a sweeping context.
> Maybe the SWS BLIT method is the only solution to avoid this and I must
> investigate.
> 
> I also tried HardSync ala Eli Brandt and its consequent method of generating
> aliasfree waveforms, but I get too much aliasing with his implementation for
> minBLEP and with a 32 zerocrossing impulse seems that you cant treat
> waveforms that has a lower 32 samples period (because the OLA method would
> add up creating subsequent DC steps).
> 
> I thought it was much simpler to do an alias free synth, honestly!!!
> 
> Thank you for time
> 
> Marco
> 
> ---------------------------- Original Message ----------------------------
> From: r...@audioimagination.com [mailto:r...@audioimagination.com] 
> Date: mercoledì 15 maggio 2013 17:08
> To: Marco Lo Monaco
> Subject: Re: [music-dsp] Sweeping tones via alias-free BLIT synthesis and
> TRI gain adjust formula
> --------------------------------------------------------------------------
> 
> i don't quite see the memory issues of wavetable as bad as you do, with
> back-of-envelope calculation.  how many ranges do you need?  maybe 2 per
> octave?  there are 10 octaves of MIDI notes.  maybe 4K per wavetable (unless
> you do some tricky stuff so that the high-pitch wavetables may have fewer
> points)  so that's 80K for a single waveform going up and down the whole
> MIDI range.  HardSync will have a large collection of waveforms given the
> different values of oscillator ratios (the main mod control for hardsync).
> is it hardsync saw or hardsync square?
> 
> i gotta reacquaint myself with Eli Brandt's hardsync.  i don't know it.
> 
> L8r,
> 
> r b-j
> 
> 
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp 
> links
> http://music.columbia.edu/cmc/music-dsp
> http://music.columbia.edu/mailman/listinfo/music-dsp

--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Reply via email to