Git Product home page Git Product logo

midi2vec's Introduction

MIDI2vec: Learning Embeddings for MIDI Vector Space Representations

Compute graph embeddings from MIDI.

This library is described in detail in the following paper (bib)

Lisena P., Meroño-Peñuela A. & Troncy R. MIDI2vec: Learning MIDI Embeddings for Reliable Prediction of Symbolic Music Metadata. In Semantic Web Journal, Special issue on Deep Learning for Knowledge Graphs, vol.13, no.3, pp. 357-377, IOSPress, 6 April 2022 http://doi.org/10.3233/SW-210446

The experiments described in the paper are available here.

Pre-computed MIDI embeddings used in the paper are available in Zenodo.

Usage

The library is composed by 2 parts.

midi2edgelist

Convert a MIDI file into a graph, in edgelist format.

Requires Node.js:

cd midi2edgelist

npm install

node index.js -i <midi_folder>

Optional arguments:

  • -i, --input. Input directory containing MIDI files. REQUIRED
  • -o, --output Output directory for the edgelists. Default: ./edgelist
  • -n, --note-groups Number of groups of simultaneous notes to be taken in account for each MIDI. For example, -n 300 uses the first 300 groups. Default: all.

The output is formed by 4 edgelist (notes, program, tempo and time signature) and a csv containing the mapping between the file names and the given identifiers.

edgelist2vec

It uses node2vec for computing the embeddings from the egelists.

pip install -r edgelist2vec/requirements.txt

python edgelist2vec/embed.py

Optional arguments:

  • -i, --input Input graph (edgelists) path. Default: .\edgelist;
  • -o, --output Output file name. Default: embeddings.bin;
  • --walk_length Length of walk per source. Default: 10;
  • --num_walks Number of walks per source. Default: 40;
  • -p Return hyper-parameter (as in node2vec). Default: 1;
  • -q Inout hyper-parameter (as in node2vec). Default: 1;
  • --dimensions Number of dimensions. Default: 100;
  • --window-size Context size for optimization. Default: 5;
  • --iter Number of epochs in word2vec. Default: 5;
  • --workers Number of parallel workers. Default: 0 (full use);
  • --exclude Edgelists to be excluded from the computation.

midi2vec's People

Contributors

pasqlisena avatar albertmeronyo avatar pbloem 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.