Reveal News created a python package known as MIDITime. It can be used for time series data.
Unfortunately, the tool isn’t user-friendly, so it can be hard to understand how it work at first blush. If your data points are distant from one another in clock-time, there’s a possibility to account that it can be clustering in time.
How to Install MIDITime
If you’re a MAC or Linux user, you can use pip to install the tool fast. If you’re a Windows user, you may need another helper program for your machine to install MIDITime.
How it Works
NB: Before running any script, you must install MIDITime with pip.
Once it’s ready, the tool creates an output file destination and sets the tempo. When it comes to notes, you can see the numbers where the first ones are the time when the note should be played, the pitch, the attack, and the length. Notes are transformed into the tracks and then the tracks become myfile.mid.
To describe music, you can use the ‘ABC Notation’, a special text file. Moreover, it’s easy to convert the ABC notation into a mid file with the help of various tools.
Do you want to understand how it works? You can use regular expressions to get the data into the format by opening a topic model in a spreadsheet. Firstly, copy the topic data. Secondly, leave columns to the left and to the right of the data. The next step is to copy and paste non-replaceable elements to fulfill the entire column (it’s important to use the ‘year/month/day’ format). If you’ve fulfilled the table, copy and paste the data into your text editor to make it become a part of the ‘my_data’ array. However, don’t forget that the last row doesn’t need a come at the end. All in all, you will get such type of the final script:
What is more, you’d better have a unique script for each column of your original data. Also, it’s important to change the output file name.