Count the number of notes, tracks and other MIDI file data
This service allows you to analyze MIDI files.
The project started as a tool to count the number of notes in Black MIDI files, which usually have tens of thousands of notes. Currently, there is a limit to the maximum file size of 8Mb. I can upgrade my code to handle much larger files if there is enough demand. But for now, it looks like enough.
There are also some other statistics. Like MIDI file notes range, time signature, tempo, and track information. Service displays it if possible.
If you have any thoughts you'd like to share, want to see additional features, or have found any bugs, please get in touch with me at streamdevprojects@gmail.com.
Programmatic access to MIDI analysis
This API provides the same functionality as the web interface but is easier to use with programming languages.
To analyze your MIDI file, follow these simple steps:
https://streamdevprojects.com/midi/api/v1/analyze
.
X-API-KEY
.
If you don’t have an API key yet, you can easily obtain one for free
here.
The response is returned in JSON format
and includes a boolean success
element,
which indicates whether the request was successful.
The analysis results are contained within the midi
element.
This element is an object that provides general
file information,
along with a list of tracks
and notes
.
On the right Below, you’ll find an example of a simple request and response. Use this as a guide for making your own API calls. If you have any questions or feature requests, please feel free to email me.
curl https://streamdevprojects.com/midi/api/v1/analyze \-X POST \-H "Content-Type: multipart/form-data" \-H "X-API-KEY: <your_api_key>" \-F file=@<file_path>
{
"success": true,"midi": {"general": {"notesCount": 110,"notesRange": {"minNum": 41,"maxNum": 81,"minTxt": "F3","maxTxt": "A6"},"timeSign": "4/4","bpm": 112},"tracks": [{"notesCount": 66,"notesRange": {"minNum": 55,"maxNum": 81,"minTxt": "G4","maxTxt": "A6"},"notesStats": [{"num": 55,"txt": "G4","count": 7},{"num": 57,"txt": "A4","count": 6},...]},{"notesCount": 44,"notesRange": {"minNum": 41,"maxNum": 48,"minTxt": "F3","maxTxt": "C4"},"notesStats": [{"num": 41,"txt": "F3","count": 4},{"num": 43,"txt": "G3","count": 8},...]}],"notes": [{"num": 41,"txt": "F3","count": 4},{"num": 43,"txt": "G3","count": 8},...]}
}