Kara-Moon Forum

Developers & Technology => Musical MIDI Accompaniment (MMA) => Topic started by: bvdp on March 07, 2012, 09:26:20 PM



Title: Changes to the library paths
Post by: bvdp on March 07, 2012, 09:26:20 PM
I think I'm not busy enough :)

I've just finished reworking the entire library path stuff for mma.

 - The autolib / setautolib stuff is gone.

 - the libpath settings can now include multiple directories (handy if you want the system defaults and your own personal depository)

 - the -g/-G options process though the same libraries as the USE libs. Makes it much more easy and clear for the user.

 - one (unfortunate?) issue is that the MMAIGNORE setting effects a directory, not the sub dirs in that dir. This probably makes sense, but is a change. Not that many are using either MMAIGNORE or have deeply nested dirs.

To sum this up, the start up finds a default libpath (ie /usr/local/mma/lib) and expands the dirs there into a list of locations to search ( /usr/local/mma/lib/stdlib, /usr/local/mma/lib/other, etc). If the user wants more, he can do something like:

   SetLibPath  mymmalib $_LibPath

This inserts the users lib into the mix and the tree is re-read (well, more complicated than that, but that is the result).

I think it's pretty easy and elegant.

Oh, and the -g/-G stuff seems to work find as well under this scheme.

Comments, suggestions, etc. welcome.


Title: Re: Changes to the library paths
Post by: alexis on March 07, 2012, 10:21:18 PM
  SetLibPath  mymmalib $_LibPath

Does this work in .mmarc file as well? Does a macro such as $_LibPath make sense in this kind of file? I'm afraid it will work only in .mma files.

My main concern was:
  • Being able to use standard grooves (in distribution dir) AND personal grooves (dir in home, My documents, ...) in the same data file.
  • Removing dependency to personal grooves dir(s) in data files. This should be user-specific and thus typically be defined in .mmarc file.

Best,

Alexis


Title: Re: Changes to the library paths
Post by: bvdp on March 07, 2012, 11:00:19 PM
  SetLibPath  mymmalib $_LibPath

Does this work in .mmarc file as well? Does a macro such as $_LibPath make sense in this kind of file? I'm afraid it will work only in .mma files.

Yes, this should be no problem. The .mmarc file(s) are processed before any libpath expansion. Actually, what happens is:

  - as part of the init the base libpath is set
  - mmarc files are read/processed.
  - the .mma file is read.

It's not until an actual call to an automatic groove or a USE that we bother to expand the libpath(s) into their sub-dirs.

Quote
My main concern was:
  • Being able to use standard grooves (in distribution dir) AND personal grooves (dir in home, My documents, ...) in the same data file.
  • Removing dependency to personal grooves dir(s) in data files. This should be user-specific and thus typically be defined in .mmarc file.

Best,

Alexis

Yes, that is the whole idea. It seems to be pretty much working here. But, I want to test more before I try it out on you guys :)


Title: Re: Changes to the library paths
Post by: alexis on March 08, 2012, 12:26:15 PM
Quote
Quote
Does this work in .mmarc file as well? Does a macro such as $_LibPath make sense in this kind of file? I'm afraid it will work only in .mma files.

Yes, this should be no problem. The .mmarc file(s) are processed before any libpath expansion. Actually, what happens is:
Good!  :)

Quote
Yes, that is the whole idea. It seems to be pretty much working here. But, I want to test more before I try it out on you guys :)
OK. I'll also test it under Windows when it's ready.


Title: Re: Changes to the library paths
Post by: bvdp on March 08, 2012, 04:23:59 PM
I think it's working. The new scheme seems to be much faster in finding grooves and in doing database updates. I'm a bit worried about that :)

I'm going to add multiple paths to the include directory as well.