GithubHelp home page GithubHelp logo

jesusoctavioas / rl-musician Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nikolay-lysenko/rl-musician

0.0 0.0 0.0 364 KB

Composition of music with reinforcement learning.

License: MIT License

Python 100.00%

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 by reinforcement learning agents. Here, an agent interacts with piano roll environment, episode end is submission of current piano roll, and reward is determined by applying evaluation rules to the roll.

Comparing to music composition tools such as MuseNet, reinforcement learning approach (at least in theory) has two advantages:

  • Actual creativity lies not in imitation of famous pieces, but in finding new ways to create something to be called art. Reinforcement learning meets this criterion, but supervised learning don't.
  • There are tuning systems other than equal temperament (say, in microtonal music) and there can be not enough pieces for some of them. A model can not be trained in a supervised manner without a dataset, but, given evaluation rules, an agent can be trained even for an absolutely new tuning system.

Currently, the implementation of environment supports only equal temperament, but this limitation may be eliminated in the future.

To find more details, look at a draft of a paper.

Installation

To install a stable version, run:

pip install rl-musician

Usage

To train an agent from scratch and to get results produced by it, run:

python -m rlmusician \
    -c [path/to/your/config] \
    -p [how_long_to_train] \
    -e [how_many_pieces_to_produce]

All three arguments are optional. Default config is used if -c argument is not passed; -p and -e options have reasonable defaults too.

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

  • Piano roll in TSV format;
  • MIDI file;
  • Events file in sinethesizer TSV format;
  • WAV file.

rl-musician's People

Contributors

nikolay-lysenko 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.