Skip to content

Creating Custom Music for your Board

nikkiwritescode edited this page Jan 30, 2024 · 22 revisions

Table of Contents

Prerequisites

This guide uses Audacity, which can be downloaded for all platforms at https://www.audacityteam.org/download However, we split by Operating System at the .brstm level. This is because Windows users can use a nice GUI method, whereas Mac and Linux users have to get their hands dirty with the command-line. This guide covers both scenarios, so grab whichever file is relevant to your setup.

Note

The OpenRevolution team has stated that they plan to one day have a GUI frontend, so this guide may eventually be able to be re-written to use it on all platforms.

Getting Started

Custom music is an important aspect in making new boards and backgrounds feel new. In the original game, arcade, auction, stockbroker, and venture card music tracks were global, but CSMM has now enabled these (and many other) music tracks to be set on a per-board or per-background basis. CSMM also now allows a single board to use multiple varying tracks for different switch states! Therefore, you can now set many tracks for a single board if you want to. Though this guide focuses largely on the creation of a single track, we list the various different tracks that are possible to set in your board's descriptor file in the Descriptor Music Key Reference section below.

Warning

Please be mindful of music copyright when creating music for your board. Distributing licensed music is a no-no, so please refrain from doing so. Irrespective of legality, people who want to stream to platforms like Twitch will not appreciate having sections of their VODs muted because you used a copyrighted song. So please keep this in mind when configuring music for your board.

Working with Music in Audacity

The steps to import, convert, trim, and implement music into your board bundle are listed in this guide, but we begin by conceptualizing the workflow. This is the 40,000ft overview that familiarizes you with how it works more generally. Many people find that this helps them understand more easily, but if you just want to get to the technical stuff, you're welcome to skip straight to the next section, Importing a Track to Audacity.

Conceptualizing the workflow

We are going to perform the following steps in this section:

Task Purpose
Import a track to Audacity The start of the workflow.
Normalize the track's volume Ensure volume levels do not differ dramatically between songs.
Trim the song We're only going to loop a small portion, so it is helpful to begin by narrowing our scope.
Find the sample at the end of the loop This way, the end of the loop is always the end of the file. Efficiency at its finest.
Delete everything after Loop End When the loop ends, it restarts. So there is no reason to have any music data after this point.
Find the sample at the start of the loop By having the start of the loop be further into the song, you can have an intro that plays only once.

To be clear -- we will be cutting out everything after the loop, so the only "loop point" we will have will be the start of the loop. This is partially why I wanted to conceptualize it here -- some programs, including BrawlCrate, allow you to pass in a Loop End sample number. If you have traditionally thought about your editing that way, then this will be a little bit of a shift for you conceptually. But it will not result in a large shift in your workflow overall.

Note

When a program allows you to pass in a Loop End sample number, it's doing what we're doing here behind the scenes -- taking that sample number and deleting everything after it.

Importing a track

Let's finally get to creating a track! For this guide, I'll use a personal favorite of mine. If you want to follow this guide in a 1:1 fashion, grab Rigil Kent System from the Star Cruiser for Sharp X68000 soundtrack over at KHInsider. Otherwise, you are welcome to use whatever music you would like, being sure to follow this guide only generally as specifics pertaining to the song will not apply to you.

Save the song somewhere (.flac and .mp3 files are both fine), then open it in Audacity. If you're trying to open it from within Audacity, you'll need to go to File > Import > Audio.

Tip

Notice how the counters at the bottom of your Audacity window have arrows next to them. These arrows allow you to change how they display time. This means you can change them all to samples if you'd like to work natively in the unit of measurement that BrawlCrate and OpenRevolution do.

Normalizing volume levels

Press Ctrl + A to select the entirety of the waveform, then go to Effect > Normalize and set Normalize peak amplitude to 0.0 dB, then click OK. Screenshot of the Normalize panel

Trimming the song

Now that the track is imported, we're ready to start trimming our song. Select All with Ctrl + A, and click Play. Listen to the first two minutes of the track and think about how this would sound looped. For a small challenge, see if you can pinpoint the approximate time when this song repeats before reading to the next section! You probably can. I give you the answer in just a second, but being able to do this is the first step.

Tip

Keyboard and mouse users can zoom by holding Ctrl and using the scroll wheel to zoom in and out.

Mac OS trackpad users can use gestures in Audacity, and pinch-and-zoom will zoom in and out. Two-finger swiping can navigate the track by time, but be sure the mouse is hovered over the track and not one of the toolbars, otherwise your gestures may apply to it instead.

The song repeats right around 1:49. But, in order to make our music loop nicely, we need to be a little more specific with that. Zoom back out, and click a second or two after 1:49, then press Shift + J to select the area from the start of the track to your cursor. Now, press the following shortcuts in order:

  • Ctrl + X (Cut)
  • Ctrl + A (Select All)
  • Ctrl + V (Paste)

image This should more-or-less crop the song to the relevant portion so we can get more specific with our loop.

Finding the end of the loop

Zoom in toward the end of the song, and try to find the exact sample where the song loops. This song makes it pretty obvious, but if you need the answer, it you can see around where it is in the following screenshot:

image

Once you are satisfied that you've found it, press Shift + K to select the region between your cursor and the end of the track, and press DELETE on your keyboard to get rid of it.

Finding the start of the loop

Now, zoom in and scroll toward the beginning of the song. This song doesn't have an intro, so we just want to get the sample where the music actually begins. If your song has an intro, you would do more-or-less the same thing you did in the last section here, but you find the start of the loop instead. Only this time, we're not deleting anything.

Tip

You can actually speed up the process of navigating to the start or end of the track by pressing the HOME or END keys to snap to the front or the end of the song.

Since Macs do not ship with full-sized keyboards, Mac OS users can use the following shortcuts:

shortcut command
⌘ + ← HOME
⌘ + → END

Fn can be used instead of ⌘, if you prefer it. These are actually global bindings for Macs; any application that needs these buttons on Mac OS will use these bindings! The more you know!

When you have found the sample you're looking for, take note of its sample number, and copy or type it somewhere. We will need it in the next section when we load the song into BrawlCrate or OpenRevolution. If you are following this guide verbatim and need help with this part, the answer is 479 as shown in the following screenshot:

image

Once your sample number has been stored somewhere, press Shift + K to select everything between the cursor and the end of the song. With this selected, you can hear your loop by playing in Looping mode with Shift + Space.

Exporting to .wav format

When you're ready, go to File > Export Audio. Make sure Format is set to WAV (Microsoft), and set Sample Rate to 32000kHz. If you are following this guide verbatim, save the file somewhere with the filename rigil_kent.wav. Otherwise, name the file however you please and click OK on the metadata screen -- metadata does not matter for our purposes.

Important

Please set your music to 32000kHz to help us keep download times short.

Now, move onto the next section.

Conversion to .brstm with BrawlCrate

Creating the .brstm file

Create a new .brstm file by going to File > New > BRSTM Audio Stream.

image

This option will open an Open File dialog. Find and open the .WAV file you just exported.

Setting the loop keyframes

On this screen, our objective will be to configure a seamless loop that will play forever without being obvious to the player that it is looping. This is simple enough: try to set the start and end keyframes to the same beat on either side. Once they are lined up well enough, the loop will be ready to save and load into Fortune Street. The below is an overview of the BrawlCrate music window:

image

Thankfully, we've done this part in Audacity already. You should have a single value -- place that in the Loop Start box. Set Loop End to the very end of the song. If you are following this guide verbatim, the loop value of sample 479 will provide the seamless loop that we are looking for.

Check the Loop box in the lower-left corner, then move the playback marker somewhere between the start and end values. Click Play, and you can test the loop for yourself. Click Okay when you are satisfied with the result!

Important

The screenshot above shows a frequency of 48000kHz, but please do not do this -- please set your music to 32000kHz to help us keep download times short.

Conversion to .brstm with OpenRevolution

Building OpenRevolution

This is honestly easier than it sounds, but you will need to get your hands dirty with the Terminal. To set up OpenRevolution:

  • Open the Terminal of your choice. On Mac, you can simply press ⌘ + Space and type Terminal, then press enter.
  • Clone the OpenRevolution GitHub repository by pasting in git clone [email protected]:ic-scm/openrevolution.git and pressing enter.
  • Type cd openrevolution to enter the repository.
  • Type ./build.sh to build OpenRevolution.

From here you can use OpenRevolution commands in your Terminal.

Tip

You might want to move this folder somewhere you'll be able to keep track of it, then open a new Terminal in that location. This way, you won't have to reconfigure OpenRevolution when you want to make music in the future! It's out of scope for this guide, but if you add this directory to your system's PATH, you'll be able to call brstm_converter from anywhere, not just its directory.

Converting your music to .brstm

With your terminal in the same path as the previous step, perform the following steps:

  • Type ./brstm_converter followed by a space.
  • Drag the .wav file you exported into the Terminal
  • Type a space, followed by -o followed by another space.
  • Drag the exported .wav file into the Terminal again, but this time change the extension on it to .brstm.
  • Type another space, followed by the looping flag -l, followed by one more space.
  • Finally, type loop point sample number you stored back in Finding the sample at the start of the loop. If you are using the same file as in the example, this value will be 479.

In all, your command should look something like this:

./brstm_converter /path/to/file/rigil_kent.wav -o /path/to/file/rigil_kent.brstm -l 479

This command will take your input .wav file and export it to a .brstm file next to where your .wav file is saved.

Note

The above command specifies the loop flag -l 479. If your music is a track that is not intended to loop (such as a Take-A-Break theme), be sure to omit this.

Testing your .brstm file

So how do we test that this file sounds OK and is looping correctly on Mac and Linux? It turns out, there is a web-based .brstm player called Nikku that can help us with this.

Go to the Nikku .brstm player page (https://kenrick95.github.io/nikku/) and upload your new .brstm file. How does it sound? Does it work? Does it loop correctly? Even if things are slightly off, you now have the skills necessary to go back and fix them!

Adding Music to your Descriptor File

Now that you have a .brstm music file, it's time to add it to your board's descriptor file. Thankfully, this is really easy! The file in the previous sections of the guide was intended to be a map theme, so the last thing we need to do before we can add it to our descriptor file is set its volume.

Setting the volume

While the .brstm format does support setting volume, CSMM actually takes this information from the .brstm filename. You may not know what volume your music should be set to at first and that's OK -- if this is the case, just use 80. Add the volume to your filename by renaming rigil_kent.brstm to rigil_kent.80.brstm.

Adding it to the descriptor

Take the above filename, minus the .brstm file extension and add it to your descriptor like so, adding the music and map keys if they are not already present:

music:
  map: rigil_kent.80

Important

Note that this entry does NOT include the .brstm file extension!

Separate themes for each switch state

If you want to set a different theme for each board state, you can do so using the .yaml array syntax:

music:
  map:
    - rigil_kent.80
    - some_other_song.75
    - ...etc

There are a plethora of different keys you can set music for, too. Please see the next section, Descriptor Music Key Reference, for more details.

Descriptor Music Key Reference

The keys you can specify in your descriptor file are as follows:

Key Type What is it?
download single or list The music archive download link(s).
map single or list The main board BGMs. If specified as a list, the themes will represent each switch state.
auction single Plays during Auctions.
badVentureCard single Plays when venture cards 13 and 103 are drawn.
bankruptcy single Plays when a player becomes bankrupt.
dartOfGold single Plays during Dart of Gold.
domination single Plays when a player purchases all shops in a district.
forcedBuyout single Plays when a player forcibly buys another player's shop. Also plays for venture cards 65, 79, 98.
guestAppear single Plays when a guest (Goodybag, Healslime, or Lakitu) arrives.
guestLeave single Plays when a guest (Goodybag, Healslime, or Lakitu) leaves.
memoryBlock single Plays during Memory Block.
promotionMario single Plays when a Mario-based character gets a promotion.
promotionDragonQuest single Plays when a Dragon Quest-based character gets a promotion.
promotionMii single Plays when a Mii-based character gets a promotion.
roundTheBlocks single Plays during Round the Blocks.
roundTheBlocks777 single Plays when a player wins at least one row of 777s in Round the Blocks.
roundTheBlocksWin single Plays when the player wins a non-jackpot prize in Round the Blocks.
slurpodromeRace single Plays during the Slurpodrome race.
slurpodromeSelect single Plays while players are able to select their Slimes in Slurpodrome.
slurpodromeStart single The starting fanfare of the race in Slurpodrome. Plays between Select and Race.
slurpodromeWin single Plays at the end of the Slurpodrome Race, regardless of who wins.
stock single The stockbroker theme. Plays on the Buy/Sell stock screen.
takeAbreak single The Take-A-Break theme. Plays when a player lands on a Take-A-Break square or pulls cards 9 or 34.
targetMet single Plays when a player has reached the Target Amount, but has not yet returned to the bank.
ventureCards single Plays while the Venture Card Selection screen is activated.
win single The game's ending fanfare. Plays both during the congratulations screen and the statistics screens that follow.

Keys marked as type single can only ever accept a single value, whereas keys that can also be a list can accept multiple values using the .yaml array syntax.

music:
  download:
    - https://nikkums.io/cswt/BGM/WiiU.music.zip
    - https://drive.google.com/u/0/uc?id=1k1fRXR2gTyD35G93W3bANxKB4UTQv__6&export=download&confirm=1

Next Steps

If you need help with anything, feel free to reach out! The best place to reach out is on Discord: there are several active communities that can help with the various aspects of mod-making.