Csound Csound-dev Csound-tekno Search About

Re: pvoc,soundin/diskin

Date1998-05-28 18:55
FromHans Mikelson
SubjectRe: pvoc,soundin/diskin
Hi,

You can use reinit to do a loop but I could not get reinit to work with
diskin only soundin.  You can also use a delay line to do a loop with an
amplitude gate and/or the zak opcodes but delay lines tend to develop some
DC offset.  The example does not use an initial offset.

Hans Mikelson

ORCHESTRA

sr=44100
kr=22050
ksmps=2
nchnls=2

;------------------------------------------------------------------
; Sampler Effects
;------------------------------------------------------------------
        instr      7
idur    =          p3
iamp    =          p4
ifqc    =          p5
irattab =          p6
iratrat =          p7
ipantab =          p8
imixtab =          p9
ilptab  =          p10
isndin  =          p11
kpan    oscil      1, 1/idur, ipantab             ; Panning
kmix    oscil      1, 1/idur, imixtab             ; Fading
kloop   oscil      1, 1/idur, ilptab              ; Looping
loop1:
kprate  oscil      1, iratrat/kloop, irattab            ; Pulse Rate
kamp    linseg     0, .01, 1, i(kloop)-.02, 1, .01, 0   ; Amplitude Gate
;                Amp     Fqc
;a1, a2  diskin   isndin, ifqc
a1, a2  soundin  isndin
aout    =        (a1+a2)/2*kamp
;       When the time runs out reinitialize
        timout     0, i(kloop), cont1
        reinit     loop1
cont1:
        outs       aout*sqrt(kpan)*kmix, aout*sqrt(1-kpan)*kmix ; Output pan
& fade
        endin

SCORE

; Rate Table
f29  0 1024  -7  .5   250 .5 6 2 250 2 6 1 250 1 6 4 256 .5
; Pan Tables
f31  0 1024  7  1  1024  0
; Mix Tables
f41  0 1024  5  .01 128 1 768 1 128 .01

f53 60 1024 -7  .12 512 .15 512 .24
;   Sta  Dur  Amp   Pitch  RtTab  RtRt  PanTab  MixTab  Loop  SoundIn
i7  60   8    1     1      29     1     31      41      53    13