Add auto portamento description to documentation
[zynaddsubfx-code.git] / doc / adsynth.txt
bloba9ee731466aaaf968329ba7592f108e280959c63
1 AdSynth
2 -------
4 AdSynth, a primarily additive synthesis engine, is one of the three major
5 synthesis engines available in ZynAddSubFX.
6 The basic concept of this engine is the summation of a collection of voices,
7 each of which consist of oscillators.
9 High Level (Global)
10 ~~~~~~~~~~~~~~~~~~~
12 AdSynth's global level consists of the elements shown in the below figure:
14 .AdSynth Global Elements
15 image::gen/ad-note.png[scalewidth="50%",width="700"]
17 The global level of adsynth is almost entirely composed of previously discussed
18 elements.
19 However a few new features appear here, this includes velocity sensing, punch,
20 detune options and relative bandwidth , and resonance.
22 .AdSynth Global Window
23 image::images/ad-global.png[]
26 Velocity sensing is simply an exponential transformation from the note's velocity
27 to some parameter change.
28 The below diagram shows how the velocity sensing controls affects this
29 translation over the whole range of possible note velocities.
31 .Velocity Sensing Chart
32 image::gen/velf.png[scalewidth="50%",width="600"]
34 The punch of a note in AdSynth is a constant amplification to the output at the
35 start of the note, with its length determined by the punch time and stretch and
36 the amplitude being determined by the punch strength and velocity sensing.
37 The relBW control in the frequency pane is effectively a multiplier for detuning
38 all voices within an adnote.
40 NOTE: TODO Talk about resonance
43 The sum of the voices are passed through filters and amplification to produce
44 the final sound.
45 This could lead one to think that ad-note is just a bunch of minor
46 postprocessing and at this level much of the sound generation is hidden.
48 Voices
49 ~~~~~~
51 The voice gives access to a similar setup to the global parameters and then some
52 more, such as the modulator, oscillator, and unison features.
54 .AdSynth Voice Window
55 image::images/ad-voice.png[]
57 Modulation
58 ^^^^^^^^^^
60 Within the options for modulation, one can select:
62 * Morph
63 * Ring Modulation
64 * Phase Modulation
65 * Frequency Modulation
66 * Disabled
68 Unison
69 ^^^^^^
71 Unison is useful in creating the chorus like sound of many simultaneous
72 oscillators
74 Oscillator
75 ~~~~~~~~~~
77 The oscillator is lets you choose the basic waveform, which oscillates while
78 the sound is playing and is then further modified.
80 .Oscillator Window
81 image::images/uioscil.png[]
83 [[adsynth::oscilllator::types_of_waveshaping, Types of Waveshaping]]
84 Types of Waveshaping
85 ^^^^^^^^^^^^^^^^^^^^
87 Waveshaping can be done using the *Wsh* area in the Oscillator editor.
89 The type of distortion has much influence on how the overtones are being placed.
90 Sometimes, you get a "fat" bass, and sometimes, high frequencies are added,
91 making the sound "crystal clear".
93 Atan & Sigmoid
94 ++++++++++++++
96 This is the default setting. It is an easy way to apply loudness to a
97 wave without getting undesired high overtones. Thus, it can be used both for
98 making instruments that sound like "real" ones, but also for electronic music.
99 The transformation turns, roughly said, every amplitude into a square amplitude.
100 Thus, sine, power, pulse and triangle turn into a usual square wave, while a saw
101 turns into a phased square wave. A chirp wave turns into a kind of phase
102 modulated square wave.
104 Quants
105 ++++++
107 https://en.wikipedia.org/wiki/Quantization_%28sound_processing%29[Quantization]
108 adds high overtones early. It can be seen as an unnatural effect, which is often
109 used for electronic music.
111 The transformation is a bit similar to building
112 the https://en.wikipedia.org/wiki/Riemann_sum[lower sum] of a wave,
113 mathematically said. This means that the transformation effect turns your
114 "endless high" sampled wave into only a few samples. The more distortion you
115 will apply, the less samples will be used. Indeed, this is equivalent to say
116 that more input amplification is used. To see this, here is a small sample of
117 code, where "ws" is the (correctly scaled amount of input amplification, and "n"
118 the number of original samples.
120 ---------------------------------
121 for(i = 0; i < n; ++i)
122   smps[i] = floor(smps[i] / ws + 0.5f) * ws;
123 ---------------------------------
125 NOTE: If you turn on quantisation very high, you might be confused
126 that, especially high notes, make no sound. The reason: High frequencies are 
127 "forgotten" if you sample with only few samples. Also, the sign of an amplitude 
128 can be forgotten. This behaviour might make some quantisations a bit unexpected.
130 Limiting & Clipping
131 +++++++++++++++++++
133 https://en.wikipedia.org/wiki/Limiting[Limiting] usually means that for a signal,
134 the amplitude is modified because it exceeds its maximum value. Overdrive, as
135 often used for guitars, is often achieved by limiting: It happens because an
136 amplifier "overdrives" the maximum amplitude it can deliver.
138 ZynAddSubFX has two types of limiting. Soft limiting, here as *Lmt*, means
139 that the sound may not exceed a certain value. If the amplitude does so, it will
140 simply be reduced to the limiting value. The overtones are generated in the
141 lower frequencies first.
143 Hard limiting, is also called clipping and abbreviated *Clip*. This means that
144 if the maximum is exceeded, instead of being constant at the limiting value, the
145 original signal still has some influence on the output signal. Still, it does
146 not exceed the limiting value. For ZynAddSubFX, a signal exceeding the limiting
147 value will continue to grow "in the negative". This leads to overtones being
148 generated on the full frequency band.