How to make .brr samples
In-depht tutorial by Wakana
I made a tutorial which already gives the lineguides for how to convert a generic audio format to .brr HERE, but in this thread, we're gonna go more in the detail, analyzing all the tools needed whenever you want to approach to .brr and, in particular, to our .brr section.
I'll explain three methods. All three are pretty good whenever you wish going, in particular, for a full sample set. I remind you that it's not mandatory for our .brr section to always include all the samples from a game, but it's also true that people would appreciate full submissions more.
Before starting, I must thank the following people for supporting and helping me during the making of this tutorial:
Gradients names, and many thank you to both!
TABLE OF CONTENTS
- .BRR PLAYER - EVERYTHING TO KNOW ABOUT IT
- RIPPING SAMPLES FROM A SNES GAME (METHOD 1 - SPLIT700)
- RIPPING SAMPLES FROM A SNES GAME (METHOD 2 - SPCTOMML)
- RIPPING SAMPLES FROM A .SF2
.BRR PLAYER - EVERYTHING TO KNOW ABOUT IT
- .brr player
The .brr player is a wonderful tool created by Vitor Vilela, which lets you hear .brr files on the fly.
It has various functionalities. I'm going to show you what you can do with it.
Aside from the very obvious fields here, the ones where we focus on are the ones appearing where "Direct" is written.
The fields which are interesting for us, are the following:
- ADSR: lets you edit the ADSR of your song in real time. To convert what you set in each value (Attack, Decay, Sustain, Relase) to $ED$XY$ZQ format, you can use AMK's readme: go in "Hex Commands Reference" and scroll down until you see "ADSR", followed by a table and a graph. The table is interactive: depending on what you click on it for each field, the $ED$XY$ZQ will change accordingly.
- Direct: also known as GAIN. It's the value you write in $ED$80$XX, in case you don't want to use ADSR.
Another great functionality, a thing which is really appreciated if done in your future .brr samples submissions, is the following: THE !PATTERNS.TXT
Imagine you have a folder with many samples inside it. If you create a .txt file called !pattern, and you input some informations inside it, you can make .brr files play on a certain pitch, a certain volume and a certain ADSR/GAIN!
What's its format, you may ask.
The format to follow is:
"NAME OF THE BRR.brr (format is optional)" $AA $BB $CC $DD $EE $FF $GG $HH
- Up to $EE it's the same as what you'd write in #instruments. So $AA is the first ADSR value, $BB the second one, $CC the GAIN (if $AA and $BB are 00), $DD $EE is tuning.
- $FF is the played note, in hex. A table of notes in hex can be seen in AMK's readme file. I personally set this to $A4, which is o4 c.
- $GG $HH are volumes. $GG is left speaker, $HH is right speaker.
- "Pattern Load Error: Unexpected end of line at line XX": you wrote all the bytes without spaces, as in, $AA$BB$CC$DD$EE$FF$GG$HH. Each byte must be separated from the other with a space.
- "Pattern Load Error: Expected """ at line XXX": you missed the "" which should contain the name of the .brr file.
That's all you need to know!
Consider making a !patterns whenever you submit a .brr file, since it makes everything comfier for both moderators and for whoever thinks about using it.
Back to Table of Contents
RIPPING SAMPLES FROM A SNES GAME - USING SPLIT700
- SPC700 Player
- Split 700
We now approach how to rip the samples of a whole snes game.
Before you question it, no, you don't need to download roms and get the .spc files yourself. There's this gorgeous site which contains tons of SNES games' soundtracks
Once you download a soundtrack, you'll find all the music from that game. Select all of them and paste them in a folder.
Try to open an SPC with SPC700, it'll start playing.
If you press the -> Right button on it, you'll get this view:
Focus on the numbers written in SRC: channel 1 is "08", channel 2 is "0A", and so on.
These numbers equal to the ID of the sample used in the song!
Now, put your SPC file inside the folder where you have Split700. Double click on "extract.bat" (NOT THE .EXE!! THE .BAT!!), and your folder will get flooded with .brr files!
We already explained that this tool's aim is to rip .brr files from a SPC file, which is what happened now, but now, I ask you to pay attention to the names of the just generated .brr files.
On a closer look, you see that the name format is:
"Name of the SPC file"_XX.brr
Guess what XX is!
Yup, this is the ID OF THE SAMPLE!
This version of Split700 extracts all the valid samples which are inside the SPC you processed.
To be extra sure to get all the samples of the game, you'll have to repeat this step with every SPC contained in the archieve you downloaded.
In theory, a sample keeps its ID from music to music, so, for example, if you ripped sample ID 20, and it appears again in another SPC of the game, we're talking about the same .brr. Different games behave differently on this, so you can't always tell.
Back to Table of Contents
RIPPING SAMPLES FROM A SNES GAME - USING SPCTOMML
- SPC DUMPER 1000 (SPCtoMML)
Another way of ripping all the samples from a SNES game is using Vitor's SPC Dumper 1000, the tool everyone calls SPCTOMML.
While the use of this tool isn't recommended if you want to extract and use the .mml of a song (messy output, huge size, no #default nor #optimized), it's really comfy whenever you want to pick its samples.
What makes Vitor's tool different from Split700 is that it will only rip the samples used in the processed SPC. The unused ones won't be extracted.
Okay so, let's see how this works!
Imagine we have a folder, containing a whole SNES game's soundtrack.
What we do now is the following:
- Open SPCtoMML, the tool looks like this;
- Click "Open SPC", and select the first SPC of your folder containing the game's sountrack;
- Click on "Analyze SPC";
- Wait briefly, then click on "..." where you see "Samples output path", and create a folder which will contain all the samples used by the first SPC;
- Click on "Export Samples", the tool now exported every sample of the selected SPC!
- Repeat this process for all the SPCs in your soundtrack folder. Make sure that each group of samples from different SPCs is using a different folder. If you use the same folder for all the SPCs, Vitor's tool will silently overwrite the samples ripped previously, and we don't want this!
Once you go trough this with every SPC, you should have a certain amount of folders, depending on how many SPCs your soundtrack has. Your soundtrack has 30 songs? Then you should have 30 folders with a group of samples inside each one.
Next step, is to put all the .brrs you ripped inside a single folder. DON'T OVERWRITE ANYTHING, ALWAYS MAKE SURE YOU KEEP BOTH FILES WITH SAME NAME!!
Then, open the folder containing all the samples, and order the files by size. In this way, you can easily identify equal samples, since they'll have the same size in bytes. (Sadly, you can't see the exact size from just the folder in Windows 10)
Using BRR Player, listen to each sample, delete equal samples, and then give them a name.
That's it! You likely ripped the whole game's samples!
The only thing left to do now is to create a .txt containing the proper tuning for each sample. Making a !pattern is recommended.
Back to Table of Contents
RIPPING SAMPLES FROM A .SF2
- C700.dll addon for OpenMPT/FL Studio
Another, maybe simpler, way of getting samples is searching for .sf2 files around the internet. Imagine .sf2 files like a library of .wav files.
To open one, you need Viena.
As our example, let's try taking some samples from this .sf2 file, which contains some of the samples used in Mario Kart DS. Get it HERE!
Open it with Viena. You should get this:
Focus your attention on the window in center left: we have 3 groups:
- Samples: the collection of raw .wav files.
- Instruments: the collection of .wav files arranged together as instrument (for example, a group of piano .wavs makes the instrument Piano).
- Presets: the collection of various instruments. Sometimes, not every instrument in the library is used.
As tutorial, let's imagine we want to rip the brass.
Let's go in the group "Instruments", and let's double-click on "Brass Section".
This varies from .sf2 to .sf2, but in general, an instrument is made of various waves: in particular, there could be different waves basing on the pitch of the sample.
In our case, we see:
- Global: the ensemble of all the sample's waves;
- Unnamed Wave 6: used for the lower notes (infact, if you click on it, and see the piano, you'll see there's a red rectangle, which specifies which notes are properly played by that wave);
- Unnamed Wave 7: used for the higher notes. The red rectangle moves in the rightmost part of the piano.
Let's say we want to rip "Unnamed Wave 7", so the wave for the higher notes.
Double click on "Unnamed Wave 7".
We get redirected in the Samples group of the library. Here we can see all the informations about the wave we selected.
Just look the big pic. All the info are in there.
You can export the wave by simply clicking on "Export WAV file". Then, the .wav file will be saved wherever you specify!
From here onwards, all the steps for converting .wav to .brr are known (so you'll run the .wav on Audacity to make the .wav mono, then use OpenMPT to loop the sample and convert it to a .brr. I already explained it here, under "RIPPING SAMPLES FROM EXTERNAL RESOURCES").
I give particular attention to the loop points provided by the .sf2. When they're provided, it's recommended you go with them, since in most cases, they're accurate. Obviously, nothing stops you from trying to get a smaller and/or better loop point.
That's all you have to know. Happy .wav ripping!
Back to Table of Contents
I hope you enjoyed this tutorial! Feel free to address stuff which is wrong, and post if you're having issues. I'd be glad to help you!