Csound Csound-dev Csound-tekno Search About

[Csnd] randi error in the Amsterdam catalog

Date2014-02-15 15:28
Fromjean-michel darremont
Subject[Csnd] randi error in the Amsterdam catalog
Coming back to CSound after a while I notice that for some reason the "randi"
opcode doesn't work anymore as expected. I don't know how to fix this.

Here is the error I get in CSoundQT-d-CS6:
/"using callback interface
error: syntax error, unexpected T_OPCODEB  (token "randi") line 26:
>>>        a4   randi <<<
Unexpected untyped word a4 when expecting a variable
Parsing failed due to invalid input!
WARNING: Stopping on parser failure/"

I didn't find any solution in the forum.

Here is the .csd file coming from the famous Amsterdam Catalog:




; ************************************************************************
; ACCCI:     01_11_1.ORC
; synthesis: simple(01),
;            LFO modulating amplitude of basic instrument + % random
;            amplitude variation (11)
; coded:     jpg 10/93

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

instr  1; ****************************************************************
idur  = p3
iamp  = p4
ifq1  = p5
if1   = p6
if2   = p7
ifq3  = p8
iperc = p9  ; random amplitude in percent of iamp
ifqr  = p10 ; frequency of bingo

        a4   randi   (iamp/100)*iperc, ifqr ; % random amplitude variation

        a3   oscili  a4+iamp, ifq3, 1      ; LFO modulating amplitude

        a2   oscili  a3, 1/idur, if2       ; envelope

        a1   oscili  a2, ifq1, if1         ; waveform
             out     a1
endin



; **********************************************************************
; ACCCI:     01_11_1.SCO
; coded:     jpg 10/93

; **********************************************************************
; GEN functions
; waveform
f1 0 2048 10 1 .4 .2 .1 .1 .05                   ; six harmonics

; envelope
f31 0 512 7 0 1 0 49 .8 100 .9 50 .7 150 .2 162 0


; **********************************************************************
; score                                   LFO     RAND
; instr 1  idur     iamp ifq1  if1  if2   ifq3    iperc  ifqr
i1  1      1.5      8000 1109   1    31     4        1     40
i1  3       .       .    .      .     .     .       50     .
i1  6       .       .    .      .     .     .       80     .
i1  9       .       .    .      .     .     .        1    110
i1 12       .       .    .      .     .     .       50     .
i1 15       .       .    .      .     .     .       80     .
e




Thank you for any help.

Jean-Michel Darrémont




--
View this message in context: http://csound.1045644.n5.nabble.com/randi-error-in-the-Amsterdam-catalog-tp5732606.html
Sent from the Csound - General mailing list archive at Nabble.com.


Date2014-02-15 16:25
FromVictor Lazzarini
SubjectRe: [Csnd] randi error in the Amsterdam catalog
I think this is OK in the latest release version of Csound.  It’s OK with the current git develop branch sources (tested now).

Otherwise, the fix is simple

> a4   randi   (iamp/100)*iperc, ifreq

becomes

a4   randi   iperc*(iamp/100), ifreq

Victor
On 15 Feb 2014, at 15:28, jean-michel darremont  wrote:

> 
> 
> 
> 
> ; ************************************************************************
> ; ACCCI:     01_11_1.ORC
> ; synthesis: simple(01),
> ;            LFO modulating amplitude of basic instrument + % random
> ;            amplitude variation (11)
> ; coded:     jpg 10/93
> 
> sr = 44100
> kr  =  441
> ksmps= 100
> nchnls = 1
> 
> instr  1; ****************************************************************
> idur  = p3
> iamp  = p4
> ifq1  = p5
> if1   = p6
> if2   = p7
> ifq3  = p8
> iperc = p9  ; random amplitude in percent of iamp
> ifqr  = p10 ; frequency of bingo
> 
>        a4   randi   (iamp/100)*iperc, ifqr ; % random amplitude variation
> 
>        a3   oscili  a4+iamp, ifq3, 1      ; LFO modulating amplitude
> 
>        a2   oscili  a3, 1/idur, if2       ; envelope
> 
>        a1   oscili  a2, ifq1, if1         ; waveform
>             out     a1
> endin
> 
> 
> 
> ; **********************************************************************
> ; ACCCI:     01_11_1.SCO
> ; coded:     jpg 10/93
> 
> ; **********************************************************************
> ; GEN functions
> ; waveform
> f1 0 2048 10 1 .4 .2 .1 .1 .05                   ; six harmonics
> 
> ; envelope
> f31 0 512 7 0 1 0 49 .8 100 .9 50 .7 150 .2 162 0
> 
> 
> ; **********************************************************************
> ; score                                   LFO     RAND
> ; instr 1  idur     iamp ifq1  if1  if2   ifq3    iperc  ifqr
> i1  1      1.5      8000 1109   1    31     4        1     40
> i1  3       .       .    .      .     .     .       50     .
> i1  6       .       .    .      .     .     .       80     .
> i1  9       .       .    .      .     .     .        1    110
> i1 12       .       .    .      .     .     .       50     .
> i1 15       .       .    .      .     .     .       80     .
> e
> 
> 
> 



Date2014-02-15 16:58
FromMichael Gogins
SubjectRe: [Csnd] randi error in the Amsterdam catalog

Remove the space between randi and the parenthesis.

On Feb 15, 2014 10:29 AM, "jean-michel darremont" <jmdbrady@free.fr> wrote:
Coming back to CSound after a while I notice that for some reason the "randi"
opcode doesn't work anymore as expected. I don't know how to fix this.

Here is the error I get in CSoundQT-d-CS6:
/"using callback interface
error: syntax error, unexpected T_OPCODEB  (token "randi") line 26:
>>>        a4   randi <<<
Unexpected untyped word a4 when expecting a variable
Parsing failed due to invalid input!
WARNING: Stopping on parser failure/"

I didn't find any solution in the forum.

Here is the .csd file coming from the famous Amsterdam Catalog:
<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
; ************************************************************************
; ACCCI:     01_11_1.ORC
; synthesis: simple(01),
;            LFO modulating amplitude of basic instrument + % random
;            amplitude variation (11)
; coded:     jpg 10/93

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

instr  1; ****************************************************************
idur  = p3
iamp  = p4
ifq1  = p5
if1   = p6
if2   = p7
ifq3  = p8
iperc = p9  ; random amplitude in percent of iamp
ifqr  = p10 ; frequency of bingo

        a4   randi   (iamp/100)*iperc, ifqr ; % random amplitude variation

        a3   oscili  a4+iamp, ifq3, 1      ; LFO modulating amplitude

        a2   oscili  a3, 1/idur, if2       ; envelope

        a1   oscili  a2, ifq1, if1         ; waveform
             out     a1
endin

</CsInstruments>
<CsScore>
; **********************************************************************
; ACCCI:     01_11_1.SCO
; coded:     jpg 10/93

; **********************************************************************
; GEN functions
; waveform
f1 0 2048 10 1 .4 .2 .1 .1 .05                   ; six harmonics

; envelope
f31 0 512 7 0 1 0 49 .8 100 .9 50 .7 150 .2 162 0


; **********************************************************************
; score                                   LFO     RAND
; instr 1  idur     iamp ifq1  if1  if2   ifq3    iperc  ifqr
i1  1      1.5      8000 1109   1    31     4        1     40
i1  3       .       .    .      .     .     .       50     .
i1  6       .       .    .      .     .     .       80     .
i1  9       .       .    .      .     .     .        1    110
i1 12       .       .    .      .     .     .       50     .
i1 15       .       .    .      .     .     .       80     .
e

</CsScore>
</CsoundSynthesizer>

Thank you for any help.

Jean-Michel Darrémont




--
View this message in context: http://csound.1045644.n5.nabble.com/randi-error-in-the-Amsterdam-catalog-tp5732606.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"