Jump to content
Sign in to follow this  
torstenanders

Extending a library?

Recommended Posts

Is there a way a way to extend an existing library? For example, for a specific composition I may want to collect a library of rhythms, melodic fragments etc., to arrange and transform these later with existing library features. Is it possible to by and by extend a library so that instead of, say, defining

(setf rhythm1 (length-divide 1 3 '(q)))

 

I instead may write something like

(setf (library 'new-piece 'rhythms 'rhythm1) (length-divide 1 3 '(q)))

 

Asked differently: what is the internal data structure of the existing library feature(s)? Is it possible to get access to that data for user-defined functions etc.?

 

Also, is it possible to export an existing library into a file?

 

BTW: Why are all these quotes necessary in calls to functions like library and many others -- why is the function library not a macro instead (only at the top-most level of course as syntactic sugar, I am certainly not suggesting to have macros instead of functions in principle).

 

Thank you very much!

 

Best,

Torsten

 

 

Share this post


Link to post
Share on other sites

In order to use libraries you must define first with DEF-LIBRARY
It is possible to assemble a library and its identifiers using the function CREATE-LIBRARY

Share this post


Link to post
Share on other sites

>> Is there a way a way to extend an existing library?

>> Also, is it possible to export an existing library into a file?

 

> I agree this would be useful indeed.

 
Sorry for following this up. Any plans to extend the existing library functionality to make libraries extendable and exportable?
 
If not I am happy to roll my own (that should be easy enough :) 
 
Best,
Torsten

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×