Csound Csound-dev Csound-tekno Search About

[Csnd] Macro confusion

Date2010-10-10 22:33
FromChristopher Saunders
Subject[Csnd] Macro confusion
Hi, I'm having some confusion over why my macro definitions aren't working. The following .csd returns an error message saying

error: Undefined macro: 'OUT'


What part of my usage is wrong?




<CsoundSynthesizer>

<CsOptions>

</CsOptions>

<CsInstruments>

sr=44100

kr=4410

ksmps=10

nchnls=2

0dbfs=32767

instr 1

aout oscil 30000, 440 , 1

#define OUT #out aout#

$OUT. ;

endin


</CsInstruments>

<CsScore>

f 1 0 8192 10 1

i 1 0 3

e

</CsScore>

</CsoundSynthesizer>



Date2010-10-10 23:05
Fromjoachim heintz
Subject[Csnd] Re: Macro confusion
hi christopher -

i think the main problem is the indentation. when you start your macro  
definition at the beginning of the line, it should work. (it's a bit  
strange actually that csound doesn't accept indentation here, but it  
seems to be the case.)
in general, i think macros should be defined in the orchestra header.

the second problem is the use of the "out" opcode though you have  
declared nchnls=2.

this version should work (for better sound quality, i replaced oscil  
by poscil):





sr=44100
kr=4410
ksmps=10
nchnls=1
0dbfs=32767
#define OUT #out aout#
instr 1
aout poscil 30000, 440 , 1
$OUT. ;
endin


f 1 0 8192 10 1
i 1 0 3
e



	joachim


Am 10.10.2010 um 23:33 schrieb Christopher Saunders:

> Hi, I'm having some confusion over why my macro definitions aren't  
> working. The following .csd returns an error message saying
>
> error: Undefined macro: 'OUT'
>
> What part of my usage is wrong?
>
>
>
> 
> 
> 
> 
> sr=44100
> kr=4410
> ksmps=10
> nchnls=2
> 0dbfs=32767
> instr 1
> aout oscil 30000, 440 , 1
> #define OUT #out aout#
> $OUT. ;
> endin
>
> 
> 
> f 1 0 8192 10 1
> i 1 0 3
> e
> 
> 
>
>



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-10 23:18
FromDave Seidel
Subject[Csnd] Re: Macro confusion
Hi Christopher,

It seems that the "#define" part needs to start all the way over in the
left margin, i.e., it can't be indented at all.  I just confirmed that
in the CSD I'm working on right now.

This is pretty silly, in my opinion, but there it is.  :-)

- Dave

On 10/10/2010 5:33 PM, Christopher Saunders wrote:
> Hi, I'm having some confusion over why my macro definitions aren't
> working. The following .csd returns an error message saying
> 
> error: Undefined macro: 'OUT'
> 
> 
> What part of my usage is wrong?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> sr=44100
> 
> kr=4410
> 
> ksmps=10
> 
> nchnls=2
> 
> 0dbfs=32767
> 
> instr 1
> 
> aout oscil 30000, 440 , 1
> 
> #define OUT #out aout#
> 
> $OUT. ;
> 
> endin
> 
> 
> 
> 
> 
> 
> f 1 0 8192 10 1
> 
> i 1 0 3
> 
> e
> 
> 
> 
> 
> 
> 



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"