Code Monkey home page Code Monkey logo

rl-musician's Introduction

Build Status codecov Maintainability PyPI version

RL-Musician

Overview

As of now, this is a proof-of-concept for music composition with reinforcement learning solely. Here, creation of fifth species counterpoint is considered and environment is based on a special data structure that represents musical piece with pre-defined cantus firmus. An action is adding a new note to a counterpoint line, an episode is finished when counterpoint duration becomes equal to that of cantus firmus, and reward is determined by applying evaluational rules to the resulting piece.

Some pieces generated with this package are uploaded to a publicly available cloud storage. A cantus firmus attributed to Fux is used in all of them.

To find more details, look at a draft of a paper. Also, if you are interested in algorithmic composition without too strict limitations of species counterpoint, look at the Geniartor tool.

Installation

To install a stable version, run:

pip install rl-musician

Usage

To create a reward-maximizing musical piece and some its variations, run:

python -m rlmusician [-c path_to_your_config]

Default config is used if -c argument is not passed. Search of optimal piece with these default settings takes about 5 minutes on a CPU of a regular laptop. Before creating a new config, it might be useful to look at an example with explanations.

If you are on Mac OS, please check that parallelism is enabled.

Generated pieces are stored in a directory specified in the config. For each piece, there is a nested directory that contains:

  • MIDI file;
  • WAV file;
  • Events file in sinethesizer TSV format;
  • PDF file with sheet music and its Lilypond source.

rl-musician's People

Contributors

nikolay-lysenko avatar dependabot[bot] avatar

Watchers

James Cloos 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.