The library cluster-rules is an extension of the music constraint solver Cluster Engine by Örjan Sandred. Like Cluster Engine, this code was originally a PWGL library, but the present version is plain Common Lisp.
The instructions below use git for the installation. Even though it is a bit more involved at first, it allows for convenient updates later, and you can even contribute to the development.
Install git (if you have not done already). Also, you should register at GitHub.
Download the present software with git into a directory where ASDF can find the software, e.g., ~/common-lisp/. For example, on UNIX incl. OS X you can enter the following commands at the command line (after you created the directory ~/common-lisp/
). Note that $
is the terminal prompt here, you do not need to enter that :)
$ cd ~/common-lisp
$ git clone https://github.com/tanders/cluster-rules.git
You will be asked for your GitHub username and password.
This library depends on two other libraries, which you can install in the same way.
$ cd ~/common-lisp
$ git clone https://github.com/tanders/cluster-engine.git
$ git clone https://github.com/tanders/ta-utilities.git
If there are changes, you can update your software later at the terminal in the following way. Make sure you update the dependencies likewise.
$ cd ~/common-lisp/cluster-rules
$ git pull
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 (such as cluster-engine) are loaded automatically as well.
(require :cluster-rules)
The library cluster-rules provides predefined rules and some utilities for Cluster Engine. Below is a minimal example that disallows pitch repetitions and syncopations in a monophonic line with two rules from the present library.
(cr:cluster-engine
20
;; rules
(ce::rules->cluster (cr::no-syncopation :metric-structure :beats)
(cr::no-repetition))
'((3 4))
'(((1/4) (1/8))
((60) (61))))
Distributed under the GNU General Public License.
Copyright © 2017 Torsten Anders