Our initially selected song: Pixelland, by Kevin Macleod, was our original inspiration for the tone of Triage. However, we wanted to apply our own take on his song (and add our own personal touch), so we elected to create our own music for the game instead.
Creating Audio in Garageband
Garageband is a music creation app for MacOS by Apple. Free with all Apple phones and computers, Garageband allows its users to play their own tracks, or combine samples to create songs.
To start, create a new Empty Project from the splash screen. Click “Choose” to open it.
Adding Samples and creating music
For this song, I want to combine a simple array of samples to make a nice loopable tune. Click on the loop symbol (left) in the top-right corner of the screen.
When selecting Samples, I set the mood to cheerful, and browsed through the suggestions. For percussion, I need a beat and a topper as well as some bass for the trunk of the song, and some extra instruments to spice it up. Just drag the samples into the timeline to add them, and position them where you like:
Try to find ones with matching names (which tend to be made for each other). I used the Distorted Rumble Beat, combined with the Static Electricity Topper, as well as the Cuban Timba Bass and Above and Beyond Synth, but select whichever songs suit your taste and applications.
Conveniently, samples are designed to be loopable, so there’s no need to perform any changes before getting the song into Unity. Drag the top-right end of a track to loop it.
For this song, because I prefer something that’s a little punchier, I used the electronic modifier to select the beat, but kept everything else cheerful.
If a particular tune is too slow, you can adjust the speed in the top-middle menu bar. I sped up the BPM to 160 to add to the pace and upbeat feel to suit my design intent:
Add the four types of samples together until you have something you prefer. Don’t be afraid to mix things up to get something interesting!
You may find that the default 8 bars of music isn’t enough for your needs, like it is for mine. Most songs are much longer with peaks and troughs in between, so feel free to make your songs as short or long as you prefer!
Exporting the song
Click on “Share”, and then “Export song to disk”, Give it a name, tag and location, and specify your export type and quality. Click export and your song will export to your destination.
Preparing the Audio For Use In a Scene
Creating an AudioSource
AudioSources provide virtual “speakers” for audio in a game. Add one in a scene by right-slicking on the Heirarchy and navigating Audio -> AudioSource. Position it around the origin, and as long as the AudioSource’s 3D Sound component is disabled, it won’t matter where you place it.
Adding an AudioClip, Looping and Playing on Start
AudioSource’s components come with an AudioClip input by default. By dragging an AudioClip onto it, it will be the only sound the clip will play by that object. Check “Play on Awake” and “Loop” to play the music when the scene begins, and loop it constantly while the scene is active