[Csnd] including a directory with single-file UDOs

Hello everybody!

I was wondering if there is an possibility to include a directory with all my UDOs as single files to my csound-instrument.

Till now i use a big file which contains all my UDOs and do the ‚#include „/my/file.txt“' method. But i don't like it, because i find it uncomfortable to look up my UDOs in this file.
Is there a other approach to do this?

Greetings,
Philipp
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

hi phlipp -

i see two possibilities:

1. you can have multiple #include statements.
2. it should work to use the option
    --env:INCDIR+=/path/to/my/udos
(Csound command line)

i'd be curious if number 2 works. i think it should be the best option for your case.

ciao -
  joachim

sorry --- my second option will not work this way. it is only a possibility to simplify path names.

perhaps best is to #include one file which in itself has multiple #include statements.

so in your csd you have:

  #include "my_udo_collection.txt"

and in "my_udo_collection.txt" you have:
#include "filters.udo"
#include "synths.udo"
...

curious what you will figure out, or others know -

  j

Hi Philipp, do you mean something like this that will print all the udo filenames to your console from within an instr?

https://csound.com/docs/manual/directory.html

You just need to set the directory for ex. “/Music/Csound/Udos” & perhaps something like “.udo” instead of ".txt depending on what extension you use for the udos.

Best,
Scott

Thanks, Joachim! This is a great idea which i will try out.

Scott, to be able to use my UDOs i have to load a file which contains all my UDOs. This has nothing to do with printing the file names or something like this. The #include statement works in the background just to be able to work with the UDOs like with normal opcodes.

Sorry, as you had written “because i find it uncomfortable to look up my UDOs in this file” I thought perhaps you wanted a simpler way to look up which udos were in a directory.

As joachim wrote, something like#include “udos.txt” works fine, but from my experience the #include statements inside that file must be seperated by a blank line of text, for ex:
#include “reverb.udo”

#include “shimmerverb.udo”

For me it will not work if there isn’t a blank line between them, an error is reported:
error: syntax error, unexpected ‘#’, expecting NEWLINE etc…

Perhaps that’s just the particular version of Csound I’m using.

Put all your UDOs in one file. The size of this file is unlikely to be a problem.