Jump to content

Updated library of many custom Opusmodus functions


Recommended Posts

Dear all,


I updated my library tot (https://github.com/tanders/tot) in various ways. In particular, there are many new functions available.


You can now read the documentation online at https://tanders.github.io/tot/. However, remember that you can directly evaluate the many examples in the documentation when (after installing the library) you drag the library folder into your Opusmodus project navigator and open the documentation within Opusmodus.

 

If you are interested in the details of how the library developed, you can see a changelog at https://github.com/tanders/tot/commits/master .


NOTE: When you install/upgrade this library, make sure you also install/upgrade all its dependencies, as described in the detailed installation instructions at https://github.com/tanders/tot

 

Best,
Torsten
 

PS: This is not an official release. As I am primarily developing this library for my own purposes, I keep it rather informal and extend it on a continuous basis for my own composition projects. Anyway, I thought at least some of you might be interested to learn that there have been many developments 🙂

Link to comment
Share on other sites

Thanks, Torsten !

Very nice. I want to try it.

I did the Git terminal stuff

 

I don't  know how to to this part...

ASFD is something I have to install ?

 

???

Best,

Julio

 

USAGE part (???)

 

This library is an ASDF system (ASDF is the de facto standard for building Common Lisp software), and you can load it into your Lisp compiler as follows. All dependency libraries are loaded automatically as well.

(require :tot)

For most convenient use within Opusmodus, you can drag and drop the whole folder of this library in the browser of an Opusmodus project. Then, visit the HTML documentation of this library from within Opusmodus: open the tot, and then its doc folder and click on an HTML file, say index.html. You can now browse the reference documentation of the library, which explains its individual definitions. Most importantly, you can directly run all example code in the documentation from within Opusmodus (thanks, Janusz Podrazik).

added 1 minute later

Second question :

When I update to next Opusmodus release, do I have to reinstall it ?

Best,

Julio

Link to comment
Share on other sites

Dear Julio,

 

As the link you copied said, "ASDF is the de facto standard build facility for Common Lisp." In other words, it is the standard software for organising, compiling, loading etc. Common Lisp programs that consist of more than just one file. I think it is already built into CCL, the compiler used by Opusmodus. Have you tried after the installation to simply run the given Common Lisp command to load the library?

(require :tot)

>  When I update to next Opusmodus release, do I have to reinstall it ?

 

Not if you follow the installation instructions and install it in ~/common-lisp/

 

Best,

Torsten

 

Link to comment
Share on other sites

Dear Torsten,

Thank you. Now I understand that this command is done inside Opusmodus.

Unfortunately, I got some errors...

 

;Compiling "/Users/acme/common-lisp/string-tools/make-package.lisp"...
;Compiling "/Users/acme/common-lisp/string-tools/string-tools.lisp"...
;Compiling "/Users/acme/common-lisp/string-tools/export.lisp"...
;Compiling "/Users/acme/common-lisp/ta-utilities/make-package.lisp"...
;Compiling "/Users/acme/common-lisp/ta-utilities/my-utilities.lisp"...
;Compiling "/Users/acme/common-lisp/ta-utilities/export.lisp"...
;Compiling "/Users/acme/common-lisp/fenv/sources/make-package.lisp"...
;Compiling "/Users/acme/common-lisp/fenv/sources/macros.lisp"...
;Compiling "/Users/acme/common-lisp/fenv/sources/fenv.lisp"...
;Compiling "/Users/acme/common-lisp/fenv/sources/export.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/package.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/from-studio-flat.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/01.domain.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/02.engine.lisp"...
;Compiler warnings for "home:common-lisp;cluster-engine;sources;02.engine.lisp.newest" :
;   In poly-engine: type declaration for unknown variable master-index
;   In poly-engine: Undeclared free variable *debug-count-backtrack*
;   In an anonymous lambda form at position 22432: Duplicate definitions of assign-pitches-for-motif, in this file
;   In an anonymous lambda form at position 23073: Duplicate definitions of assign-pitches-for-nth-motif, in this file
;   In fail: Undeclared free variable *debug-count-backtrack* (2 references)
;   In an anonymous lambda form at position 36784: Duplicate definitions of backjump-engine, in this file
; Warning: Lisp compilation failed while compiling #<cl-source-file "cluster-engine" "sources/02.engine">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
; Warning: Lisp compilation had style-warnings while compiling #<cl-source-file "cluster-engine" "sources/02.engine">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/03.Fwd-rules.lisp"...
;   In fwd-rule-indep: type declaration for unknown variable length-metric-engin
;   In fwd-rule2: type declaration for unknown variable length-metric-engin
;   In fwd-rule3: type declaration for unknown variable length-metric-engin
;   In fwd-rule4: type declaration for unknown variable length-metric-engin
;   In fwd-rule5: type declaration for unknown variable length-metric-engin
;   In fwd-rule6: type declaration for unknown variable length-metric-engin
;   In fwd-rule6b: type declaration for unknown variable length-metric-engin
; Warning: Lisp compilation failed while compiling #<cl-source-file "cluster-engine" "sources/03.Fwd-rules">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
; Warning: Lisp compilation had style-warnings while compiling #<cl-source-file "cluster-engine" "sources/03.Fwd-rules">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/04.Backtrack-rules.lisp"...
;   In backtrack-rule2: type declaration for unknown variable highest-index
; Warning: Lisp compilation failed while compiling #<cl-source-file "cluster-engine" "sources/04.Backtrack-rules">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
; Warning: Lisp compilation had style-warnings while compiling #<cl-source-file "cluster-engine" "sources/04.Backtrack-rules">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05.rules-interface.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05a.rules-interface-1engine.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05b.rules-interface-2engines.lisp"...
;Compiler warnings for "home:common-lisp;cluster-engine;sources;05b.rules-interface-2engines.lisp.newest" :
;   In get-start-nth-pointer-durations: type declaration for unknown variable rhythmseq
;   In get-end-nth-pointer-durations: type declaration for unknown variable rhythmseq
; Warning: Lisp compilation failed while compiling #<cl-source-file "cluster-engine" "sources/05b.rules-interface-2engines">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
; Warning: Lisp compilation had style-warnings while compiling #<cl-source-file "cluster-engine" "sources/05b.rules-interface-2engines">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05c.rules-interface-2engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05d.rules-interface-2engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05e.rules-interface-2engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05f.rules-interface-3engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05g.rules-interface-any-n-engines.lisp"...
;Compiler warnings for "home:common-lisp;cluster-engine;sources;05g.rules-interface-any-n-engines.lisp.newest" :
;   In get-pitches-for-slices-of-notecounts: type declaration for unknown variable notecount
;   In get-pitches-for-slices-of-notecounts: type declaration for unknown variable voicenr
;   In get-pitches-for-slices-of-notecounts: type declaration for unknown variable notecount-slice
;   In replace-notecount-by-timepoint: type declaration for unknown variable timepoint
;   In replace-notecount-by-timepoint: type declaration for unknown variable notecountgroups
;   In get-durations-for-slices-of-notecounts: type declaration for unknown variable notecount
;   In get-durations-for-slices-of-notecounts: type declaration for unknown variable voicenr
;   In get-durations-for-slices-of-notecounts: type declaration for unknown variable notecount-slice
;   In get-timepoints-for-slices-of-notecounts: type declaration for unknown variable notecount
;   In get-timepoints-for-slices-of-notecounts: type declaration for unknown variable voicenr
;   In get-timepoints-for-slices-of-notecounts: type declaration for unknown variable notecount-slice
; Warning: Lisp compilation failed while compiling #<cl-source-file "cluster-engine" "sources/05g.rules-interface-any-n-engines">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
; Warning: Lisp compilation had style-warnings while compiling #<cl-source-file "cluster-engine" "sources/05g.rules-interface-any-n-engines">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05h.rules-higher-level.lisp"...
;Compiler warnings for "home:common-lisp;cluster-engine;sources;05h.rules-higher-level.lisp.newest" :
;   In an anonymous lambda form at position 453: Duplicate definitions of melodic-statement-for-dur, in this file
; Warning: Lisp compilation failed while compiling #<cl-source-file "cluster-engine" "sources/05h.rules-higher-level">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
; Warning: Lisp compilation had style-warnings while compiling #<cl-source-file "cluster-engine" "sources/05h.rules-higher-level">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05i.rules-stop-search.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/05n.rules-interface-nn-engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/06.heuristic-rules-interface.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/06a.heuristic-rules-interface-1engine.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/06b.heuristic-rules-interface-2engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/06c.heuristic-rules-interface-2engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/06d.heuristic-rules-interface-2engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/06e.heuristic-rules-interface-2engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/06f.heuristic-rules-interface-3engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/06g.heuristic-rules-interface-any-n-engines.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/07.backjumping.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/08.decode.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/09.utilities.lisp"...
;Compiler warnings for "home:common-lisp;cluster-engine;sources;09.utilities.lisp.newest" :
;   In get-nr-for-engine-with-highest-index: type declaration for unknown variable engine
;   In remove-list-before-startpoint: type declaration for unknown variable endpoint
;   In get-durations-at-notecounts: type declaration for unknown variable notecount
;   In get-durations-at-notecounts: type declaration for unknown variable voicenr
;   In get-durations-at-notecounts: type declaration for unknown variable notecounts
;   In get-timepoints-at-notecounts: type declaration for unknown variable notecount
;   In get-timepoints-at-notecounts: type declaration for unknown variable voicenr
;   In get-timepoints-at-notecounts: type declaration for unknown variable notecounts
;   In get-timepoints-at-notecounts-one-voice: type declaration for unknown variable notecount
;   In get-timepoints-at-notecounts-one-voice: type declaration for unknown variable notecounts-all-voice
;   In get-timepoints-at-notecounts-one-voice: type declaration for unknown variable list-voicenrs
;   In remove-rests-and-gracenotes-from-durationlist: type declaration for unknown variable timepoints
;   In get-timepoints-from-any-timepoint-minus-nsteps-ignor-rests-and-gracenotes: type declaration for unknown variable vsolution
;   In get-events-from-any-timepoint-minus-nsteps-ignor-rests-and-gracenotes: type declaration for unknown variable vsolution
;   In get-notecounts-from-any-timepoint-minus-nsteps-ignor-rests-and-gracenotes: type declaration for unknown variable vsolution
;   In get-timepoints-from-any-timepoint-minus-nsteps-ignor-rests: type declaration for unknown variable vsolution
;   In get-events-from-any-timepoint-minus-nsteps-ignor-rests: type declaration for unknown variable vsolution
;   In get-notecounts-from-any-timepoint-minus-nsteps-ignor-rests: type declaration for unknown variable vsolution
;   In get-timepoints-from-any-timepoint-minus-nsteps-ignor-rests-simplify-gracenotes: type declaration for unknown variable vsolution
;   In get-timepoints-from-any-timepoint-minus-nsteps: type declaration for unknown variable vsolution
;   In get-notecounts-from-any-timepoint-minus-nsteps: type declaration for unknown variable all-events
;   In get-timepoints-from-any-timepoint-minus-nsteps-ignor-gracenotes: type declaration for unknown variable vsolution
;   In get-events-from-any-timepoint-minus-nsteps-ignor-gracenotes: type declaration for unknown variable vsolution
;   In get-timepoints-from-before-any-timepoint-minus-nsteps-ignor-gracenotes: type declaration for unknown variable all-onsets-no-gracenote-no-rest
;   In an anonymous lambda form at position 106661: Duplicate definitions of remove-rests-and-return-notecountlist, in this file
;   In matrix-trans: type declaration for unknown variable row
; Warning: Lisp compilation failed while compiling #<cl-source-file "cluster-engine" "sources/09.utilities">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
; Warning: Lisp compilation had style-warnings while compiling #<cl-source-file "cluster-engine" "sources/09.utilities">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/09b.markov-tools.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/09c.cluster-energy-profile.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/12.debug-tools.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/13.convert-pmc-rules.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/_000.main-interface.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-engine/sources/export.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-rules/sources/package.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-rules/sources/utils.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-rules/sources/rhythm-rules.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-rules/sources/melody-rules.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-rules/sources/harmony-rules.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-rules/sources/counterpoint-rules.lisp"...
;Compiling "/Users/acme/common-lisp/cluster-rules/sources/export.lisp"...
;Compiling "/Users/acme/common-lisp/tot/sources/slippery-chicken.lisp"...
;Compiling "/Users/acme/common-lisp/tot/sources/utils.lisp"...
;Compiling "/Users/acme/common-lisp/tot/sources/OMN-utils.lisp"...
;Compiling "/Users/acme/common-lisp/tot/sources/score.lisp"...
;Compiling "/Users/acme/common-lisp/tot/sources/rhythm.lisp"...
;Compiler warnings for "home:common-lisp;tot;sources;rhythm.lisp.newest" :
;   In an anonymous lambda form at position 65555: Duplicate definitions of total-duration, in this file and in "home:common-lisp;tot;sources;OMN-utils.lisp.newest"
; Warning: Lisp compilation failed while compiling #<cl-source-file "tot" "sources/rhythm">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
; Warning: Lisp compilation had style-warnings while compiling #<cl-source-file "tot" "sources/rhythm">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
;Compiling "/Users/acme/common-lisp/tot/sources/pitch.lisp"...
;Compiler warnings for "home:common-lisp;tot;sources;pitch.lisp.newest" :
;   In stretch-pitches: Undeclared free variable chord
; Warning: Lisp compilation failed while compiling #<cl-source-file "tot" "sources/pitch">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
; Warning: Lisp compilation had style-warnings while compiling #<cl-source-file "tot" "sources/pitch">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
;Compiling "/Users/acme/common-lisp/tot/sources/velocity.lisp"...
;Compiling "/Users/acme/common-lisp/tot/sources/articulations.lisp"...
;Compiling "/Users/acme/common-lisp/tot/sources/PWGL.lisp"...
;Compiling "/Users/acme/common-lisp/tot/sources/constraints.lisp"...
;Compiling "/Users/acme/common-lisp/tot/sources/form.lisp"...
;Compiling "/Users/acme/common-lisp/tot/sources/orchestration.lisp"...
:tot
nil
89 > 
:tot
nil
89 > 

 

Link to comment
Share on other sites

Actually, these are warnings and not errors. They point out various issues in the code that could be improved (in particular in the library cluster engine, as you may have noticed), but the code should still work overall. Also, you should see these compilation and warning messages only once (if you never change the code of the relevant library).

 

Just try to go on and actually run some examples of these libraries. 

 

Please let me know if you run into an actual error message. (There are some minor bugs of course, but at least for my tot library I try to make them explicit in the documentation as well.)

 

Best,

Torsten

Link to comment
Share on other sites

> I like the Carnatic Stuff.

 

To best understand what those functions offer I recommend the book referenced in the doc (Reina, 2016), which was quite an eye-opener for me. There is a partial preview at Google Books (https://books.google.co.uk/books?id=4RSrCwAAQBAJ&amp;printsec=frontcover#v=onepage&amp;q&amp;f=false), and further information is available at the associated websites (http://www.contemporary-music-through-non-western-techniques.com and http://www.rafaelreina.org/book-online-material.html).

 

Best,

Torsten

 

References

Reina, R. (2016) Applying Karnatic Rhythmical Techniques to Western Music. Routledge.
added 8 minutes later

I just noticed the perhaps most important Karnatic function so far, gen-karnatic-cell, is not contained in the automatically generated documentation, because the documentation tool seemingly skips functions that are not defined at the top level. I may fix that at some stage, but for now you can read the documentation in the doc string of the function in its source file (rhythm.lisp), or you evaluate the following line and read it in the listener.

 

(documentation 'gen-karnatic-cell 'function)

 

Best,

Torsten

 

Link to comment
Share on other sites

I got just four 16th notes.

 

This function allows for various controls that you did not use – Of course this function also allows for plain sequences of 1/16-notes, when you select its arguments accordingly 🙂   I am interested in CAC as a means of control on a higher level instead of some automatic "magic".

 

You might want to run the examples below in Opusmodus to get music notation outputs, which are likely more easy to read than the OMN expressions, but nevertheless I provide the OMN expressions for completeness as well.

 

The argument position (3rd argument) controls the kind of rhythmic cell that you get, see the doc for details. Here is an example where different rhythmic cells are returned. Note that by default all returned cells carry potentially a durational accent. 

 

(gen-karnatic-cell 4 4 '(0 4 3 2 1 0))
=> ((1/4) (1/16 1/16 1/16 1/16) (1/8 1/16 1/16) (1/8 1/8) (3/16 1/16) (1/4))

 

Now, if you use the same positions but different gati or jathi settings then you get a somewhat similar rhythm in that different gati/jathi. Below I slightly adapted the positions to make the results even more similar. 

 

(gen-karnatic-cell 4 5 '(0 6 3 2 1 0))
=> ((5/16) (1/16 1/16 1/16 1/16 1/16) (3/16 1/16 1/16) (3/16 1/8) (1/4 1/16) (5/16))

 

You can, of course, use these in a different time signature (e.g., the tala of your choice).

 

(omn-to-time-signature (gen-karnatic-cell 4 5 '(0 6 3 2 1 0)) '(4 4))
=> ((q c4 tie s s s s s s e. s s s tie) (e c4 c4 q s q tie s))

 

If you want to keep track of where the accents are located, you could mark them before this transformation (the function articulate-phrase is defined below this post). You could then manually later revise the notation to instead you the beam-breaking that Reina recommends. 

 

(omn-to-time-signature 
 (articulate-phrase (gen-karnatic-cell 4 5 '(0 6 3 2 1 0))
                    :accent 'marc)
'(4 4))

=> ((q c4 tie+marc s marc s marc s s s s e. marc s s s tie+marc) (e c4 c4 q marc s q tie+marc s marc))
 

After the changed jathi above, here is a different gati. Results are more similar, because the underlying data is the same with different gati but the same jathi. Here is an example with quintuplets. 

 

(gen-karnatic-cell 5 4 '(0 4 3 2 1 0))
=> ((1/5) (1/20 1/20 1/20 1/20) (1/10 1/20 1/20) (1/10 1/10) (3/20 1/20) (1/5))

 

Here is the same with triplets -- exactly the same, only slower. 

 

(gen-karnatic-cell 3 4 '(0 4 3 2 1 0))
=> ((1/3) (1/12 1/12 1/12 1/12) (1/6 1/12 1/12) (1/6 1/6) (1/4 1/12) (1/3))


You can also change the jathi (or even gati) on the fly in a phrase. The given pattern is then 'cycled through'.

 

(gen-karnatic-cell 4 '(5 5 3 3) '(0 6 3 2 1 0))

=> ((5/16) (1/16 1/16 1/16 1/16 1/16) (1/16 1/16 1/16) (1/16 1/16 1/16) (1/4 1/16) (5/16))


You can also randomise your position

 

(gen-karnatic-cell 4 5 '(0 1 ? ? 0))

=> ((5/16) (1/4 1/16) (3/16 1/8) (3/16 1/16 1/16) (5/16))


And I did not even start discussing the other parameters yet. For example, you can set whether or not cells start with a durational accent (not a karnatic concept, but very useful notion for Western ears when dealing with rhythm). 

 

(gen-karnatic-cell 4 5 '(3 3 3 3) :accented? '(T nil nil T))

=> ((3/16 1/16 1/16) (1/16 3/16 1/16) (1/16 3/16 1/16) (3/16 1/16 1/16))

 

You can filter in various ways want kind of rhythm you want, e.g., set the minimum or maximum number of notes per cell. 

 

(gen-karnatic-cell 4 5 '(? ? ? ?) :min-number '(3 3 3 3) :seed 1)

=>((1/8 1/8 1/16) (3/16 1/16 1/16) (1/16 1/16 1/16 1/16 1/16) (1/8 1/8 1/16)) 

 

EDIT: Oops, that are is seemingly not fully working as expected.

 

I stop here and refer you do the documentation for more details: there are several more arguments that I did not even mention yet. I know that my documentation is rather concise and not a textbook, but it briefly discusses every detail. I said from the beginning, I wrote this for myself, so you might want to first spend a bit of time with the doc 🙂

 

As you hopefully can see, this function alone allows for a rather rich world of rhythm with rather precise control that allows varying some rhythmic idea in various ways. I am interested here in clearly perceivable rhythmic similarities, e.g., between rhythms in different gati and jathi combinations in the Western tradition of thematic variation.  

 

Of course, you can also process the result further in various ways. E.g., I am adding ties after long notes and/or subdivide short notes to increase the rhythmic contrast, and I am turning certain notes into rests...
 

Best,

Torsten

 

(defun articulate-phrase (sequence &key (accent 'marc))
  "Add articulations to phrase for more clear rhythmic accents, e.g, an accent on every first beat
.
  
  NOTE: This function assumes that `sequence' is a purely rhythmic OMN expression with only length values and perhaps ties. However, a sequence with (constant) pitches is returned, because certain Opusmodus functions do not support an OMN sequence without pitches.

  Examples:
  (articulate-phrase '((h h) (q q q q tie) (q q q q) (-q q) (q q q q)) :accent 'marc)
  => ((h marc h) (q marc q q q tie) (q q q q) (-q q) (q marc q q q))
  "
  (cons 
   ;; First bar
   ;;; NOTE: code repetition...
   (let ((bar1 (first sequence)))
     (if (length-notep (first bar1))
       (if (and (= (count-notes bar1) 1)
                (eql (first (last bar1)) 'tie))
         (tu:replace-element (merge-articulations (list accent 'tie)) 1 bar1)
         (tu:insert-after bar1 0 accent))
       bar1))
   ;; other bars
   (loop :for (bar1 bar2) :on sequence :while bar2
     ;;; NOTE: code repetition
     :collect (if (and (length-notep (first bar2))
                       (not (eql (first (last bar1)) 'tie)))
                (if (and (= (count-notes bar2) 1)
                         (eql (first (last bar2)) 'tie))
                  (tu:replace-element (merge-articulations (list accent 'tie)) 1 bar2)
                  (tu:insert-after bar2 0 accent))
                bar2))))

 

Link to comment
Share on other sites

  • 2 weeks later...

all your hard work to document

 

I actually do such detailed documentation for my own benefit as well. I once spent several months on developing some personal library that I used for composing some piece, but when I wanted to re-use it some two years later, I could not really understand my own functions anymore. Since then I better err on the side of overdoing the docs 🙂

 

Best,

Torsten

 

Link to comment
Share on other sites

  • 4 years later...

Greetings @torstenanders,

 

I'm hoping you can help.

 

Having used Cluster Engine in OpenMusic, I was eager to try it in Opusmodus. I was also interested in many of the functions in tot. When I try to load tot, however, it fails:

 

;Compiling "/Users/jon/common-lisp/cluster-engine/sources/iter.lisp"...
;Compiling "/Users/jon/common-lisp/cluster-engine/sources/package.lisp"...
;Compiling "/Users/jon/common-lisp/cluster-engine/sources/iter-forwind.lisp"...
;Compiler warnings for "home:common-lisp;cluster-engine;sources;iter-forwind.lisp.newest" :
;   In an anonymous lambda form at position 146: Undeclared free variable &optional
;   In an anonymous lambda form at position 156: Undeclared free variable by
;   In an anonymous lambda form at position 461: Undeclared free variable v (2 references)
;   In an anonymous lambda form at position 567: Undeclared free variable list (2 references)
;   In an anonymous lambda form at position 929: Undeclared free variable var (2 references)
;   In an anonymous lambda form at position 1024: Undeclared free variable in (6 references)
;   In an anonymous lambda form at position 1050: Undeclared free variable previous (2 references)
;   In an anonymous lambda form at position 1080: Undeclared free variable initially
;   In an anonymous lambda form at position 1112: Undeclared free variable vars (4 references)
;   In an anonymous lambda form at position 1258: Undeclared free variable on
;   In an anonymous lambda form at position 1274: Undeclared free variable tail (8 references)
;   In an anonymous lambda form at position 1295: Undeclared free variable =
;   In an anonymous lambda form at position 1309: Undeclared free variable incr (8 references)
;   In an anonymous lambda form at position 1309: Undeclared free variable tail-tail (2 references)
;   In an anonymous lambda form at position 1346: Undeclared free variable source (3 references)
;   In an anonymous lambda form at position 1364: Undeclared free variable ptail (5 references)
; Warning: Lisp compilation failed while compiling #<cl-source-file "cluster-engine" "sources/iter-forwind">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
; Warning: Lisp compilation had style-warnings while compiling #<cl-source-file "cluster-engine" "sources/iter-forwind">
; While executing: uiop/lisp-build:check-lisp-compile-warnings, in process Listener-1(7).
ASDF could not load tot because Unbound variable: vars.
> Error: Unbound variable: vars
> While executing: #<Anonymous Function #x302003D5A50F>, in process Listener-1(7).
> Type cmd-. to abort, cmd-\ for a list of available restarts.
> Type :? for other options.
1 > 

 

If I checkout a sufficiently-old commit of cluster-engine, I can get past that error (commit 064ad4fd107f8d9a3dfcaf260524c2ab034c6d3f is the last one prior to the introduction of iter-forwind.lisp). However, it fails when it gets to tot/sources/tuning.lisp:

 

;Compiling "/Users/jon/common-lisp/tot/sources/tuning.lisp"...
ASDF could not load tot because The function ratio-to-cent is predefined by Opusmodus..
> Error: The function ratio-to-cent is predefined by Opusmodus.

 

Again, if I checkout commits from 2018 (for each repo) when this thread was started, I can load tot (and its dependencies) but some things are broken, most likely because Opusmodus has changed in the interim.

 

Any thoughts on why CCL and/or Opusmodus hates the "vars" variable so much in iter-forwind.lisp? Can "ratio-to-cent" be commented out or renamed without wreaking havoc on the rest of tuning.lisp? Will all these issues be rendered moot with the switch to LispWorks in Opusmodus 3 or will the library require an overhaul to work in Opusmodus 3?

 

Thank you,

 

Jon Southwood

 

 

Link to comment
Share on other sites

On 11/14/2022 at 5:17 PM, opmo said:

Don't load foreign libraries into OM package.

As for the cluster-engine unbound variable you should inform Torsten about.

 

I'm a bit confused. This entire thread is about loading Torsten's libraries (fenv, cluster-engine, cluster-rules, tot). Regardless, I'll reach out to Torsten directly.

 

Thanks,

Jon

Link to comment
Share on other sites

Copied direct response to Jon: 

 

Dear Jon,

 

Thanks for your interest. You likely need to use another branch of the cluster-engine repository (optimisations): https://github.com/tanders/cluster-engine/tree/optimisations  

 

Background: cluster-engine was initially developed for another Lisp compiler, and I had to do a number of revisions to get it working inside Opusmodus and other compilers.

 

I would ideally clean up the git repository, but don't really have the time to do that in the foreseeable future.

 

> I can load tot, but some things are broken, most likely because Opusmodus has changed in the interim.

Indeed, that happens. Opusmodus functions change (even their interface), and there is not really an easy way to see in a single document all the breaking changes, and I currently do not have the time to follow this up anyway. Sorry.

 

Luckily, both Opusmodus and tot are rather modular, so ideally only some things are broken and others still work. Sigh...

 

> The function ratio-to-cent is predefined by Opusmodus.

Yes, I vaguely remember that this one cropped up at some stage when Opusmodus introduced that function. In a nutshell, the problem is here that Opusmodus makes it difficult to use independent Lisp packages, and Opusmodus itself defines very many symbols so these clashes happen. 

 

? Possible workaround for now: remove the source file tuning.lisp and thus all microtonal stuff that tot defines for now (because a lot depends on the function ratio-to-cent there) ? Messy...

 

I currently do not have the time to use Opusmodus, and unfortunately it shows in such breaks.

 

Hope this helps. Sorry for all this mess. 

 

Link to comment
Share on other sites

the problem is here that Opusmodus makes it difficult to use independent Lisp packages

In Opusmodus' defence, this software tries to simplify using Lisp for non-programmers. This design goal somewhat conflicts with the design philosophy of Common Lisp itself to be a programming environment geared particularly towards large-scale and complex programming projects (in contrast to, say, Scheme or Python). Opusmodus therefore simplified a number aspects of Lisp including the discouragement of Lisp packages for Opusmodus programs. 

Link to comment
Share on other sites

There are no restriction of any kind.

Indeed, arbitrary Lisp libraries can be loaded into Opusmodus, which is great. I was ported over a number of libraries from other systems this way (some from OpenMusic as well, though not shared yet, as their development status is even more messy).

 

Opusmodus makes it difficult to use independent Lisp packages

Just for completeness, I was talking here not about external Lisp libraries, but Lisp packages. Perhaps I was incorrect above, or at least not up to date. 

 

Sorry: this now gets a bit geeky. Are meanwhile *all* user-facing Opusmodus functions and also *all* symbols of its score format external symbols in that package? If so, then my comment above is indeed incorrect, and one could combine the external symbols of Opusmodus with the symbols of other packages in a clean separate package that would then represent Opusmodus extended with some other library in a clean way (and symbol shadowing could be controlled if necessary).

 

At the time I (started to) define the tot library, the above was not the case, and I felt forced to define all my extensions directly within the Opusmodus package. Such package bloating is something I would usually try to avoid.

 

Link to comment
Share on other sites

  • 2 months later...

Hello,

 

Is TOT still supported and working with OM 3.0? I see the latest pull request for the repo was July 2021.

 

The installation instructions on the site seem to only include the git commands to clone the repo. I created the directory /common-lisp under my user folder and pulled all the repos mentioned into the folder.

Of course, that is not an "installation" unless the folder is already linked to lisp. Which mine isn't. So I tried to load everything via ASDF.

 

But, when I try to load via asdf using quickload 

(ql:quickload "/Users/ttolleson/common-lisp/tot")

 

The response is 

 

Error: Reader cannot find package QL.

 

So, without being sure as to how CCL loader prefers to load, I went ahead and attempted the command given in this thread which is

(require :tot)

Of course that won't work if it isn't installed. So the result of that was

Error: REQUIRE was called after delivery time with module :tot.
To fix this, either require the module before delivery or use :KEEP-MODULES T.
  1 (abort) Return to debug level 1.
  2 Return to top loop level 0.

Right.

So I'm not understanding the actually commands to run in OM using ASDF. FOr future readers, the options in the top GUI menu

Tools> Load 

and

Tools > compile

don't seem to do what's needed here. 

 

Any advice is appreciated. 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