Csound Csound-dev Csound-tekno Search About

[Csnd] #include issues

Date2010-10-18 00:03
FromChristopher Saunders
Subject[Csnd] #include issues
I was having some trouble with the #include opcode, it works fine when the file I'm including doesn't contain any macro definitions.  It suggests in the manual to define your most commonly used macros in a seperate text file and use  #include to get them into the score, however when I do such a thing, it says

score error: Undefined macro: 'Ho'. What could I be doing wrong?




<CsOptions>

</CsOptions>

<CsInstruments>

sr=44100

kr=4410

ksmps=10

nchnls=1

0dbfs=32767

instr 1

kcps = cpspch (p5)

icps = cpspch (p5)

kamp madsr .0002, .005 , p4 , .05

ares buzz kamp, kcps, 40,1

aout butterlp ares ,p5+7000

out aout

endin

#include "Csound/H.inc"

;#define Ho #2#;

</CsInstruments>

<CsScore>

i 1 0 $Ho.

i 1 + .

i 1 + .

i 1 + .

i 1 + .

i 1 + .


Date2010-10-18 00:21
Fromandy fillebrown
Subject[Csnd] Re: #include issues
Try moving the #include into the  section.

Cheers,
~ andy.f



On Sun, Oct 17, 2010 at 7:03 PM, Christopher Saunders
 wrote:
> I was having some trouble with the #include opcode, it works fine when the
> file I'm including doesn't contain any macro definitions.  It suggests in
> the manual to define your most commonly used macros in a seperate text file
> and use  #include to get them into the score, however when I do such a
> thing, it says
>
> score error: Undefined macro: 'Ho'. What could I be doing wrong?
>
>
> 
>
> 
>
> 
>
> sr=44100
>
> kr=4410
>
> ksmps=10
>
> nchnls=1
>
> 0dbfs=32767
>
> instr 1
>
> kcps = cpspch (p5)
>
> icps = cpspch (p5)
>
> kamp madsr .0002, .005 , p4 , .05
>
> ares buzz kamp, kcps, 40,1
>
> aout butterlp ares ,p5+7000
>
> out aout
>
> endin
>
> #include "Csound/H.inc"
>
> ;#define Ho #2#;
>
> 
>
> 
>
> i 1 0 $Ho.
>
> i 1 + .
>
> i 1 + .
>
> i 1 + .
>
> i 1 + .
>
> i 1 + .


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-10-18 07:28
FromRichard Boulanger
Subject[Csnd] Re: #include issues
you might need to check with the list - if you are following the models I gave you  because here may be a bug.
Also - there is a Chapter in The Csound Book on Macros - Ch5 I think.

-dB

On Oct 17, 2010, at 7:03 PM, Christopher Saunders wrote:

I was having some trouble with the #include opcode, it works fine when the file I'm including doesn't contain any macro definitions.  It suggests in the manual to define your most commonly used macros in a seperate text file and use  #include to get them into the score, however when I do such a thing, it says
score error: Undefined macro: 'Ho'. What could I be doing wrong?



<CsOptions>
</CsOptions>
<CsInstruments>
sr=44100
kr=4410
ksmps=10
nchnls=1
0dbfs=32767

instr 1
kcps = cpspch (p5)
icps = cpspch (p5)

kamp madsr .0002, .005 , p4 , .05

ares buzz kamp, kcps, 40,1

aout butterlp ares ,p5+7000
out aout

endin
#include "Csound/H.inc"
;#define Ho #2#;

</CsInstruments>
<CsScore>
i 1 0 $Ho.
i 1 + .
i 1 + .
i 1 + .
i 1 + .
i 1 + .