Unit Generators and V.I.s
-
Upload
daphne-ayers -
Category
Documents
-
view
64 -
download
0
description
Transcript of Unit Generators and V.I.s
![Page 1: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/1.jpg)
Unit Generators and V.I.s
• Patches are configurations of V.I.s• Both Patches & Virtual Instruments can be
broken down into separate components called Unit Generators
![Page 2: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/2.jpg)
Unit Generators
• Have input parameters
• Have at least one output
• Perform a function:
° modification of a signal
° combination of signals
![Page 3: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/3.jpg)
ATTACK TIME DECAY
TIME
AMPDUR
FREQ 1 FREQ 2AMP
MULTIPLIER
![Page 4: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/4.jpg)
Oscillators
AMP FREQ
PHASE
![Page 5: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/5.jpg)
Oscillators
• Can be driven by an algorithm in real time• Computers have, until recently, been too
slow to deal with this whilst providing the user with the capabilities they require
• So most virtual oscillators use a waveform that is pre-stored in a wavetable
![Page 6: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/6.jpg)
Wavetables
• The value of many uniformly placed points on one cycle of a waveform are calculated
• These points are stored in a wavetable
![Page 7: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/7.jpg)
Wavetables
-1
0
1
127 255 383 511
A pictorial representation of a wavetable; really it’s just a table of numbers
![Page 8: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/8.jpg)
Wavetables
• The oscillator will retrieve values from the wavetable to produce the wave
• The position we are at along the wave is known as the phase
![Page 9: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/9.jpg)
Phase
• The phase of the wave is it’s position in the wave cycle
• Normally measured in degrees (0 - 360) or radians
• Here it is measured in sample points• Phase (Φ) of 0 is the first sample
![Page 10: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/10.jpg)
Phase
• So if the wavetable has 512 sample points• And the phase is 180 • What sample point are we at?
![Page 11: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/11.jpg)
Phase of 180
-1
0
1
127 255 383 511
![Page 12: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/12.jpg)
Periodic Waves
• We only store one cycle of the wave because the wave is ‘periodic’
• This means it repeats forever
![Page 13: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/13.jpg)
Wrap Around
• So if we talk about a given phase Φ1
Φ1 = 515
• The sample point (Φ) we are looking for in our wavetable is:
Φ = Φ1 – 512 = 3
![Page 14: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/14.jpg)
Digital Waves & Sampling Frequency
• Sound waves held digitally are cut up into small pieces (or samples)
• The number of samples they are cut into affects the smoothness of the wave
• CD sampling frequency = 44,100 samps/sec
![Page 15: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/15.jpg)
Wave Playback
• Playing back the wave in the wavetable will produce a sound of a particular frequency
• Before the wave is played back it must be calculated and then stored
• The number of samples used to store each second of the waveform is known as the sampling frequency, fs
![Page 16: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/16.jpg)
Wave Playback
• When the wave is played back it is played back at the same sampling frequency, fs
• It is possible to figure out the frequency of the wave stored by performing a calculation
![Page 17: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/17.jpg)
Calculating the Frequency of the Wave Held in the Wavetable
![Page 18: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/18.jpg)
fs / N = f0
44,100/512 = 86.13 Hz
Calculating the Frequency of the Wave Held in the Wavetable
![Page 19: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/19.jpg)
Sampling Increment (S.I.)
• We don’t just want 86.13Hz• We want any frequency we want• So we use a Sampling Increment
![Page 20: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/20.jpg)
Sampling Increment (S.I.)
• The sampling increment is the amount added to the current phase location before the next sample is retrieved and played back
• By altering the S.I. we can use the wavetable to create waves of different frequencies
![Page 21: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/21.jpg)
Sampling Increment (S.I.)• Playing back the wave at 86.13Hz means
playing it back as it is• This means adding 1 to each phase location
before retrieving the next sample and playing it back
• This happens 44,100 times a second, and produces 86.13 cycles each second (because there are 512 samples per cycle)
![Page 22: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/22.jpg)
Sampling Increment (S.I.)
fs / N * S.I. = f0
44,100 / 512 * 1 = 86.13 Hz
![Page 23: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/23.jpg)
Increasing Playback Frequency
• Increasing the S.I. decreases the number of samples played back
• So the speed of the wave playback is increased, as is the frequency of the wave produced
![Page 24: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/24.jpg)
S.I. = 2
fs / N * S.I. = f0
44,100 / 512 * 2 = 172.27 Hz
![Page 25: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/25.jpg)
Rearrange the Equation
fs / N * S.I. = f0
S.I. = N * f0 / fs
![Page 26: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/26.jpg)
Playback Wave at 250 Hz
S.I. = N * f0 / fs
S.I. = 512 * 250 / 44,100 = 2.902
![Page 27: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/27.jpg)
Table Look-Up Noise
• We only have 512 samples in our wavetable• The points we have samples for may not
line up with the points at which we wish to obtain samples
• The S.I. is 2.902 but (going from 0) we only have samples at 2 & 3
![Page 28: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/28.jpg)
Dealing With Real Numbers
• The samples we want to grab don’t exist! • Options:
° truncate: 2.902 becomes 2° round: 2.902 becomes 3 ° or interpolate...
![Page 29: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/29.jpg)
Interpolation• 2.902 is used as the S.I. • so take a value at the initial phase (say 3)• add 2.902 to the initial phase = 5.902 to get the
place to take the next value • add 2.902 to this to get the place to take the
next value = 8.804• and so on
![Page 30: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/30.jpg)
Interpolation• we don’t have values at these points so we
calculate estimated values using the nearest samples (this is interpolation)
5 65.902...
0.3
0.7 0.902 * 0.3 + 0.098 * 0.7 , or
90.2% of 0.3 + 9.8% of 0.7
0.2706 + 0.0686 = 0.3392
![Page 31: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/31.jpg)
Interpolation
• Occurs for every sampling increment, so 44,100 times per second
• Uses a LOT of processing power • The interpolation process still requires us to
round numbers up or down, and so still produces error
![Page 32: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/32.jpg)
Table Look-Up Noise
• So rounding is required whatever, and that produces error
• This error is known as table look-up noise• This error affects signal to noise ratio
(S.N.R.)
![Page 33: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/33.jpg)
S.N.R.• Affects the ratio achievable between quiet
and loud sounds.• Dodge (1997): Ignoring the quantisation noise contributed by data
converters a 512 entry table would produce tones no worse than 43, 49, and 96 dB SNR for truncation,
rounding and interpolation respectively. And a 1024 entry table would produce tones no worse than 109
dB SNR for an interpolating oscillator.”
![Page 34: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/34.jpg)
A Sine Wave
time, t0 T/2 T 3T/2-1.5
-1
-0.5
0
0.5
1
1.5
v(t)
![Page 35: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/35.jpg)
A Sawtooth Wave
0 T 2T-1.5
-1
-0.5
0
0.5
1
1.5
time, t
v(t)
![Page 36: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/36.jpg)
A Square Wave
0 T/2 T 3T/2-1.5
-1
-0.5
0
0.5
1
1.5
time, t
v(t)
![Page 37: Unit Generators and V.I.s](https://reader036.fdocuments.net/reader036/viewer/2022081517/5681329f550346895d994023/html5/thumbnails/37.jpg)
A Triangle Wave
0 T 2T-1.5
-1
-0.5
0
0.5
1
1.5
time, t
v(t)