This question follows from: Synthesizing harmonic tones with Karplus Strong

I am attempting to generate a full soundbank of 88 notes.

As far as I can see my three options are:

  1. Using samples
  2. Using something like Karplus Strong (as linked above)
  3. Synthesising each harmonic and combining them

(1) does not give much flexibility and (2) is difficult: to gain any kind of control requires a sophisticated level of understanding of control systems, and I don't have any training. I've been looking through an online MIT lecture series, and I'm daunted. This would take me months or even years to understand.

One disadvantage of (3) is that it may not handle real-time composition as well as (2); it may be heavier to process. For me that's not a problem, I don't need real-time.

I think (3) should be much easier than (2). It should be possible to construct a formula for the amplitude A(t) of a particular harmonic. But I imagine there must be some science of shaping these harmonics; I'm sure many people have experimented with this, and there must be publicly available literature.

And I'm guessing there are some techniques for improving the quality of the sound, for example maybe giving some A * exp( kt ) sin( wt ) wobble to each harmonic, and maybe a note that is struck louder could have a correspondingly higher value for A.


So my question is: what is the parameter space? i.e. what are the best things to tweak?

Links to relevant resources are gratefully received!


PS please note that I'm not after any particular timbre, certainly I'm not try to emulate a piano, I'm simply after a harmonic tone that is pleasing to the ear.


3 Answers 3


You say:

I'm not after any particular timbre, certainly I'm not try to emulate a piano, I'm simply after a harmonic tone that is pleasing to the ear.

but I think something that is pleasing to the ear is probably harder to quantify than emulate a piano!

Bill Sethares has done lots of good work (both theoretically in signal processing and practically as a musician). Bill wrote a book specifically about these ideas.

You can hear an example of his work, called C to shining C here. There is a discussion about it on Wikipedia.

The central idea is that consonance and dissonance are related to psychoacoustics: how the brain perceives sound. As Bill says:

For instance, the perception of "timbre" is closely related to (but also quite distinct from) the physical notion of the spectrum of a sound. Similarly, the perception of "in-tuneness" parallels the measurable idea of sensory consonance. The key idea is that consonance and dissonance are not inherent qualities of intervals, but are dependent on the spectrum, timbre, or tonal quality of the sound. To demonstrate this, the first audio track on the accompanying CD plays an example where the octave has been made dissonant by devious choice of timbre, even though other, non-octave intervals remain consonant. In fact, almost any interval can be made dissonant or consonant by proper sculpting of the timbre.

So, now that I've said it's too hard to answer your question, I'll try to give some pointers.

The main parameters to look at are the amplitudes ($A_k$), decay parameter ($\alpha_k$), (relative) phases ($\phi_k$) and frequency ($\omega_k$) relationships between your tones:

$$ s(t) = \sum_{k=0}^{K-1} A_k e^{\alpha_k t} \sin( \omega_k t + \phi_k) $$

For a harmonic sound, you probably want to select $\omega_k = (k+1) \omega$ where $\omega$ is your fundamental frequency.

For "brighter" sounds, you want $A_k$ for $k>1$ to be larger (i.e. the higher harmonics have greater amplitude).

You can do flanging or phasing by modulating the phase: $$ \phi_k(t) = \Phi_k \sin(\omega_\phi t) $$ where $\omega_\phi$ is much lower frequency than $\omega_0$.


4) Use any other sound synthesis method!

Additive synthesis is both computationally expensive and quite difficult to control (any modification of timbre involves simultaneous modification of all harmonics - so many parameters, none of them solely linked to a meaningful property of sound...).

Your goal is not clear (what kind of realism do you expect, and what kind of control do you want on the sound) but it seems to me that something much simpler from a computational point of view and with less parameters would do. For example, a wavetable oscillator + a filter + an envelope; or a 2-op FM synth.


there is a more efficient way to do additive synthesis if all of the partials are harmonic (meaning every overtone has a frequency that is very close to an integer multiple of the fundamental frequency). it's called "wavetable synthesis" and is not the same as mere sample-playback "synthesis", but is related to it (as well as related to additive synthesis).

sometimes you can group inharmonic partials into harmonic "groups" and use "group additive synthesis", but i don't necessarily want to complicate the discussion with that yet.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.