Skip to content

Rules defined for the music constraint solver cluster-engine by Örjan Sandred

License

Notifications You must be signed in to change notification settings

tanders/cluster-rules

Repository files navigation

cluster-rules

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.

Installation

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

Updating your software

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

Usage

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))))

License

Distributed under the GNU General Public License.

Copyright © 2017 Torsten Anders

About

Rules defined for the music constraint solver cluster-engine by Örjan Sandred

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published