Jump to content

How to create (permanently) a library


o_e

Recommended Posts

Hi,

Please have merci with me, but I'am not able to build a library (permanent).

I've tried to follow the docs, so I first use def-library:

(def-library test
             (:section testing
                          bla1 '(a b c)
                          bla2 '(e f g)
                          ))

This seems to work, testing with:

(library 'test 'testing 'bla2)
==>(e f g)

Next step in my understanding would be:

(create-library 'test 'testing 'bla  
                :file "test" 
               )

that gives an error:

==>Error: Incorrect keyword arguments in ("test")

What am I missing,  surely something very silly that I overlooked, greatful for some help..

Thanks!

 

ole

Link to comment
Share on other sites

(create-library 'Binary-Rhythmics '4-bit-binary 'bin
                (combination2 4 '(1 0 1 0)))

;; The print out in the LISTENER is as follows:

=> (def-library binary-rhythmics
(:section 4-bit-binary
bin0 '(0 0 0 0)
bin1 '(1 0 0 0)
bin2 '(0 1 0 0)
bin3 '(1 1 0 0)
bin4 '(0 0 1 0)
bin5 '(1 0 1 0)
bin6 '(0 1 1 0)
bin7 '(1 1 1 0)
bin8 '(0 0 0 1)
bin9 '(1 0 0 1)
bin10 '(0 1 0 1)
bin11 '(1 1 0 1)
bin12 '(0 0 1 1)
bin13 '(1 0 1 1)
bin14 '(0 1 1 1)
bin15 '(1 1 1 1)
))

 

With keyword :file "4-bit-library" the file will be saved in the ~/Opusmodus/Def-Libraries/Def-Library directory.

 

(create-library 'Binary-Rhythmics '4-bit-binary 'bin
                (combination2 4 '(1 0 1 0))
                :file "4-bit-library")

 

 

 

10 hours ago, o_e said:

Next step in my understanding would be:



(create-library 'test 'testing 'bla  
                :file "test" 
               )

this expression dose not have any values.

Link to comment
Share on other sites

Ok, to complete my own example (hope that may help others):

First you have to define a library (like I did already successful):

(def-library test
             (:section testing
                          bla0 '(a b c)
                          bla1 '(e f g)
))

to save it (permanent) as a file into ~/Opusmodus/Def-Libraries/Def-Library you have to do the following:

(create-library 'test 'testing 'bla
             (library 'test 'testing nil :collect :all)
                :file "test" 
)

 

correct or do I miss something?

Thanks for your patience!

 

 

Link to comment
Share on other sites

You can't create-library with defined library. 🙂

 

This is already a library:

(def-library test
             (:section testing
                       bla0 '(a b c)
                       bla1 '(e f g)
                       ))

 

Open a new file and paste your new define library there. The file must start with:

(in-package :Opusmodus)

 

 

The create-library function is a simply automatisation to generate def-library with gen functions (values).

Link to comment
Share on other sites

Ok, so I just save my

(def-library test
             (:section testing
                       bla0 '(a b c)
                       bla1 '(e f g)
                       ))

into the Def-Library folder, adding

(in-package :Opusmodus)

on top

 

The method I choose  looks like this:

(in-package :Opusmodus)

;; Library | Opusmodus Version 2.1.26191 | 2021-01-25 09:24:09

(def-library test
    (:section testing
     bla0 '(a b c)
     bla1 '(e f g)))

#|
Examples:
(library 'test 'testing 'bla0)
(library 'test 'testing nil :random 5)
(library 'test 'testing nil :collect '(0 3 5))
|#

Can  it also be done this way (I find the automatically generated additional lines helpful)..?

Or is it embarrasing 🙂

Link to comment
Share on other sites

you could do:

(create-library 'test 'testing 'bla
                '((a b c) (e f g))
                :file "test1" 
                )

 

which will create a file 'test1.opmo' in the ~/Opusmodus/Def-Libraries/Def-Library:

(in-package :Opusmodus)

;; Library | Opusmodus Version 2.1.26194M | 2021-01-25 10:30:52

(def-library test
    (:section testing
     bla0 '(a b c)
     bla1 '(e f g)))

#|
Examples:
(library 'test 'testing 'bla0)
(library 'test 'testing nil :random 5)
(library 'test 'testing nil :collect '(0 3 5))
|#

 

🙂
 

 

Link to comment
Share on other sites

Ok, one more question.. 🙂

Lets say I have a library with different sections like this:

(def-library test3
             (:section one
                       x0 '(a b c)
                       x1 '(d e f)
                       )
             (:section two
                       a0 '(x y z)
                       a1 '(u v w)
                       )
)

and now I want to (randomly) call in all sections:

(library 'test3 '(one two)  nil :collect :all)
(library 'test3 '(one two)  nil :random 5)

is that possible?

 

thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy