Show HN: AutoMIDIFlip – An automatic MIDI flipper
I wrote AutoMIDIFlip based on the #midiflip challenge going around Twitter right now - basically, take a MIDI file, flip it so that the intervals are preserved but in the opposite direction, and see what it sounds like. It actually has some surprisingly good results.<p>Andrew Huang did the first one manually, as can be seen in the YouTube video linked on the front page. I figured I could write code to automatically do it even for people who didn&#x27;t have the software to do it themselves.<p>I plan to add more features to AutoMIDIFlip - in particular, it&#x27;d be nice to have an optional feature to auto-shift the different channels up or down octaves in order to have them occupy the same sort of range as they did in the original MIDI, as that&#x27;d probably end up with more listenable tunes. (Bass notes become screechy notes of death right now.)<p>So far, AutoMIDIFlip is the only automatic MIDI flipper I know of that preserves everything about the original song except for the note positions. In other words, if you flipped a tune twice, then removed the 6 extra empty MIDI tracks that AutoMIDIFlip would have added (3 per run, basically just attributing AutoMIDIFlip so that nobody just runs a MIDI file through it and calls it an original), you&#x27;d end up with exactly the same file, hash checksums and everything. There are only three exceptions to this rule:<p>* If the original source didn&#x27;t utilise MIDI&#x27;s &quot;running status&quot; feature (which simply acts to reduce the file size by removing redundant information - more info at <a href="http:&#x2F;&#x2F;www.midikits.net&#x2F;midi_analyser&#x2F;running_status.htm" rel="nofollow">http:&#x2F;&#x2F;www.midikits.net&#x2F;midi_analyser&#x2F;running_status.htm</a>), then the resulting file from AutoMIDIFlip will be smaller than the original. It&#x27;ll still contain exactly the same information, however.<p>* For Format 0 MIDI files, AutoMIDIFlip will output a Format 1 MIDI file so that it can insert the empty attribution tracks. These tracks do not contain anything, and AutoMIDIFlip won&#x27;t attempt to separate the file into tracks; you&#x27;ll still just have one track containing all the data.<p>* If for some reason the input MIDI file has more tracks than are indicated in the file header, those extra tracks will not appear in the output file. This scenario should basically never occur; if it does, there&#x27;s something wrong with whatever program generated the MIDI file.<p>I&#x27;m happy to answer any questions people might have!