Are there any tools to extract pitch data from midi?


SP4CEBAR 2021-04-28 20:15 (Edited)

I've spent an entire day trying to get the pitch data values for the nyan cat song. After trying numerous things, I sort-of got the data, but the timing is a little off, and it doesn't really sound right (I got the data by monitoring midi messages from VCV-rack, which was playing a nyan cat midi file, trough a midi interface).

Do you know any tools that extract pitch data values form midi?

Timo 2021-04-28 21:11

I wrote a MIDI importer for my own MIDI sequencer once :) But this won't help...
Maybe you can find some MIDI to tracker module converter. So you would have the data more similar to LowRes NX already.

SP4CEBAR 2021-04-29 10:30

@timo thanks, I'll take a look at those

SP4CEBAR 2021-04-29 14:17

Lowres NX has enough memory to import a midi file as hexadecimal data, so I could make a midi importing tool in NX.
I've looked at the midi file structure, but I couldn't figure out how I could determine where one part (for example the header) stops and another starts.

Timo 2021-04-29 19:13 (Edited)

This document looks good: http://personal.kent.edu/~sbirch/Music_Production/MP-II/MIDI/midi_file_format.htm

Each chunk header contains the length of its data, this is how you know where the next chunk starts.

Anyway, it's not easy to convert from MIDI to a tracker format (like LowRes NX). MIDI is event based and each event (note) has a length. In a tracker format everything is in a grid because of the table style. So you have to "quantize" the notes to make them fit into the table grid. Also in MIDI you can have more channels and each channel can play several notes at once. In LowRes NX you only have 4 channels and each can play only one note at once. Depending on the material it's still possible to get good results.

SP4CEBAR 2021-04-30 10:06

Thanks for the help

SP4CEBAR 2021-04-30 20:17 (Edited)

I made a program which can read a midi file

SP4CEBAR 2021-04-30 21:10 (Edited)

And a midi file player

SP4CEBAR 2021-05-01 11:23 (Edited)

Once the program was able to interpret midi, it was surprisingly easy to make a midi player and a midi quantizer

SP4CEBAR 2021-05-03 19:02 (Edited)

My midi program gets stuck on the midi files attached to this post, and tbh I don't understand them either (I've read it by hand).
At one point the midi event status byte will be 7F or lower (most significant bit is off) which means that it's not a valid status byte, so the program gets lost.
Other midi programs are able to play the files, so they aren't corrupted.
What could've gone wrong?

Tough Midi Files.nx | Open in app
2021-05-03 19:02

SP4CEBAR 2021-05-03 20:25 (Edited)

I think it has something to do with running status, I didn't look into it too much

Edit: it was indeed running status (lazy midi files)

Log in to reply.