Author Topic: How to make a custom loop for use in game modding and theme creation.  (Read 5081 times)

Offline Lolcat

  • End User
  • *
  • Posts: 2
    • View Profile
Thanks to some people from the discord I now have a better understanding of how to use the feature. I was able to make a song play from it's start and then loop from a specific point, let me walk you through how I did it.

The first thing you'd want to do is to set your project rate to 44100 in a program like audacity and set Audio Position at the bottom to samples by pressing the small arrow on the right. Next I'd advise you amplify the song negatively (Effects / Amplify in Audacity) so you'll be able to hear system sound effects. 

An example wav ripped from the Disgaea 4 Vita theme is attached to the post so you can get an idea of the volume you should tune your song to.

Find 2 points in the song you would like to loop from. Ideally it should be a repeating segment or melody which is why video game music is a good choice. Smash Custom Music Archive has a lot of music that you can download as a wav and even get the start and end samples for the loop.

Once you've found your two points I suggest you type down the sample for the start of the loop and for the end of the loop in notepad for example. Select a portion of the first loop and copy it then paste that portion at the end of the loop so you can hear if your loop sounds seamless enough. Once you're happy, export it as a signed 16bit wav called BGM.wav and if it's from an album of some kind make sure you clear the metadata.

Next, open the command prompt in the folder where at9tool is located (Download it yourself, it's not hard to find) and paste:
Code: [Select]
at9tool -e -br 144 -loop (Start Sample Here) (End Sample Here minus 1 from the end) BGM.wav BGM.at9
For example with the song I'm using now I entered:
Code: [Select]
at9tool -e -br 144 -loop 1076417 6120652 BGM.wav BGM.at9 For some reason I wasn't able to get it working unless I subtracted 1 from the end sample, so 6120652 became 6120651. I think this is because it can't handle a loop at the end of a file.

With a 23,909KB wav file a 2,441KB at9 file was produced, meaning you can use really high quality audio but I'm not sure how long the duration can be without something breaking so I'd recommend keeping it below 5 minutes. It will be downsampled to 144kbps, which is CD quality and should sound fine on the Vita's speakers.

I hope this tutorial helped you, if you have any questions I'm not sure I'll be able to help.
« Last Edit: June 24, 2020, 05:46:00 PM by Lolcat »