3 ms·
Write a program to convert torrent files into midi files. They should be normal midi files that will play music, but can be run through midi2torrent to get your
by chaosmachine 17y ago
Write a program to convert torrent files into midi files. They should be normal midi files that will play music, but can be run through midi2torrent to get your original torrent back.
The idea being that you now have unique pieces of music you can host anywhere, rather than scary torrent files.
PS: If anyone does this, let me know :)
- zeckalpha 17y agoTo clarify, the .torrent, not the file that is found by feeding the .torrent into a client. Correct? One could simply change the extension.
- chaosmachine 17y agoChanging the extension is too easy. The .torrent file should be converted into an actual midi file, with correct headers, etc. It should actually play when you open it with quicktime or windows media player. When converted, the result should be a unique piece of music. Perhaps something that could be considered "art", and protected by free speech laws. Imagine printing out the score and having an orchestra perform the torrent file! The key, though, is that you can also convert the midi back into a usable torrent.
- mr_dbr 17y agoI present to you, Ubuntu in D Minor: http://www.mediafire.com/?sharekey=bc9a7de093071754ed24a2875c7fa58ee04e75f6e8ebb871 http://www.mediafire.com/?sharekey=bc9a7de093071754ed24a2875... ...it's not actually in D Minor, but it's certainly Ubuntu (ubuntu-9.04-desktop-i386.iso.torrent, converted to a proper, listenable MIDI file) Only done the encoding just now.. Basically the code loops over each byte in the file, ord()'s it, creates a note with that value and advances to the next beat.. Decoding should be simple enough, but the simple MIDI library I was using only creates MIDI files. One slight problem is the file is about 5-6 hours long, so I don't think we'll be sharing torrents via background music on Youtube videos quite yet.. A more time-efficient way to pack the bytes into notes is definitely possible (currently it only plays one note per time-slot), but that would have taken far longer than I wanted to spend on this... The Python code, including the required smidi.py module: http://gist.github.com/202593 http://gist.github.com/202593