---------------------------- Original Message ----------------------------

Subject: Re: [music-dsp] Wavetable File Formats?

From: "Risto Holopainen" <ebel...@ristoid.net>

Date: Sat, March 10, 2018 11:58 am

To: music-dsp@music.columbia.edu




> Den 2018-03-10 kl. 16:33, skrev Frank Sheeran:



>> What I notice in so many of the existing tools in this niche is that

>> they all let you "draw your own waveform!!!!!!" as if that's something

>> you'd actually want to do.� It always seemed obvious to me that at

>> least drawing the harmonic spectrum would be far more useful, so why

>> this "draw waveform" ability?� Is it just because that's what naive

>> users think would be good?


> Yes, I think you're on to something. Most musicians who use wavetable

> synthesizers probably have no idea what Fourier series are, and at best

> have a diffuse understanding of the relation between waveforms and

> spectra. I also think that this visual interaction can be very appealing

> for many users.


> I can imagine an editor with more perceptually motivated functions,

> where you'd specify a waveform in terms of feature extractors such as

> centroid, odd/even balance of partials, formants, spectral rolloff etc.


> Here's my take on wavetable synthesis, which definitely doesn't let you

> draw your own waveform!


> https://ristoid.net/prog/waveforms.html


> Comments are appreciated. I hope to add a few sound examples some day.

okay, you're gonna get some friendly comments from me:
1. "The wavetables are written to an array expected to be of type double, 
float, or long double, and of odd length."�

why an odd length???� it's pretty hard to get a power of 2 to be equal to an 
odd number (bigger than 1) and there is a great advantage in implementation to 
make wavetables a large power of 2 (like 2048 or bigger).� now, wavetables 
**can** be interpolated and stored in memory as a large
power of two when they are loaded (at program change time).� but during 
synthesis, it's really important that they be a power of two, for simplicity 
and efficiency in the code.� make the wavetable big but with much fewer 
harmonics than Nyquist permits (the highest harmonic should be much
less than half the number of wavetable samples).� expect to do linear 
interpolation with the large and upsampled wavetable to get rid of quantization 
2. "Choose a waveshape, find its Fourier series, and add up a limited number of 
partials to make a strictly bandlimited
this is good advice.� it is the advice i give when using wavetable to do 
"classic analog" waveforms like saw and triangle and square and PWM and even 
master-slave sync-saw or sync-square.� It is pretty easy to use the FFT and 
iFFT to do this.� use a big-long FFT (like 1 Meg
long).� you can prune it down to 2048 or 4096 later.� we can discuss the detail 
of how to do this wavetable harmonic pruning in a later music-dsp post.�
i have found that, with 48 kHz sample rate and a 19 kHz top-end bandwidth, that 
you can get away with 2 wavetables per octave (spaced at 6 semitones) and not 
have aliasing of harmonics.
I have not done any code for this for a quarter century, but long ago i *did* 
write the DSP code for this
software product called "Prophet VS Wavewrangler" by the now defunct "Interval 
Music Systems" (Scott Morgan).� I also wrote a paper in the 90s about wavetable 
synthesis and mathematics regarding it (the "Wavetable 101" paper).� anything 
that's a harmonic tone,
including evolving harmonic tones, can be done convincingly and efficiently 
with wavetable synthesis.� this includes most (a) additive synthesis, (b) 
sampling of harmonic notes, (c) and most algorithmic synthesis (like FM, 
non-linear waveshaping, even FOF with some precomputation, and
"classic" analog waveforms), just as long as the partials or overtones do not 
deviate very far from harmonic frequency values.
3. wavetables can be interpolated between samples (so that the pitch can be 
precisely tuned) and
4. wavetables can be interpolated between each other
to morph tones between different MIDI NoteOn pitches, between different MIDI 
key velocities, between different MIDI mod-wheel settings, and between 
wavetables extracted at different times during the note evolution between 
NoteOn, NoteOff, and when the note finally dies after NoteOff.� One will
need to extract wavetables more densely around the NoteOn attack portion than 
during the decay of the note.� to do this right, the wavetables need to be 
aligned to each other, perhaps spinning one wavetable so that its circular 
cross-correlation is maximum to its adjacent wavetable that it is
being interpolated with.
5. you can also interpolate between wavetables to **selectively** detune some 
partials away from their harmonic value and not other partials (that remain 
harmonic to the fundamental).� you do that by crossfading to other wavetables 
that are identical but with some
harmonics shifted in phase.� a change in phase means a detuning of the 
frequency of the partial from the harmonic value.� to do that, the dimension 
involved should be made circular like with cylindrical coordinates.
i have some C code that demonstrates this interpolation (all linear)
in up to 3 cartesian dimensions (cylindrical in one dimension is an easy 
modification), if anyone is interested.� it's conceptually very simple.� if 
there is a clamoring, i can post it here or send it to whomever requests.� just 
lemme know.
extracting wavetables from a sampled
note can be done staying in the time domain, without an FFT, but a pretty good 
pitch detector and pitch follower is needed.� and a good interpolator (to get 
between samples in the sampled tone) is also needed.

r b-j� � � � � � � � � � � � �r...@audioimagination.com

"Imagination is more important than knowledge."

dupswapdrop: music-dsp mailing list

Reply via email to