Use Non-Frames Version Previous Page Next Page
Signal Generators: Dynamic Spectrum Oscillators

vco

  ar      vco        kamp, kfqc, iwave, kpw, ifn, imaxd

Description

Implementation of a band limited, analog modeled oscillator, based on integration of band limited impulses. vco can be used to simulate a variety of analog wave forms.

Initialization

iwave - determines the waveform :

ifn - should be the table number of a of a stored sine wave.

imaxd - is the maximum delay time. A time of 1/ifqc may be required for the pwm and triangle waveform. To bend the pitch down this value must be as large as 1/(minimum frequency).

Performance

kamp - determines the amplitude

kfqc - is the frequency of the wave

kpw - determines the pulse width when iwave is set to 2, and determines Saw/Ramp character when iwave is set to 3. The value of kpw should be between 0 and 1. A value of .5 will generate a square wave or a triangle wave depending on iwave.

Example

instr 10
  idur    = p3               ; Duration
  iamp    = p4               ; Amplitude
  ifqc    = cpspch(p5)       ; Frequency
  iwave   = p6               ; Selected wave form 1=Saw, 2=Square/PWM, 3=Tri/Saw-Ramp-Mod
  isine   = 1
  imaxd   = 1/ifqc*2         ; Allows pitch bend down of two octaves
  
  kpw1    oscil .25, ifqc/200, 1
  kpw     =     kpw1 + .5
  asig    vco   iamp, ifqc, iwave, kpw, 1, imaxd
          outs   asig, asig   ;Output and amplification
endin


f1 0 65536 10 1
  ; Sta Dur Amp Pitch Wave
  i10 0 2 20000 5.00 1
  i10 + . . . 2
  i10 . . . . 3
  i10 . 2 20000 7.00 1
  i10 . . . . 2
  i10 . . . . 3
  i10 . 2 20000 9.00 1
  i10 . . . . 2
  i10 . . . . 3
  i10 . 2 20000 11.00 1
  i10 . . . . 2
  i10 . . . . 3
e

Author

Hans Mikelson
December, 1998 (New in Csound version 3.50)


Use Non-Frames Version Previous Page Next Page
Signal Generators: Dynamic Spectrum Oscillators