Ask HN: 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.
19 comments
[ 2.1 ms ] story [ 99.5 ms ] threadexample unix shell command line:
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)My experience/backround: pipy / python is more complex setup than using midi2tex,awk to format for grep search.
Awk typically used to convert files between formats. There are readily available midi to text conversion tool(s) finable via a search engine.
In this case, using awk to convert midi file to text format (or make use of a format from a midi to text tool) that can be use with grep would be the implied step.
"0 On ch=1 n=44 v=118 138 Off ch=1 n=44 v=0 240 On ch=1 n=46 v=63 377 Off ch=1 n=46 v=0 ..."
Which is cool, but from there I still need a layer to interpret the raw MIDI instruction into tonal harmony so a musician could query chords etc (i.e Cm9-G7-Bbmaj7), and thats where the midi to harmony libs come in
1) pull out the midi notes (ideally with some way to tag as a visual vertical group).
2) Regular expression pattern match/convert verticals to chord
3) Repeat with chord groupings & which groups looking for.
Ummm.... midi 2 nyquest 2 python AI automation starting to sound like a more rational way to go. ;)
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....
https://www.fourmilab.ch/webtools/midicsv/
[1] https://code.soundsoftware.ac.uk/projects/nnls-chroma
[2] https://pypi.org/project/vamp/
Lakh MIDI Dataset https://colinraffel.com/projects/lmd is smaller but directly downloadable
https://www.cnmat.berkeley.edu/sites/default/files/attachmen...
https://openaccess.city.ac.uk/id/eprint/1306/1/Wissmann%2C_J...
https://extemporelang.github.io/docs/guides/pattern-language...
https://github.com/topics/chord-progression
1) ensure the tune time sig is a match 2) for each bar collect the pitches and ensure that they contain the chord(or any inversion) of the chord at the index in question. 3) any non-chord/passing tones must exist in the overarching key or its not a match. If all 4 bars are a match I will reconstruct a midi clip and return it as a result.
[0]: http://web.mit.edu/music21/