Csound Csound-dev Csound-tekno Search About

[Csnd] syntax

Date1999-11-23 14:58
Fromdkampman@xs4all.nl
Subject[Csnd] syntax
Why do I get the error "Segmentation fault" 
while csounding the following .orc-file and 
.sco-file?
A problem is located in the formulation
"(kans>=80 ? kfrq=rnd(770)+110 : kfrq=0)",
and the problem remains when writing
"(kans>=80 ? kfrq=1 : kfrq=0)".
I thought the syntax was ok.


.orc-file:

sr=44100
kr=100
ksmps=441
nchnls=2

instr 1; 
*************************************************************

    
idur      =     p3
iamp      =     p4
ileft     =     .9

    k1    linen    iamp,0,idur,1
    kans    =      rnd(100)
    (kans>=80 ? kfrq=rnd(770)+110 : kfrq=0)
    a1    oscil    k1, kfrq, 1

    a8    =     a1 * ileft            ; left
    a9    =    a1 * (1-ileft)            ; right                 
        outs    a8, a9    

endin    

sco-file: 

f1    0    8192    10    1 ; sinus

;*****************************************************************
*******
; p1 = instrument nr
; p2 = start
; p3 = dur
; p4 = amp
; p5 in orc-file
;*****************************************************************
*******

;p1    p2    p3    p4    

i1    0    1    4000    
i1    +    .    .    
i1    +    .    .    
i1    +    .    .    
i1    +    .    .    
i1    +    .    .    
i1    +    .    .    
i1    +    .    .    
i1    +    .    .    

e



Dick Kampman



--