All Projects → PooyaHekmati → music_embedding

PooyaHekmati / music_embedding

Licence: MIT license
A package for representing music data based on music theory

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to music embedding

Unimidi
Realtime MIDI IO for Ruby
Stars: ✭ 229 (+1105.26%)
Mutual labels:  midi
Chataigne
Artist-friendly Modular Machine for Art and Technology
Stars: ✭ 251 (+1221.05%)
Mutual labels:  midi
Ensembles
A digital arranger workstation powered by FluidSynth
Stars: ✭ 312 (+1542.11%)
Mutual labels:  midi
Iannix
IanniX is a graphical open-source sequencer, based on Iannis Xenakis works, for digital art. IanniX syncs via Open Sound Control (OSC) events and curves to your real-time environment.
Stars: ✭ 238 (+1152.63%)
Mutual labels:  midi
Usb Midi Driver
USB MIDI Driver for Android 3.1 or later
Stars: ✭ 244 (+1184.21%)
Mutual labels:  midi
Pedalino
Smart wireless MIDI foot controller for guitarists and more.
Stars: ✭ 105 (+452.63%)
Mutual labels:  midi
Midir
Cross-platform realtime MIDI processing in Rust.
Stars: ✭ 221 (+1063.16%)
Mutual labels:  midi
BSchaffl
MIDI groove quantizer LV2 plugin
Stars: ✭ 28 (+47.37%)
Mutual labels:  midi
Adlplug
FM Chip Synthesizer — OPL & OPN — VST/LV2/Standalone
Stars: ✭ 249 (+1210.53%)
Mutual labels:  midi
MIDI.jl
A Julia library for handling MIDI files
Stars: ✭ 55 (+189.47%)
Mutual labels:  midi
Midimonster
Multi-protocol control & translation software (ArtNet, MIDI, OSC, sACN, ...)
Stars: ✭ 241 (+1168.42%)
Mutual labels:  midi
Midianimationtrack
SMF (.mid) file importer for Unity Timeline
Stars: ✭ 243 (+1178.95%)
Mutual labels:  midi
webaudio-synth
WebAudio Polyphonic Synthesizer
Stars: ✭ 83 (+336.84%)
Mutual labels:  midi
Opendeck
Software and hardware platform for simpler building of MIDI controllers.
Stars: ✭ 232 (+1121.05%)
Mutual labels:  midi
osmid
osmid is a tool to bridge MIDI and OSC. It is currently in use in Sonic Pi
Stars: ✭ 63 (+231.58%)
Mutual labels:  midi
Timidity
Play MIDI files in the browser w/ Web Audio, WebAssembly, and libtimidity
Stars: ✭ 221 (+1063.16%)
Mutual labels:  midi
oddvoices
An indie singing synthesizer
Stars: ✭ 4 (-78.95%)
Mutual labels:  midi
teensy-midi-looper
teensy midi loop recorder
Stars: ✭ 30 (+57.89%)
Mutual labels:  midi
from-data-to-sound
🎵 Simple Node.js script for transforming data to a MIDI file
Stars: ✭ 33 (+73.68%)
Mutual labels:  midi
midi2img
MIDI to image and image to MIDI conversion scripts
Stars: ✭ 48 (+152.63%)
Mutual labels:  midi

Music Embedding

GitHub workflow Travis CI Codecov GitHub license GitHub release GitHub Stars Repo Size Code Size Code Quality

By SeyyedPooya HekmatiAthar 2021

Music Embedding is an open source python package for representing music data based on music theory. It provides tools to convert melodic and harmonic sequences to and from pianorolls.

Features

  • Representation for music intervals
  • Create sequence of (harmonic or melodic) intervals from pianoroll presentation
  • Create pianoroll from a sequence of (harmonic or melodic) intervals
  • Break the sequence of intervals into smaller pieces e.g. bars
  • Compress the sequence of intervals using Run Length Encoding (RLE)

Why Music Embedding

Embedding is an underexplored area in the intersection of AI and music. While many works try to apply NLP-based embedding and automatic embedding (such as convolution), representing music data based on music theory is important. Music Embedding package aims to make employment of music theory easy to enhance the computationals music projects' results. Some potential usecases are:

  • Statistical and probabilistic analysis of music pieces,
  • Developing generative models to have AI-synthesized music,
  • Genre classification,
  • Mood recognition,
  • Melody extraction,
  • Audio-to-Score alignment,
  • Score structure analysis.

Installation

Music Embedding's only prerequisit is the Numpy package. Music Embedding is developed and tested in interaction with Pypianoroll; yet, any other code which can handle pianorolls should work just fine.

To install Music Embedding, please run pip install music_embedding. To build Music Embedding from source, please download the source and run python setup.py install.

Semantic Versioning Policy

Music Embedding uses x.y.z format to indicate the version where x is major versin number, y is minor version number, and z is the patch number.

Documentation

Documentation is available here and as docstrings with the code.

Citing

Please cite this paper if you use Music Embedding in a published work.

Usage

Please visit the Getting Started page.

The following code snippet demonstrates how to convert a midi file into a sequence of harmonic intervals.

import music_embedding
import pypianoroll

if __name__ == '__main__':
    #opening midi file using pypianoroll
    midi_path = r'c:\Moonlight Sonata.mid'
    multi_track = pypianoroll.read(midi_path) 
    
    #mergeing midi tracks into a single pianoroll so harmonic intervals can be extracted
    merged_piano_roll = multi_track.blend('max') 
    
    #getting pianoroll of the first track
    pianoroll = multi_track.tracks[0].pianoroll
    
    #creating embedder object from music embedding package
    embedder = music_embedding.embedder.embedder()        
    
    #extracting harmonic intervals
    harmonic_intervals = embedder.get_harmonic_intervals_from_pianoroll(pianoroll=pianoroll, ref_pianoroll=merged_piano_roll)
    
    #creating interval object from music embedding package
    interval = music_embedding.interval.interval()
    
    #printing the first 20 intervals
    for i in range(20):
        interval.set_specs_list(harmonic_intervals[i])
        print(interval)

Issues

If you find a problem, please file a bug.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].