Csound Csound-dev Csound-tekno Search About

[Csnd] Include UDOs within UDOs: what's the etickette

Date2020-08-06 18:25
From"Jeanette C."
Subject[Csnd] Include UDOs within UDOs: what's the etickette
Hey hey,
in my current project I have a lot of recurring code, which in a software 
llibrary I would normally encapsulate into a separate function.

I can encapsulate that code into a UDO (maybe only for internal use).

My question is: what's the feeling/verdict/advice on this method regarding UDO 
collections/libraries for release?

So far I have shied away from it, because it will require that the internal 
opcodes are included in the Csound file, not sure if they necessarily have to 
be included before the "higher level" UDOs in the source code. It somehow - 
irrationally - felt awkward.

Could you give me some thoughts on this, please?

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Top down, on the strip
Lookin' in the mirror
I'm checkin' out my lipstick <3
(Britney Spears)

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

Date2020-08-07 10:27
Fromthorin kerr
SubjectRe: [Csnd] Include UDOs within UDOs: what's the etickette
Hi Jeanette,

I'm not entirely sure I catch your meaning. I notice you tend to put individual UDO's in their own file. Are you concerned with including UDO's from separate files into other UDO's?

My library uses lots of interdependent embedded UDO's. In fact, the more UDO's, the more higher-level ideas you come up with to use them.

Except of course it can get very messy. Something I don't do - which you do really well - is use a pseudo-namespaces (e.g. 'm_scene_ ... ') to ensure there aren't name clashes. It's a good policy, although it does get a little combersom if your library contains lots of other top level things like globals and tables.

In short... I'm not sure I've contributed anything useful to this conversation except to say a convention for this kind of thing would be useful.

Thorin




On Fri, 7 Aug. 2020, 3:24 am Jeanette C., <julien@mail.upb.de> wrote:
Hey hey,
in my current project I have a lot of recurring code, which in a software
llibrary I would normally encapsulate into a separate function.

I can encapsulate that code into a UDO (maybe only for internal use).

My question is: what's the feeling/verdict/advice on this method regarding UDO
collections/libraries for release?

So far I have shied away from it, because it will require that the internal
opcodes are included in the Csound file, not sure if they necessarily have to
be included before the "higher level" UDOs in the source code. It somehow -
irrationally - felt awkward.

Could you give me some thoughts on this, please?

Best wishes,

Jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Top down, on the strip
Lookin' in the mirror
I'm checkin' out my lipstick <3
(Britney Spears)

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

Date2020-08-07 17:13
From"Jeanette C."
SubjectRe: [Csnd] Include UDOs within UDOs: what's the etickette
Hi Thorin!
Aug 7 2020, thorin kerr has written:
...
> My library uses lots of interdependent embedded UDO's. In fact, the more
> UDO's, the more higher-level ideas you come up with to use them.
Thanks, that was exactly my concern. Making UDOs interdependent. I have
already encapsulated my code and will now edit the other UDOs
accordingly. This will make a lot of things easier.
...
> Except of course it can get very messy. Something I don't do - which you do
> really well - is use a pseudo-namespaces (e.g. 'm_scene_ ... ')
Thanks. Naming UDOs is one thing, but it was Steven who unlocked the
real power for me wiith hirarchical channel names. They allow for a
fantastic amount of power and clarity.
...
> In short... I'm not sure I've contributed anything useful to this
> conversation except to say a convention for this kind of thing would be
> useful.
Your response definitely boosted my confidence. I haven't found anything
in a way of "guideline" or convention, but now we have something we
might call "common practise".

I think for a library or system interdependent UDOs can be made a little
safer by supplied one include file for an orchestra including all UDOs
and possibly a few macros or global constants for symbolic names to
allow even more intuitive work.

Best wishes and thanks,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

you made me realize..not to compromise
the fact that you and i should meet... <3
(Britney Spears)

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

Date2020-08-08 00:00
FromKevin Welsh
SubjectRe: [Csnd] Include UDOs within UDOs: what's the etickette
Hello Jeanette!  I also don't have a lot that's useful to contribute here, but I'll take a shot:
> I think for a library or system interdependent UDOs can be made a little
> safer by supplied one include file for an orchestra including all 

This is exactly what I do! I usually have something like "standards.inc.csd" that includes all of the other common includes needed for the project.

I'll also suggest using ifndef and define as a way to ensure included files don't get duplicated.  This way a lower level include file can still include the higher level"dependency" locally, so anyone looking at it will have a hint that this file requires another... even if the "standards" file already included it.

I do something like this for each of my include files:

#ifndef UNIQUE_FILE_FLAG
  #define UNIQUE_FILE_FLAG ##
  ... code goes here ...
#endif

So now if it's already been included, the unique macro is set, so the code won't ever appear again.

On Fri, Aug 7, 2020 at 12:13 PM Jeanette C. <julien@mail.upb.de> wrote:
Hi Thorin!
Aug 7 2020, thorin kerr has written:
...
> My library uses lots of interdependent embedded UDO's. In fact, the more
> UDO's, the more higher-level ideas you come up with to use them.
Thanks, that was exactly my concern. Making UDOs interdependent. I have
already encapsulated my code and will now edit the other UDOs
accordingly. This will make a lot of things easier.
...
> Except of course it can get very messy. Something I don't do - which you do
> really well - is use a pseudo-namespaces (e.g. 'm_scene_ ... ')
Thanks. Naming UDOs is one thing, but it was Steven who unlocked the
real power for me wiith hirarchical channel names. They allow for a
fantastic amount of power and clarity.
...
> In short... I'm not sure I've contributed anything useful to this
> conversation except to say a convention for this kind of thing would be
> useful.
Your response definitely boosted my confidence. I haven't found anything
in a way of "guideline" or convention, but now we have something we
might call "common practise".

I think for a library or system interdependent UDOs can be made a little
safer by supplied one include file for an orchestra including all UDOs
and possibly a few macros or global constants for symbolic names to
allow even more intuitive work.

Best wishes and thanks,

Jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

you made me realize..not to compromise
the fact that you and i should meet... <3
(Britney Spears)

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