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.
Type Name Latest commit message Commit time
Failed to load latest commit information.
old Fix #2 Feb 18, 2016
.gitignore ignored sparql-dj static media Jun 5, 2017
LICENSE Initial commit Feb 10, 2016 Update Jun 5, 2017
mid-prog-interlinked.ttl interlink mid:Programs with DOREMUS Feb 7, 2019
requirements.txt fix vulnerable deps Oct 12, 2018
void.ttl Pattern to piece May 13, 2017


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


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

git clone
cd midi2rdf
virtualenv .
source bin/activate
pip install -r requirements.txt


python src/ <midi-input-file> -f turtle|nquads|... [<rdf output file> [--gz]]: convert a MIDI file to RDF (-f indicates your desired serialization; see for options). Examples:

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

python src/ <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/ <midi-file>: print human-readable MIDI commands

python src/ play an RDF-converted MIDI file (requires timidity)

python src/ 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


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.