Author Topic: TUTORIAL: How to put custom music in VVVVVV  (Read 17838 times)

allison

  • Captain
  • *****
  • Posts: 929
  • monolithic since 2012??
    • View Profile
    • Allison Fleischer
TUTORIAL: How to put custom music in VVVVVV
« on: January 17, 2016, 08:06:04 pm »
EDIT: Infoteddy recently put together a tutorial for adding multiple custom songs to VVVVVV: https://www.youtube.com/watch?v=VkD7Tkn1duc

The command he uses in the terminal to download the script is here for your copy and pasting pleasure:
Code: [Select]
wget http://78.72.124.73/fiq.zip
He glosses over a few things so I'd like to put together a tutorial here soon, but I figured I'd put this link here in the meantime.
If you'd prefer to use the old, somewhat simpler one-song method, read below.



Introduction
In VVVVVV 2.2, an asset modding feature was added that allows you to easily add custom tiles, sprites, and sound effects to your level. However, adding custom music is a bit trickier, because all of the game's music is stored in a single binary file. Unfortunately, people have only figured out how to replace one song: "Predestined Fate Remix", but this may change in the future.



Step 1: Set up your song file
VVVVVV only accepts music in the "Ogg Vorbis" file type, and music cannot have metadata (author, genre, etc). If your music already ends with the extension ".ogg" and lacks metadata you're all set. If not, there are programs online to convert your file to OGG and remove metadata.



Step 2: Get the binary file from VVVVVV's data
If you've modified tiles/sprites/sfx before, you probably already know how to do this. VVVVVV's data is stored in "data.zip", a compressed folder. data.zip is stored next to the executable in the Windows version. In the Mac version, it's stored in the app itself; right click and select "View Package Contents" to get at it. Decompress data.zip and copy vvvvvvmusic.vvv somewhere else.



Step 3: Open the file in a hex editor
The rest of the tutorial will involve working with a hex editor. Hex editors are used for directly editing a file's hex data, which is essentially an easier-to-read version of the binary code. There are a variety of hex editors available. My personal preference is Notepad++ with the hex editor plugin, but pretty much any hex editor will do. Hex editors look very intimidating (like you're staring into the Matrix!), but what we need to do is simple enough. Once you open the file, it should look something like this:





Step 4: Find the position of "Predestined Fate Remix" in the file
All 15 of the songs stored in this file are prefaced with the following string:
Code: [Select]
4F 67 67 53 00 02 00 00 00 00 00 00 00 00This is the Vorbis header, and it tells programs that a file is an OGG file. vvvvvvmusic.vvv is mostly comprised of a bunch of OGG files stuck together. Use your editor's Find function (generally opened with Ctrl+F, or Cmd+F on Mac) and paste that string:



Use it to highlight the last instance of the Vorbis header:





Step 5: Delete "Predestined Fate Remix" from the file
Highlight from the start of the Vorbis header all the way to the end of the file:



Remember, that last Vorbis header should be deleted too. Like this:





Step 6: Copy the music you want
Open the .ogg file you want to put into the game with the hex editor. This time, select the entire file (usually Ctrl+A will do this, or Cmd+A on Mac). Notice that the Vorbis header is present here too. Copy your selection to the clipboard (Ctrl+C, or Cmd+C on Mac).





Step 7: Paste the music into the binary file

Go to the very end of the vvvvvvmusic.vvv file and append your song data (Ctrl+V, or Cmd+V on Mac).





Step 8: Fix music looping

If your music is shorter than Predestined Fate Remix, you can safely skip this step. However, if your music is longer, it will loop back to the beginning prematurely in-game. Fortunately, it turns out there's a way to fix this. At the beginning of vvvvvvmusic, there's a list of each song in the game. Find these bytes:



And change them to FF FF FF:



These bytes seem to indicate how long a song is, and FF FF FF is the highest possible value, so changing it this way should make it loop correctly. If it still loops too early, then it's possible your song is simply too long for VVVVVV to load.



You should now have a working music file you can add to your VVVVVV folder in Documents! Trigger it in your level with music(15a).



Why doesn't replacing songs other than Predestined Fate Remix work?

Replacing other songs causes glitching: stuff like looping many songs in a row. I suspect this has something to do with the bytes in Step 8, so if someone smarter than me could figure out exactly how length is stored in these three bytes, it could become possible to have multiple custom songs.



If you have any comments or questions, be sure to reply to this thread!
« Last Edit: March 25, 2016, 09:19:58 pm by crazya02 »

moth 🦋

  • Captain
  • *****
  • Posts: 1561
  • Welcome to the MOTHER3 world
    • View Profile
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #1 on: January 17, 2016, 08:07:15 pm »
OH MY FREAKING GOD. YES.
« Last Edit: January 17, 2016, 08:41:23 pm by ShinyWolf07 »

Lollipop

  • Captain
  • *****
  • Posts: 422
  • fornite funnys
    • View Profile
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #2 on: January 17, 2016, 08:09:14 pm »
good job  :)

fraZ0R

  • Captain
  • *****
  • Posts: 579
  • Why are you here?
    • View Profile
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #3 on: January 17, 2016, 08:09:33 pm »
Does it work on make and play edition?

Warning - while you were typing a new reply has been posted. You may wish to review your post.

Lollipop

  • Captain
  • *****
  • Posts: 422
  • fornite funnys
    • View Profile
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #4 on: January 17, 2016, 08:09:54 pm »
Does it work on make and play edition?

Warning - while you were typing a new reply has been posted. You may wish to review your post.

most likely yes

fraZ0R

  • Captain
  • *****
  • Posts: 579
  • Why are you here?
    • View Profile
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #5 on: January 17, 2016, 08:11:19 pm »
I have no idea what the instructions mean...  :o

allison

  • Captain
  • *****
  • Posts: 929
  • monolithic since 2012??
    • View Profile
    • Allison Fleischer
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #6 on: January 17, 2016, 08:31:53 pm »
Does it work on make and play edition?
Yes.
I have no idea what the instructions mean...  :o
What specifically don't you understand?

Trinket4067

  • Guest
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #7 on: January 17, 2016, 08:35:42 pm »
I tried this, and VVVVVV refused to start  :victoria:

moth 🦋

  • Captain
  • *****
  • Posts: 1561
  • Welcome to the MOTHER3 world
    • View Profile
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #8 on: January 17, 2016, 08:41:05 pm »
 When I try copying the data of my song in notepad++, it freezes up. Why?
« Last Edit: January 17, 2016, 10:29:11 pm by ShinyWolf07 »

Ally 🌠

  • Captain
  • *****
  • Posts: 1419
  • <3
    • View Profile
    • Ally 🌠
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #9 on: January 17, 2016, 09:34:47 pm »

 When I try copying the data of my song in notepad++, it freezes up. Why?
its notepad++

Lollipop

  • Captain
  • *****
  • Posts: 422
  • fornite funnys
    • View Profile
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #10 on: January 17, 2016, 09:53:04 pm »

 When I try copying the data of my song in notepad++, it freezes up. Why?
its notepad++

use sublime or something

EDIT: Is there a simpler way to highlight all that?

EDIT: Nvm got it
« Last Edit: January 17, 2016, 10:02:13 pm by Lollipop »

allison

  • Captain
  • *****
  • Posts: 929
  • monolithic since 2012??
    • View Profile
    • Allison Fleischer
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #11 on: January 17, 2016, 10:06:19 pm »

 When I try copying the data of my song in notepad++, it freezes up. Why?
That never happened to me... I recommend using a different hex editor.

Lollipop

  • Captain
  • *****
  • Posts: 422
  • fornite funnys
    • View Profile
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #12 on: January 17, 2016, 10:13:43 pm »

 When I try copying the data of my song in notepad++, it freezes up. Why?

because there's too much text for notepad++ to handle

EDIT: speaking of which my laptop is so shitty it cant even load the file on sublime or notepad++
« Last Edit: January 17, 2016, 10:21:16 pm by Lollipop »

moth 🦋

  • Captain
  • *****
  • Posts: 1561
  • Welcome to the MOTHER3 world
    • View Profile
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #13 on: January 17, 2016, 10:29:34 pm »
Hey I got it working! Thanks for the tutorial. I used HxD.
« Last Edit: January 17, 2016, 10:32:11 pm by ShinyWolf07 »

Trinket4067

  • Guest
Re: TUTORIAL: How to put custom music in VVVVVV
« Reply #14 on: January 17, 2016, 11:00:59 pm »
It doesn't work. The music just doesn't play! WHYYYYYY?  :victoria: