Csound Csound-dev Csound-tekno Search About

Direct2.11 tip

Date1998-12-28 17:19
FromYair Kass
SubjectDirect2.11 tip
Hi list,

This is something i encountered when moving
from Direct2.1 to Direct2.11.
I wouldn't say it's a bug (maybe an improvement)
but i'm reporting this for those who may be interested:

The code below plays a sine wave while the user
controls the depth of a vibrato.
Direct2.1 didn't mind that 'kenv' is used
(as the max. value for 'kenvdp') before it is defined.
But Direct2.11 DID.
To fix that, just put the 'kenvdp ctrl7.........' line
AFTER 'kenv' is defined.

I know this may sound (or be) very  trivial but since
there was a difference between the two version's
performance, I thought I'd say something.
Hope this helps (:-}
Yair

;------------------------------------------------------------
sr         = 44100
kr         = 441
ksmps  = 100
nchnls  = 1

instr 1
ihold                                  ;Keep instrument on.

kenvdp ctrl7 1,1,  1,kenv   ;Controls the depth of the vibrato

kenv   oscili 0.5,2,1            ;Vib -
kenv   = kenv+0.5              ; - rato

asig   oscili 20000,440,1    ;Carrier
aout   = asig*kenvdp          ;Modulate
       out aout
endin
;--------------------------------------------------------------
f1 0 4096 10 1 ;Simple sine wave
f0 600
i1 0 1
e
;--------------------------------------------------------------