Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 3.71 KB

README.md

File metadata and controls

46 lines (28 loc) · 3.71 KB

Melodizer

This repository is home to three computer-aided composition projects in the form of Common Lisp libraries.

The first one, Melodizer, is an OpenMusic object allowing you to generate innovating melodic ideas from a sequence of chords that you give.

The second one, Melodizer2.0, is based on Melodizer but can generate polyphonic music. It has a specific data structure, called blocks, that can be combined both vertically and horizontally and constraints can be added on and between blocks.

The third one is still a work in progress. It is a formalization of counterpoint in the style of Johann Joseph Fux. Currently all five species of two-voice counterpoint are formalized and the library functions allow to generate counterpoint from user-specified cantus firmi. A user interface has been released. Future improvements will be pushed regularly when available.

How to use

All three libraries require GiL, a library linking Gecode to Lisp that can be found here. All instructions on how to install it can be found on its github page.

Melodizer, Melodizer2.0 and FuxCP have pdf files explaining how they work and how to use them in their respective UserGuide folder. Since the Fux formalization is not finished yet, the instructions on how to use it are detailed below.

Melodizer

Structure explanation

In Melodizer/sources, there are 4 files.

melodizer-csp.lisp This file contains the Constraint Satisfaction Problem, including the creation of the variables, the search space, the posting of the constraints, the branching, and the search.

melodizer-csts.lisp This file contains all the constraints available for the CSP.

melodizer-utils.lisp This file contains all the auxiliary functions used in the project.

melody-finder.lisp This file contains the code for the OM object.

Melodizer2.0

Fux formalization

Structure explanation

FuxCP is an OpenMusic library that uses GiL to communicate constraints with Gecode. The solver itself therefore runs in Gecode directly. At the level of the distribution of the files, all the functions that post the constraints have been placed in a single and same file. The different species, which represent a set of rules, call these functions such that the constraints set reflect the rules of these species. Apart from that, the interface calls the main CSP creation and search functions via the fuxcp-main.lisp file. The latter chooses what to do, in particular according to the type of counterpoint chosen.

Using FuxCP

There is a single block comprising the entire graphical interface of the tool. This block or class is called cp-params. To load it, it is possible to type fuxcp::cp-params in a new patch entry; or load the block of the class by loading "cp-params" from the drop-down menu by right-clicking in the patch (Classes -> Libraries -> FuxCP -> Solver -> CP-PARAMS).

Once this block has appeared, all you have to do is bind an OM voice object, representing the cantus firmus to the second argument of cp-params. Don't forget to block the input voice object and evaluate cp-params so it can detect the new input. Now cp-params can be blocked too. From now on, you could directly use the interface and generate counterpoints using the tool. If you want to retrieve the voice object containing the counterpoint generated by the tool, just bind the third argument on the output side to a voice object. Once bound, it is then possible to evaluate the voice object so that it updates. For more explanation on the use of the interface, you can refer to the User Guide.

Future steps

In the future, the model of Fux's rules will be extended to be able to generate 3 and 4-voice counterpoint.