Csound Csound-dev Csound-tekno Search About

Include guards for UDOs

Date2017-05-04 19:19
FromEd Costello
SubjectInclude guards for UDOs
Hey,

How does one do C style include guards for udos? I’ve tried:

#ifndef TEST
#define TEST #
opcode test, k, k

    k1 xin
    k1 = 200

    printk2 k1

    xout k1
endop
#
#endif

But I get an error when trying to use it like this:




#include "test.udo"

instr main

    k1 test 34

endin

schedule("main", 0, -1)




Thanks
Ed

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-05-04 22:15
FromJohn ff
SubjectRe: Include guards for UDOs
What error?


Sent from TypeApp
On 4 May 2017, at 19:19, Ed Costello <phasereset@GMAIL.COM> wrote:
Hey,

How does one do C style include guards for udos? I’ve tried:

#ifndef TEST
#define TEST #
opcode test, k, k

k1 xin
k1 = 200

printk2 k1

xout k1
endop
#
#endif

But I get an error when trying to use it like this:

<CsoundSynthesizer>
<CsInstruments>

#include "test.udo"

instr main

k1 test 34

endin

schedule("main", 0, -1)

</CsInstruments>
</CsoundSynthesizer>

Thanks
Ed

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2017-05-04 23:16
FromEd Costello
SubjectRe: Include guards for UDOs
I get:


error: syntax error, unexpected T_IDENT  (token "test") from file main.csd (1)
 line 20:
>>>    k1 test <<<
Unexpected untyped word kk when expecting a variable

Same happens when I just copy the udo into the file like this:

<CsoundSynthesizer>
<CsInstruments>

#ifndef TEST
#define TEST #
opcode test, k, k

   k1 xin
   k1 = 200

   printk2 k1

   xout k1
endop
#
#endif

instr main

    k1 test 34

endin

schedule("main", 0, -1)

</CsInstruments>
</CsoundSynthesizer>

Thanks 
Ed


On 4 May 2017, at 22:15, John ff <jpff@CODEMIST.CO.UK> wrote:

What error?


Sent from TypeApp
On 4 May 2017, at 19:19, Ed Costello <phasereset@GMAIL.COM> wrote:
Hey,

How does one do C style include guards for udos? I’ve tried:

#ifndef TEST
#define TEST #
opcode test, k, k

k1 xin
k1 = 200

printk2 k1

xout k1
endop
#
#endif

But I get an error when trying to use it like this:

<CsoundSynthesizer>
<CsInstruments>

#include "test.udo"

instr main

k1 test 34

endin

schedule("main", 0, -1)

</CsInstruments>
</CsoundSynthesizer>

Thanks
Ed

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2017-05-04 23:40
FromEd Costello
SubjectRe: Include guards for UDOs
Never mind, it was a typo on my part.
Thanks
Ed

On 4 May 2017, at 23:16, Ed Costello <phasereset@gmail.com> wrote:

I get:


error: syntax error, unexpected T_IDENT  (token "test") from file main.csd (1)
 line 20:
>>>    k1 test <<<
Unexpected untyped word kk when expecting a variable

Same happens when I just copy the udo into the file like this:

<CsoundSynthesizer>
<CsInstruments>

#ifndef TEST
#define TEST #
opcode test, k, k

   k1 xin
   k1 = 200

   printk2 k1

   xout k1
endop
#
#endif

instr main

    k1 test 34

endin

schedule("main", 0, -1)

</CsInstruments>
</CsoundSynthesizer>

Thanks 
Ed


On 4 May 2017, at 22:15, John ff <jpff@CODEMIST.CO.UK> wrote:

What error?


Sent from TypeApp
On 4 May 2017, at 19:19, Ed Costello <phasereset@GMAIL.COM> wrote:
Hey,

How does one do C style include guards for udos? I’ve tried:

#ifndef TEST
#define TEST #
opcode test, k, k

k1 xin
k1 = 200

printk2 k1

xout k1
endop
#
#endif

But I get an error when trying to use it like this:

<CsoundSynthesizer>
<CsInstruments>

#include "test.udo"

instr main

k1 test 34

endin

schedule("main", 0, -1)

</CsInstruments>
</CsoundSynthesizer>

Thanks
Ed

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here