Giter VIP home page Giter VIP logo

music-generator's Introduction

Music-generator

A python library for generating random music to be used as training set for instrument detection and score-generation from recorded audio with machine learning. As presented (recording) at EuroPython 2018.

Truth is ever to be found in simplicity, and not in the multiplicity and confusion of things.

Isaac Newton

The benefits of using a music generator as training set over recorded music are:

  • We can control the complexity of our problem (how many instruments, what type of instruments, type of rhythms, polyphone vs. monophone, etc.).
  • We always know the ground truth.
  • Since we are generating the data, the data set is basically infinite.

Contents

The package offers:

  • Basic music theory:
    • Notes and their frequencies (tuning of A4 other than 440 Hz is possible, only the scale-invariant, equal temperament is supported for now)
    • Scales: major/minor scales, a generic scale is also available
    • Chords: major/minor chords, augmented and diminished
    • Tempo, time signatures, measures
    • Tracks and scores
  • Synthesizer module:
    • Basic oscillators: square, sine, additive sine (to be added: triangle, wavetable synthesizer)
    • ADSR (attack-decay-sustain-release) enveloping for any generator
    • Butterworth filters
  • Random music generation module:
    • Generate random melody using random walk

Setup

Create virtual env:

$ python3 -m virtualenv venv

Activate it:

$ source venv/bin/activate

Install the package:

$ pip install -e .

Run tests:

$ py.test tests

For installing simpleaudio you might need to install the python3-dev package.

On Ubuntu I also had to install:

sudo apt-get install libasound2-dev
sudo apt-get install python3-tk

You might need to install ffmpeg.

Generate music some music:

$ python scripts/gen_random.py

music-generator's People

Contributors

marcelra avatar norpol 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.