Quantcast

[Csnd] Include guards for UDOs

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] Include guards for UDOs

eddyc
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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Include guards for UDOs

jpff
What error?


Sent from TypeApp
On 4 May 2017, at 19:19, Ed Costello <[hidden email]> 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
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Include guards for UDOs

eddyc
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 <[hidden email]> wrote:

What error?


Sent from TypeApp
On 4 May 2017, at 19:19, Ed Costello <[hidden email]> 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
[hidden email]
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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Include guards for UDOs

eddyc
Never mind, it was a typo on my part.
Thanks
Ed

On 4 May 2017, at 23:16, Ed Costello <[hidden email]> 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 <[hidden email]> wrote:

What error?


Sent from TypeApp
On 4 May 2017, at 19:19, Ed Costello <[hidden email]> 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
[hidden email]
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 [hidden email] 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 [hidden email] 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
Loading...