Kara-Moon Forum

Developers & Technology => Musical MIDI Accompaniment (MMA) => Topic started by: sciurius on August 06, 2019, 12:34:14 PM



Title: Plugin paths, revisited
Post by: sciurius on August 06, 2019, 12:34:14 PM
The algorithm to locate plugins has much improved in the 19.* versions of MMA. Still I have a situation I cannot handle satisfactory.

I have some plugins that I want to be available to all my songs.
  • I cannot put them in . or ./plugins, since the current directory will vary depending on the song.
  • I cannot put them in the same directory as the current file being processed, since that will vary as well.
  • I cannot (or rather: I do not want to) put them in the MMA library, since that is system wide and may affect other users.

So I think I need yet another, user settible location, dubbed userPlugPath

    SetUserPlugPath ~/lib/mma

and have MMA look in this folder, and its plugins subfolder.

No default value for userPlugPath so it won't affect existing code and workflow.

What do you think?


Title: Re: Plugin paths, revisited
Post by: bvdp on August 06, 2019, 04:33:43 PM

Ummm, you say:

  >> I cannot put them in the same directory as the current file being processed, since that will vary as well.

But then say that that can move. Sorry, don't get that. Can't you move the plug along with the file. I _think_ the plugin search in this case is relative to the current dir. Are you trying to do something like: mma ~/foo/bar/mysong.mma? In which case none of this (other than . and plugpath) will work. If I understand, then my suggestion would be to make plugPath a list and let users append to it???


Title: Re: Plugin paths, revisited
Post by: sciurius on August 06, 2019, 05:23:54 PM
The point is that there is no 'current file' that the plugin belongs to. It belongs to all files.

Consider for example my copyright plugin. I want to apply this to all songs I process, e.g.

    ~/wrk/mma/minorblues.mma
    ~/Music/September/Music/10_Slaap_Zacht/Slaap_Zacht.mma
    ~/Music/September/Music/72_A_Falling_Star/A_Falling_Star.mma
    ~/Music/September/Music/69_The_Matrix/matrix.mma
    ~/Music/Me/Music/49_Hello_Hans/Hello_Hans.mma
    ~/Music/Me/Music/58_Lullaby/lullaby.mma
    ~/Sites/Mandala/mandala.mma


Where must I put the plugin so all these files can use it?


Title: Re: Plugin paths, revisited
Post by: bvdp on August 06, 2019, 06:29:12 PM
Okay :)

So, plugPath is already a list set at start up in paths.py.

Rather than yet another path variable ... would a routine to append your path to plugPath be easier? We'd just need to add setPlugPath() along with the other set* routines and then have the regplug step though that? Then in your song file you just have to a setting like: setPlugPath $PlugPath + mysillypath. Would need a PlugPath macro, which I think is missing.


Title: Re: Plugin paths, revisited
Post by: sciurius on August 06, 2019, 06:59:10 PM
Yes, that would be great!