Ever wondered how inverted music would sound like? Do you know what the original song is of this inverted song (and don’t look at the URL!)? In this post, some MIDI files are inverted and it is shown how you can invert a MIDI file yourself.
As inspired by this video, inverted music is defined as follows here. Suppose there is a basenote of value . Any note of value will be changed in opposite direction, such that the inverted note has value . So, the function which inverts a note is defined as .
As an example, assume that D is the basenote. A C (which has a distance 2 to D [C C# D]) is converted to an E (a distance 2 in the opposite direction: [D D# E]). Something funny happens with chords. A major chords will become a minor chord once it is inverted. Check it out yourself by looking at , and .
Are you interested in learning more Python? Order our new "Mastering Pandas" course now on Data Blogger Courses for only
- Learn to visualize data using Pandas
- Learn how to load and store data effectively
- Learn advanced data operations
The code can be found on GitHub. It just applies the rule above on all the MIDI tracks (except for the drum track).
Python is besides music also suitable for machine learning tasks. Maybe this article on fraud detection using machine learning algorithms is interesting for you. If not, you might be interested in a simple tutorial on building a spam detection system.
Inverted MIDI files
It is actually quite fun to experiment with MIDI files. Except for the poor quality of the music, it gives lots of insights into the dynamics of a piece of music. Have fun with inverting your MIDI files :-)!
Help building the Data Blogger CommunityHelp to grow our community to spread AI and Data Science education around the globe.
Every penny counts.