0% developed

ZynAddSubFX/PADsynth

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Harmonic structure editor
Oscillator structure editor
Envelopes & LFOs Amplitude editor
Envelopes & LFOs Frequency editor
Envelopes & LFOs Filter editor

Contents[edit | edit source]

  1. Algorithm
  2. Input and Output
  3. Implementation

Description[edit | edit source]

This algorithm generates very beautiful sounds, even if its idea is much simpler than that of other algorithms. It generates a perfectly looped wavetable sample which can be used in instruments. It easily generates sounds of ensembles, choirs, metallic sounds (bells) and many others.

This algorithm is public domain. This page includes some public domain C/C++ implementation sources that can be used in your projects or products.

This algorithm is implemented in ZynAddSubFX in the PADsynth module, which you can download to hear for yourself what beautiful sounds it is capable of generating.

The source code of this algorithm is available for free to be implemented in many software/hardware synthesizers. If your synthesizer uses plenty of samples, you can use this algorithm to generate many ready-to-use samples.

Sound examples of instruments that use this algorithm[edit | edit source]

These sound examples are generated by ZynAddSubFX. All instruments' wavetables are generated by this algorithm. These examples are grouped into two categories:

With Effects[edit | edit source]

In this category, some effects are used. These effects can be reverberation, phaser, etc. Mostly, the only effect was the reverberation.

Without Effects[edit | edit source]

All instruments in this category the instruments are "dry". No reverberation, no other effects.

Tips and suggestions[edit | edit source]

  1. Keep in mind that the resulting wavetables are perfectly looped
  2. When using the wavetables into instruments, on each NoteOn, start from a random position and not from the start. This avoids hearing the same sound on each keystroke
  3. You can use the same wavetable for generating stereo sounds, by playing the same wavetable at different positions for left and right. The best is to make the difference between left right as N/2
  4. Generate different wavetables for different pitches and use the one who is closest to the desired pitch
  5. Upsample or downsample the harmonics's amplitude array before running the algorithm, according to the fundamental frequency. In this case we need to set a parameter "base_frequency" which represents the frequency where the array is left unchanged.
    Example: we have A_orig[]={1,2,1,3,0,0,1,0} and base_frequency is equal to 440 Hz
    Here are some cases:
    - A[] for 440 Hz: is the same as A_orig[]
    - A[] for 220 Hz: is the A_orig[] upsampled by factor of 2
    so: A[]={1, 1, 1.5, 2, 1.5, 1, 2, 3, 1.5, 0, 0, 0, 0.5, 1, 0.5, 0}
    (the original A_orig amplitudes are shown as bold)
    - A[] for 880 Hz: the A_orig[] is downsampled by a factor of 2
    so: A[]={1.5, 2, 0, 0.5}
    - A[] for F Hz: the A_orig[] is scaled by a factor of 440/F.


    Even if this idea is very simple, the resulting sounds are very natural, because it keeps the spectrum constant according to the harmonic's frequency and not to harmonic's number. This follows the point 4 from the document where I described some principles regarding synthesis.

Source[edit | edit source]

  • Source text: the original content of this page (including images, sounds, etc.) is released under Public Domain.