Git Product home page Git Product logo

midiflip's Introduction

MidiFlip

Transform MIDI songs to create mathematical remixes. Inspired by Andrew Huang's #MidiFlip "challenge".

MidiFlip can be used to simply flip notes around, inverting all the pitches, but it also gives you raw control over the notes in a simple way so you can make arbitrary remappings.

Try MidiFlip online. You can batch convert files and download the results as a zip file. (The files are not uploaded to a server.)

The web interface supports everything the CLI does (and actually more at the moment).

Future Direction

It would be good to be able to look at the original song as a whole in order to transpose notes back to reasonable ranges like Automatic MIDI Inverter does, or do fancier stuff like finding the scale used and mapping it to another. (You can only look at and change a single note at a time with the current API.)

MidiFlip could also let you deal in time, reversing a song or changing the tempo, altering the duration of notes, humanizing or quantizing, stuff like that.

It would probably make sense to have two levels of configuration, one where you just define a mapping, and that could be visualized, and one where you just write code to modify the MIDI. Either way the results could be visualized, with an embedded MIDI player.

Could handle inverting pitch bends and portamenti like AutoMIDIFlip does. This would be optional, since you can specify transformations such as simple transpositions.

CLI Installation

Install Node.js if you haven't already. Then open a terminal/command prompt and run npm install midiflip -g

You should now have access to the midiflip command.

CLI Usage

Go to where you have some MIDI files stored, such as your music folder, i.e. on Windows cd %UserProfile%\Music and on probably most other operating systems, just cd ~/Music

Flip a single file:

midiflip -i "midis/Danger.mid" -o "transformed/Danger.mid"

Flip a bunch of files:

midiflip -i "midis/**/*.mid" -o "transformed/"

This uses glob. ** means zero or more (sub)directories, so this will match e.g. midis/1.mid as well as midis/Avgvst/FreeRide.mid. It will output the transformed files to the given output directory, creating matching subdirectories, but stripping off anything before the first *, so you'll get e.g. transformed/Avgvst/FreeRide.mid rather than transformed/midis/Avgvst/FreeRide.mid

Purposefully mess with percussion

Add -p or --percussion to apply the same transformation to percussion as to other notes, which doesn't make the semantic sense that applying it to pitch does.

License (MIT)

Copyright 2017 Isaiah Odhner

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

midiflip's People

Contributors

1j01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

midiflip's Issues

Add option to keep approximate note range

"It would be good to be able to look at the original song as a whole in order to transpose notes back to reasonable ranges like Automatic MIDI Inverter does... (You can only look at and change a single note at a time with the current API.)"

I don't know how easy this would be, but I would do it this way:

  1. Keep track of the highest/lowest note in a channel as they are processed
  2. Calculate which octave would be closest.
  3. Go through again and transpose it to the closest octave.

This way, not much needs to be changed (it just needs another pass). And then of course another command line option for that (it wouldn't affect percussion).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.