# Super-quick MIDI generator with nonrestrictive license? [closed]

I'm working on my Ludum Dare entry and trying to figure out how in the world I'm ever going to get background music. I found WolframTones, but the license is too restrictive:

Unless otherwise specified, this Site and content presented on this Site are for your personal and noncommercial use. You may not modify, copy, distribute, transmit, display, perform, reproduce, publish, license, create derivative works from, transfer, or sell any information or content obtained from this Site. For commercial and other uses, contact us.

But I really like the interface! It's a lot like sfxr - click a genre and download a song. That's so cool. Is there another program that does this same sort of thing but without a restrictive license, so that I can generate a bgm and use it in my game?

• A few ludum dares ago someone passed around a self made python script that did just this, I'll go and hunt. May 25, 2013 at 12:24
• github.com/wibblymat/ld24/blob/master/autotracker.py May 25, 2013 at 12:28

A ancient one exist, called "Melody Raiser"

unfortunately I have no idea of where to find it (my copy is fan translated to portuguese, and probably pirated... I have no idea what was the license of the original software, I never found it... also probably the original software is japanese).

But if I remember well, it was quite popular in RPG Maker communities.

Also, its music is not the best one around... It is easy to tweak it though...

• Interesting. A bit of searching brought it up (look for "melr1999.exe" but be careful of viruses, I ran my copy in a sandbox because it supposedly had a trojan). In fact it's actually a Portuguese program, not fan-translated, and was freeware. Unfortunately it only generates four measures though, a perfect recipe for the most annoying background music ever. :) Aug 22, 2010 at 22:21
• Your version probably is better translated then :P I think that it is fan translated from japanese, because there are in the same style also "Wave Raiser" (and my version is english, and some strings empty), and the "Melody Raiser" have japanese characters to edit the music. Aug 23, 2010 at 2:39

For tools that generate random music for games, this ludum dare post provides a comprehensive list with good options. My personal favorites on that list are autotracker.py and CGMusic. Autotracker produces great music for retro/8-bit style games, though it lacks a proper user interface. CGMusic has a good UI, good customization, and creates complex piano songs.

I also know of 2 free music creation tools that allow you to manually create your own songs. Pxtone and musagi both are good for anyone familiar with music theory or experienced with making music. Be aware that since pxtone is a japanese program, it will need to be downloaded from a google-translated website and then set to English mode (which is easy to do).

WolframTones output is easy to modify to the point of unrecognizability, at which point even the best attorneys would experience some difficulty in collecting royalties. I see nothing in there about "derivative works".

Also, google "generative music" and "algorithmic composition".

• You may not modify Well, modifying to make it unrecognizable would be cheating, wouldn't it? Mar 24, 2012 at 17:01
• Our friend wikipedia "en.wikipedia.org/wiki/…" says "if the later work embodies a substantial amount of protected expression taken from the earlier, underlying work". So, to me, I have just enough music theory to change the original midi to exceed the standard. Again, just me, but that means I can use whatever I get out of it. Mar 25, 2012 at 17:28
• If there is no limitation with derivative works, then you are good to go; but if the music is remotely similar to the original; that's just a ton of troubles waiting to happen. Apr 16, 2016 at 1:28

Try this https://raw.github.com/wibblymat/ld24/master/autotracker.py A short python script that uses MIDI to generate some random music and save to a file.

There was a software called Band in a box; which was doing mostly what you ask.

You could set parameters, and it would generate a correctly balanced melody.

While this works fine from the algorithmic perspective, and it does sound right, due to the musical rules; they are mostly boring and lack of any sort of brilliance. Usable as BGM probably; but mostly they were used to give inspiration and build on top of it, creating something very unique.

If you have time, I would suggest to spend some time with loops; can't get easier than that, but you make something out of your liking, instead than randomly get a melody, until you like one.

DryWetMIDI is a .NET library I created which has features to build musical compositions based on MIDI (see Pattern page of the library Wiki), so you can use it to program music in any way you desire.

For example, to generate the MIDI file with following properties:

• all MIDI notes;
• each note lasts 1 second;
• there is a pause with length of 1/8 after each note;
• tempo is 105 BPM;
• 'Church Organ' instrument of General MIDI is used;

you can write this code:

var patternBuilder = new PatternBuilder()
.SetNoteLength(new MetricTimeSpan(0, 0, 1))
.SetProgram(GeneralMidiProgram.ChurchOrgan);

for (var noteNumber = 0; noteNumber <= SevenBitNumber.MaxValue; noteNumber++)
{
patternBuilder
.Note(Melanchall.DryWetMidi.MusicTheory.Note.Get((SevenBitNumber)noteNumber))
.StepForward(MusicalTimeSpan.Eighth);
}

var tempoMap = TempoMap.Create(Tempo.FromBeatsPerMinute(105));
var pattern = patternBuilder.Build();
var midiFile = pattern.ToFile(tempoMap);
midiFile.Write("Generated music.mid", overwriteFile: true);