Working With Data


Machine Learning. Artificial Intelligence.

Video Game Music Generator


Each button generates an original music file in the style of that game. For details look below.

FFVII

FFVII Track List
Midi Source
  • FF7AC-AerisTheme.mid
  • FF7AC-Sign.mid
  • FF7AC-ThoseWhoFight.mid
  • FF7AC-TifasTheme.mid
  • FF7-AerisTheme.mid
  • FF7-AnxiousHeart.mid
  • FF7-BarretsTheme.mid
  • FF7-BattleTheme2Pianos.mid
  • FF7-ChasingBlackCapedMan.mid
  • FF7-Debut.mid
  • FF7-HoldingThoughtsInMyHeart.mid
  • FF7-InterruptedByFireworks.mid
  • FF7-JenovaReunion2Pianos.mid
  • FF7-OtherSideOfTheMountain.mid
  • FF7-RedXIII.mid
  • FF7-SephirothsTheme.mid
  • FF7-TifaRemembers.mid
  • FF7-VincentsTheme.mid
  • FF7-WorldThemePC.mid

Ocarina of Time

OoT Track List
Midi Source (Magnet link)
  • Achievement!.mid
  • BoleroofFire.mid
  • BossBattle.mid
  • EndingTheme.mid
  • EscapeFromGanonsCastle.mid
  • EscapeFromLonLonRanch.mid
  • FairyFlying.mid
  • FinalBattleAgainstGanon.mid
  • ForestTemple.mid
  • GameOver.mid
  • GanondorfBattle.mid
  • GanonsTower.mid
  • GerudoValley.mid
  • GoronCity.mid
  • GreatFairyFountain.mid
  • HorseRace.mid
  • House.mid
  • HyruleCastleCourtyard.mid
  • HyruleField.mid
  • IceCavern.mid
  • JabuJabusBelly.mid
  • KaeporaGaeborasTheme.mid
  • KakarikoVillage.mid
  • KokiriForest.mid
  • Kotake&KoumesTheme.mid
  • LakesideLaboratory.mid
  • LonLonRanch.mid
  • LostWoods.mid
  • Market.mid
  • MasterSword.mid
  • MedalGetFanfare.mid
  • MinuetofForest.mid
  • NewOcarinaMelody.mid
  • NocturneofShadow.mid
  • OpenDoorofTime.mid
  • OpenTreasureChest.mid
  • PreludeofLight.mid
  • RequiemofSpirit.mid
  • Riddle_of_Doom.mid
  • SerenadeofWater.mid
  • SheiksTheme.mid
  • ShootingGallery.mid
  • Shop.mid
  • SongofStorms.mid
  • SongofTime.mid
  • SpiritTemple.mid
  • TempleofTime.mid
  • TheGreatDekuTree.mid
  • TitleScreen.mid
  • ZeldasTheme.mid
  • ZorasDomain.mid

Super Mario

Mario Track List
Midi Source (Magnet link)
  • Airships.mid
  • Athletic2.mid
  • Athletic.mid
  • Bonus.mid
  • Boss.mid
  • BowserBattle.mid
  • Bowser.mid
  • CourseClearFanfare.mid
  • Death.mid
  • Ending.mid
  • EndingTheme.mid
  • ForestofIllusion.mid
  • GameOver.mid
  • GhostHouse.mid
  • HammerBros.mid
  • KoopaKids.mid
  • MushroomHouse.mid
  • Overworld2.mid
  • Overworld.mid
  • PrincessPeachisRescued.mid
  • Secret.mid
  • StarRoad.mid
  • SubCastle.mid
  • Swimming.mid
  • TitleScreen.mid
  • Underwater.mid
  • ValleyofBowser.mid
  • VanillaDome.mid
  • World1GrassLand.mid
  • World2KoopahariDesert.mid
  • World3SeaSide.mid
  • World4BigIsland.mid
  • World5SkyLand-Ground.mid
  • World5SkyLand-Sky.mid
  • World6IceLand.mid
  • World7PipeMaze.mid
  • World8DarkLand.mid
  • WorldClear.mid
  • WorldMap.mid
  • YoshisIsland.mid

Unlike other types of music files, midi files don't contain a representation of the waveforms of the sounds, but the notes that an instrument would play. Given a set of midi files with only piano tracks, the model takes in 100 notes and tries to guess what the next note is. After countless iterations of guessing and checking, the model starts doing a fair job of guessing what comes next. To generate it's own music, you can start the model off with some notes, let it guess the next note, feed that note back into the model, starting the process that will let the model to go off and create it's own score.

The model is a type of neural network. It takes inputs, in our case a series of notes, and performs layers of transformations until it comes out with a single output note. The parameters of the transformations start off randomized, and if the output is incorrect, the parameters are adjusted to try and get the correct output. These adjustments are how the model is trained.

About Back Propagation ⇓

The process in which the parameters are adjusted is called back propagation. In back propagation the error between the desired output and actual output is used to change the parameters of the layer above the output. How much the parameter changes is calculated in a process called gradient descent. The change is taken as the error in that layer, and is used similarly to change the parameters of the layer above that. This way the changes move up the layers all the way back to the input, in other words the errors propagate back through the whole model.

About LSTMs ⇓

Since we are dealing with music, the notes played in the past have a strong influence on the next note played. This makes it necessary for the model to have some kind of memory. This model has memory in the form of Long Short Term Memory (LSTM) layers. During model training, the LSTM layer tunes a forget gate an remember gate as it learns which past notes are most relevant to the future. In this way longer term patterns in the music can be remembered, rather than just what is in the immediate past.

There are several points where the model can be further developed.

Note spacing is not variable. The training data had a commonly used spacing, so the all of the output used that spacing rather than learn what the spacing should be. To implement this, a larger model would be needed to learn these timings.

There is no sense of the beginning or end of the song. The songs the model is trained on is treated as if it is one long song it is trying to learn instead of separate tracks. So when a song is generated, there is a sharp cutoff rather a planned ending. A way to deal with this might be to encode the start and end of a song as a type of note itself.

The generator only makes piano music. To generate a full orchestra the proper training data is needed and would need a larger network to deal with so many instruments.

The models are currently trained on the music of a single game. It might perform better if it was rather categorized by the use case of the music, i.e battle music, menu screen music.

You can find my code here. The base code I modified came from here.

GPT-2 Text Generator (Disabled)


A demonstration of OpenAI's GPT-2 text generator. Given a starting prompt, the generator will create about a hundred more words of text.



About Me


I am an Electrical Engineer by training, Computer Vision Researcher by vocation.

Get In Touch