Coder Social home page Coder Social logo

compose's Introduction

This program takes two musical works in input and outputs a new musical work in invention form (a baroque keyboard form with the melody rocking back and forth between the upper and lower voice and some degree of imitation between the voices), trying to mimic the style of the input works. It uses the techniques described by David Cope in his book Computers and Musical Style, 1991, chapter 4. The general idea is to look for motives that appear in both works (called "signatures") and to recombine signatures to compose a new piece of music while adhering to some constraints.

Disclaimer: this is an extremely simple program. Used correctly, it will produce music that is "correct" tonal Western music in a very loose sense of the term (e.g., no dissonance, cadential ending), but certainly not successful from a compositor's point of view. This simple program does not give an accurate image of David Cope's work on automated composition, which is far deeper and more complex.

An example output can be found in the examples/ subdirectory. It is the result of running the program on the two (manually simplified) Bach inventions nos. 1 and 5 present in examples/ as MIDI files.

Build, run and/or install

You will need to have opam, the OCaml package manager, installed.

# Installing
opam install .

# ... or simply building and running
opam install . --deps-only
dune exec -- compose <args...>

Usage

compose <input work 1> <input work 2> -o <output file>
  -o Output file name
  --seed Random seed
  --debug Comma-separated list of passes to enable debug output for
  --motive-size Size of signatures to look for in the input works (default 4)
  --min-length Minimum length of the output piece in beats. The true length may be slightly  greater because of the requirement to end on a cadence. (default 29)
  --track-index-1 Index of the track to analyze in first input work (default 0)
  --track-index-2 Index of the track to analyze in second input work (default 0)
  -help  Display this list of options
  --help  Display this list of options

The input works should be in MIDI format, and so will be the output. For the output to be even remotely satisfactory, the input works should verify a number of conditions:

  • They must be in C major
  • Ornamentations and accidentals should be removed (you can try not to, but pattern matching may yield an very small number of common motives, which will show in the result)

compose's People

Contributors

oliviernicole avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.