HACKER Q&A
📣 stevehiehn

Is there a OS tool which queries MIDI datasets by chord progression/key?


I'm about to build a MIDI data query tool if it doesn't already exist. I need a simple tool that brute-force searches midi clips from public domain datasets. For example, I want to say my progression is in `C - 4/4 - Am7-Am7-G7-Dm7` And the system offers midi clips that match that exact criteria.

ps - I'm fully aware of generative music AIs (in fact I maintain one: https://signalsandsorcery.org/ , but in this case I'm interested in brute-force searching datasets.


  👤 LunarAurora Accepted Answer ✓
The crucial step is extracting the (best) harmony progression from each midi. Look at Chordino [1] with the vamp Python wrapper [2]

[1] https://code.soundsoftware.ac.uk/projects/nnls-chroma

[2] https://pypi.org/project/vamp/


👤 peterkos
A little manual, but music21[0] can do the analysis!

[0]: http://web.mit.edu/music21/


👤 thesnide
there is also midicsv that unlocks all the excel macros on midi data. And SQL/OLAP if you are so inclined.

https://www.fourmilab.ch/webtools/midicsv/


👤 stevehiehn
Just to follow up: I started building a python CLI tool. I'm only 2 days in but the 'happy path' is working: https://github.com/shiehn/midi_query

👤 sargstuff
midi2tones [1] can generate a streem of note sequences which can be awk/grep'd/reg-expression searched.

Midi 2 Nyquest[2] dumped to python AI used to visual identify requested cord progression (aka automate what a human reading a musical score would do) would be pretty cool (get location & stats of where progression occures)

------

[1] nyquest : https://en.wikipedia.org/wiki/Nyquist

[2] midi2tones : https://github.com/MLXXXp/midi2tones/blob/master/midi2tones....


👤 sargstuff
Some combination/variation from command line of grep/sed/awk script(s) using regular expressions & local file(s)/db containing relevant dataset(s) to search.

example unix shell command line:

   cat midi.data.file | grep 'C - 4/4 - Am7-Am7-G7-Dm7'
Pearl / python / ruby / go / lisp shell etc. make for easier paring with gui & on-line use of public domain datasets (vs. downloading dataset file/db)