1 / 23

Oscillator Algorithm

Oscillator Algorithm. Oscillator Algorithm. SI. Sampling Increment (determines frequency). PHS. Phase Count (0 ≤ PHS < L). Waveform Table. 0. L-1. Output. Sampling Increment. If SI = 1.0:. SR. exp.: 43 Hz = 44100 / 1024. freqF =. L. To create a specific target frequency:. freqT.

spike
Download Presentation

Oscillator Algorithm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Oscillator Algorithm

  2. Oscillator Algorithm SI Sampling Increment (determines frequency) PHS Phase Count (0 ≤ PHS < L) Waveform Table 0 L-1 Output

  3. Sampling Increment If SI = 1.0: SR exp.: 43 Hz = 44100 / 1024 freqF = L To create a specific target frequency: freqT SI = exp.: 10.23 = 440.0 / 43 freqF Or: L * freq. SI = SR

  4. Oscillator Stages L * frequency Initialization: SI = SR PHS = 0 or other initial value PHS = (PHS + SI)%L Sample Rate: IPHS = int(PHS) OUT = WAVE(IPHS) …… etc.

  5. General Stages Initialization: Control rate: Sample Rate: once every n samples SR / second

  6. Program Flow init: control: sample: t

  7. Oscillator Detail SI int fract Waveform Table + 0 PHS int fract 1 = 2 result int fract 3 4 index = (int)PHS 5 N bits n bits ……… 2N = L L-1 (210 = 1024)

  8. N bits n bits n determines the frequency accuracy Df n 0 4 8 12 16 43.066 2.692 0.168 0.0105 0.000657 SR = 44100 L = 1024 How much accuracy is necessary?

  9. L oscillator interpolated 256 512 1024 2048 36 42 48 54 84 96 108 120 dB dB Signal to Noise Depends on L & method Trade-off

  10. Interpolating Oscillator wavetable M M+1 nT int fract output = wavetable(M) + fract*(wavetable(M+1)-wavetable(M))

  11. Envelope Generator Specification LevelScale TimeScale Env.type EnvGen Frequency Mul: Amp Wavetable Osc signal

  12. Envelope Multiplication Osc t * EnvGen t = result t

  13. Env: Changing Amplitude Type: ADSR Attack Decay amp Sustain Release t 0 peakLevel sustainLevel sustainLevel 0 attackTime decayTime sustainTime releaseTime Specification:

  14. Envelope Scaling peak amplitude t duration peak amplitude t duration

  15. Real Instruments Effort ff high t mf med. t p low t

  16. Interpolation by Sample amp(L+1) amp amp(L) n nT L L+1 N n amp =amp(L)+ (amp(L+1)-amp(L)) N + = * / operations count: 1 1 1 1

  17. Interpolation by Successive Addition amp(L+1) amp amp(L) n nT N initialization:amp=amp(L) (amp(L+1)-amp(L)) Damp = N loop:amp=amp + Damp (N times!) + = * / operations count: 1 0 0 0

  18. Interpolation by Successive Multiplication amp(L+1) amp amp(L) n nT N initialization:amp=amp(L) Amp(L+1) Damp = 10 pow( log ( ) - log (Amp(L)) ) N loop:amp=amp * Damp (N times!) + = * / operations count: 0 0 1 0

  19. Problems discontinuities amp nT

  20. Changing Amplitude at low Control Rate Very Audible! sample interpolation frame interpolation nT Discontinuity!

  21. Discontinuities in Samples t Sample hold for 2 sampling instances! Audible Click

  22. Discontinuities in Phase/Frequency f t a t Very Audible

  23. SuperCollider control rate 44100 kr = = 689 Hz 64 block rates? 44100 = 43 Hz 1024 44100 = 86 Hz 512 44100 = 344 Hz 128

More Related