Skip to content
Suite of converters to transform MIDI files into RDF and backwards
Python HTML CSS Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
old Fix #2 Feb 18, 2016
src
.gitignore ignored sparql-dj static media Jun 5, 2017
LICENSE Initial commit Feb 10, 2016
README.md Update README.md Jun 5, 2017
gunicorn_config.py
mid-note.ttl
mid-prog-interlinked.ttl interlink mid:Programs with DOREMUS Feb 7, 2019
mid-prog.ttl
requirements.txt fix vulnerable deps Oct 12, 2018
vocab.ttl
void.ttl Pattern to piece May 13, 2017

README.md

midi2rdf

Suite of converters to transform MIDI files into RDF and backwards.

Install

You need python 2.7. An updated version of virtualenv is recommended.

git clone https://github.com/midi-ld/midi2rdf
cd midi2rdf
virtualenv .
source bin/activate
pip install -r requirements.txt

Usage

python src/midi2rdf.py <midi-input-file> -f turtle|nquads|... [<rdf output file> [--gz]]: convert a MIDI file to RDF (-f indicates your desired serialization; see https://rdflib.readthedocs.io/en/latest/faq.html#questions-about-serializing for options). Examples:

python src/midi2rdf.py ghostbusters.mid -f turtle #prints MIDI as RDF Turtle in stdout
python src/midi2rdf.py ghostbusters.mid -f n3 ghostbusters.nt #dumps MIDI as RDF N-Triples to file
python src/midi2rdf.py ghostbusters.mid -f nquads ghostbusters.nq.gz --gz #dumps MIDI as RDF Nquads to gz compressed file

python src/rdf2midi.py <rdf-input-file> <midi-output-file>: convert that RDF file back to MIDI. The serialization will be guessed from the extension (so: name them carefully)

Other tools

python src/midicat.py <midi-file>: print human-readable MIDI commands

python src/playrdf.sh: play an RDF-converted MIDI file (requires timidity)

python src/stream-midi-rdf.py: print a stream of RDF triples coming from a virtual IAC device on the standard output. Can be used in combination with e.g. MIDI Guitar

Background & Features

  • Interoperable representation of MIDI files: link their contents to annotations, other musical events (e.g. MusicXML), or to any related resource on the Web
  • Lossless conversion: MIDI files play the same after round-tripping to RDF
  • If you prefer to use a "cloud service" version (i.e. without installing anything) to represent your MIDI files as Linked Data, go here

Documentation

Please check out the MIDI Linked Data documentation for details and tutorials on how to browse MIDI files as Linked Data, query them, etc.

Papers & References

  • Please cite this work as: Albert Meroño-Peñuela, Rinke Hoekstra. “The Song Remains the Same: Lossless Conversion and Streaming of MIDI to RDF and Back”. In: 13th Extended Semantic Web Conference (ESWC 2016), posters and demos track. May 29th — June 2nd, Heraklion, Crete, Greece (2016) (PDF)
  • Blog post by Bob DuCharme
  • Bring your MIDIs to the Dark Side
You can’t perform that action at this time.