BRSTM encode by beta at 6:20 PM EST on November 26, 2008
Is there an exe or something for creating BRSTMs floating around that I missed? I was trying to mess with some audio files in a Wii image.
okay by beta at 7:42 PM EST on November 26, 2008
I've got the dspadpcm created. I just need a way to get a brstm header in.
by wolupgm6 at 2:45 AM EST on November 28, 2008
try looking for a header creater. hcs has a generic one, but im not sure where, or whether it is suited for this.
by bxaimc at 10:03 AM EST on November 28, 2008
it's not suited for this
by manakoAT at 11:38 AM EST on November 28, 2008
Indeed, it isn't, but you can run Nintendo GameCube DSP with GENH since version 2.06!

Get it here


cU mana

by hcs at 1:04 PM EST on November 28, 2008
That's not why he wants it, mana.

I saw you were looking for the sample count value. brstm doesn't have fixed offsets at which you can find these things. However, if you look in the header chunk (starts with the text HEAD), the sample count is at 0x2c in that chunk.
manual by beta at 8:18 PM EST on December 4, 2008
I managed to hex edit a brstm header into dsp, but that was a pain. You have to manually set sample rates and lengths and things.
by beta at 8:23 PM EST on December 4, 2008
If that program could generate BRSTM headers it would be perfect.

Or BRSTMs from WAVs.

I burnt a copy with the truncated sound files and it works, but the sounds are truncated. Also they decided to sync ingame things to the sounds.

Any help with BRSTM conversion/header writing would be highly appreciated

To be crystal clear, what I want to do is this conversion:

32000Hz brstm->22050Hz brstm

which involves

32000Hz brstm->32000Hz wav->22050Hz wav->22050Hz brstm

edited 3:43 AM EST December 5, 2008
by beta at 7:23 PM EST on December 7, 2008
Anyone got anymore ideas?
by bxaimc at 10:00 PM EST on December 7, 2008
This is why I conclude that DSP sucks in general (tsk tsk Nintendo).
PS2 ADPCM is so much easier to make custom stuff.
by beta at 10:30 AM EST on December 8, 2008
The version of the game I made with truncated brstms kinda worked, but the non-standard brstms made it really buggy.

I need to make the brstms from the wavs I guess.
by beta at 10:02 PM EST on January 17, 2009
Anyone still looking at this?
by JILost at 10:32 PM EST on January 17, 2009
Only those of us with no lives and nothing better to do, like me.

edited 12:43 AM EST January 18, 2009
by SmartOne at 2:12 AM EST on January 18, 2009
What the... Are the BRSTMs from Super Paper Mario supposed to be this frantic? It sounds like they're playing too fast...

On second thought, they sound pretty darn unique. Cool.

edited 2:19 AM EST January 18, 2009
by Mouser X at 3:42 AM EST on January 18, 2009
When the files were created (by the developers, not the rippers), the header was messed up. When VGMstream reads the header it sees "44100" (or "48") so it plays them as such. If you rename the files to *.spmbrstm (if that's wrong, blame HCS. I asked him just now) then they should play at the correct speed. Hope that helps. Mouser X over and out.
by Elven Spellmaker at 10:28 AM EST on January 18, 2009
*.spmbrstm

Lol, Super Paper Mario BRSTM...
by SmartOne at 1:06 PM EST on January 18, 2009
Ah ah ah, it's BRSTMSPM.
by nensondubois at 2:39 PM EST on January 18, 2009
BRWLSTRM.
by hcs at 4:05 PM EST on January 18, 2009
Doh, SmartOne is right, it should be .brstmspm.
Though properly we really should just do these tracks in GENH.
by Elven Spellmaker at 5:24 AM EST on January 19, 2009
Doh, SmartOne is right, it should be .brstmspm.
Though properly we really should just do these tracks in GENH.


Why should it be BRSTMSPM?

Also what does the Generic Header program actually do... I assume it give a generic header (dur), but why would you do that?

edited 5:27 AM EST January 19, 2009
by hcs at 5:43 AM EST on January 19, 2009
It should be .brstmspm because that's what works with vgmstream.

GENH is used when the stream files themselves don't contain all the information needed to decode them. This information is elsewhere, either in a table in some other file or hard coded into the decoder somehow, or maybe (as in the Super Paper Mario case) the information is there but incorrect.

Earlier there were various hacks to solve this, generally involving renaming the files with a particular extension that helped the player to decide what to do (stuff like the .I400 extension), or mashing in the header information from elsewhere into a combined file (like .zwdsp).

GENH is meant to be a standard way of storing the common metadata needed to decode the stream. If there must be a hack then we might as well embrace the artificiality of it and make a unified format that can be applied to various codecs and systems.

Conveniently enough there is a thread on it here.
by hcs at 9:47 PM EST on January 20, 2009
I finally got around to making a brstm creator, which I have entitled Revolution B. You can find it and some details on the ripping tools page.

Before using it to replace a brstm in a game, it is important that you attempt to extract dsp from an existing brstm, so that revb can do some checking. If it fails (won't say "Done!" when finished) do let me know so I can add support for whatever the oddity is.

Typical usage would look like this:
brstm --build song.brstm songL.dsp songR.dsp

That should be suitable to generate a brstm for Super Smash Bros Brawl.

Currently revb doesn't fill in the ADPC table, which I think is used for seeking. I don't think it is used for looping, though, and I don't see any reason why seeking would be done, so it probably isn't important. If something seems odd I may have to fix this.

edited 9:53 PM EST January 20, 2009
by hcs at 10:00 AM EST on January 29, 2009
Gah, I'm not letting this fall off the front page until beta comes and picks it up.
by wolupgm6 at 3:09 AM EST on January 30, 2009
Nicely Done HCS. Now Brawl Can Have Two Different Songs (One In Each Channel) Playing At Once!! Yay!
by hcs at 11:50 PM EST on February 15, 2009
LOVE ME!!!!
by unknownfile at 12:03 AM EST on February 16, 2009
i do
by VGSB at 2:19 AM EST on February 16, 2009
I second that love, though I won't be using that tool. You have earned it through many other ways though. Mostly non-sexual. :)
holy crap by beta at 6:28 PM EDT on March 22, 2009
I was off messing with PS2 games and you do this!

Awesome, I'll let you know how it goes!
by hcs at 11:22 PM EDT on March 22, 2009
oppo noticed an issue, though not quite my fault, Nintendo's brstm driver appears to only be able to seek to a loop start at the beginning of a block. For Brawl this works out to 14336 samples.
by hcs at 8:41 AM EDT on April 14, 2009
For my own entertainment:
* January 20, BRSTM encode
revb released
* January 31, Andy developer wlling to try to make a
nIxx points SWORD21 at revb, GBAtemp
* February 1, Replacing Music files......
Unblessed_Zaku_MKII @ "Kitty Corp Projects" (registration required), writes a guide for creating brstm, crediting chaotix000 for linking him to revb
* February 4, Androu1’s BRSTM making tool
Androu1's blog, links to kittycorp, a script to make brstm
* February 5, Is it possible to swap music in brawl?, Just curious
reference back to older GBAtemp post
* February 7, ¡Pon tu propia música en el Brawl!
jolti135 @ ElOtroLado, starting from Androu1's script, develops it further
* February 12, The guide on how the hack / import your own music in Super Smash Smash Brothers Brawl!
BigSharkZ on YouTube, just a presentation of Unblessed_Zaku_MKII's instructions, links to Androu1's converter
* March 3, Texture Hacked Courses
MrBean35000vr @ mariokartwii.com, The Mario Kart Wii modding community finds Androu1's converter

edited 9:03 AM EDT April 14, 2009
by hcs at 8:41 PM EDT on April 15, 2009
Revolution B 0.2 on the ripping tools page.
See history for changes, importantly it now produces a warning if the loop start is not on a block boundary, and reports how many samples of silence can be added to the beginning to resolve the problem.
by furrybob at 7:31 PM EDT on April 16, 2009
I've made a batch file that automatically converts any audio file read by goldwave or vgmstream to brstm files

problem is it's just one step away from being fully automated

my current code is:
for %%a in (*.adx) do (
Setlocal EnableDelayedExpansion
vgmstream -o "%%~na.wav" -l 1 -f 0 "%%a"
@set /P end=End Loop Point:
@set /P start=Start Loop Point:

insert random file processing commands here

dspadpcm -e "song_l.wav" "song_l.dsp" -l!start!-!end!
dspadpcm -e "song_r.wav" "song_r.dsp" -l!start!-!end!

so it shows up like this on the command prompt screen:

decoding Air Fleet.adx
sample rate 48000 Hz
channels: 2
loop start: 1172448 samples (24.43 seconds)
loop end: 3663259 samples (76.32 seconds)
stream total samples: 3896772 (81.18 seconds)
encoding: CRI ADX 4-bit ADPCM
layout: interleave
interleave: 0x12 bytes
metadata from: CRI ADX header type 04
samples to play: 3663259 (76.32 seconds)
End Loop Point:

And then i have to manually enter the loop points

Is there any way that vgmstream can output the loops as variables or something that would fully automate this process? I'd really like being able to simply drop this batch file in a folder full of mp3s or adxs, run it and come back to a folder full of brstms
by furrybob at 6:53 PM EDT on April 23, 2009
basicly I just want an option to output loop points as variables so I can call them later in a batch file
by hcs at 8:36 PM EDT on April 23, 2009
Closest we have is the -x and -g options, which print out command lines for adxencd and oggenc with loop stuff. But what kind of loop points do you expect for mp3s?
However, this won't help with getting proper loop points, you'd need a preprocessor that pads out the file according to where the loop start is supposed to be. I could throw together something that does this, and I've been thinking of it, might get to it shortly.
by furrybob at 9:10 PM EDT on April 23, 2009
basic steps a simple automatic converter batch file would take with files that already have loop points:

use vgmstream to decode file up to one second past the end loop point, and output loop points to command prompt
have command prompt output loop points to external script
adjust loop points, making the start loop point a multiple of 14336 by finding the next multiple of 14336 and increasing both loop points accordingly
eg:
start: 97512 -> 100352
end: 724679 -> 727519
input new loop points to command prompt
use goldwave to split output wave file into 2 separate files, one for the left channel and one for the right
encode both wav files with dspadpcm
make brstm file with revb

If you wanted to add custom loop points to an mp3 or similar nonlooped audio file you would:

convert file to .wav with goldwave
enter custom loop points manually
use goldwave to split output wave file into 2 separate files, one for the left channel and one for the right
encode both wav files with dspadpcm
write brstm header with revb
If the start loop point is divisible by 14336(something like a $start/14336 = int($start/14336)), you're finished. If it's not:

use vgmstream to decode file up to a second past the end loop point, and output loop points to command prompt
have command prompt output loop points to an external script
adjust loop points to have the start loop point a multiple of 14336
input new loop points to command prompt
use goldwave to split output wave file into 2 separate files, one for the left channel and one for the right
encode both wav files with dspadpcm
make brstm file with revb
(yes you're encoding twice, but unless you get brawl compatable loop points before hand it's the only method I could think of)



edited 9:12 PM EDT April 23, 2009

edited 10:56 PM EDT April 23, 2009
by furrybob at 11:50 PM EDT on April 28, 2009
but the -x and -g options don't actually tell adxencd or oggenc to encode the output dump.wav file, they just show you the commands to do so (if i'm wrong tell me, that's what it does on my computer)

And if you decide to add an option to output the loop points (which i really hope you do) could you output the total number of samples in a song and whether it loops or not as a 1 or 0? I'd need those to make the little brstm converter batch file I'm making fully automatic and virtually n00b proof.
If I had that the batch file would be able to convert any file readable by vgmstream or goldwave into a brstm with proper loop points automaticlly
by hcs at 12:10 AM EDT on April 29, 2009
The idea of the -x and -g option is that you decode with test.exe, but you direct the output to a batch file, like:
test.exe -x fred.dsp out.wav >> blah.bat
And then you run blah.bat. >> appends to the end of a file. I'd probably do something similar if adding a dspadpcm output, and it'd have the loop params or not according to that. There'd also be a switch to enable the loop aligning.
by furrybob at 6:57 PM EDT on April 29, 2009
oh, I didn't think of directing the output to another batch file

The problem with having an adxencd, oggenc, and dspadpcm output is that it's not as versatile as simply outputing loop points as variables.
If you want to put loop points into your own script instead of using test.exe's predetermined commands, you can't.

I would suggest an option that does something like
test.exe -option file.adx >> 1.bat
which would output that file's information which might look like: "set loop=1 & set lstart=103944 & set lend=4839137 & set ttlsamp=4839137" to 1.bat

then have a "call 1.bat" in your original batch file to import the variables which you can then use in your script

edited 7:00 PM EDT April 29, 2009
by hcs at 7:41 PM EDT on April 29, 2009
Fair enough, that much can be done easily. And that leaves the loop aligning as a more general mechanism (some program that works directly on WAVs).
by furrybob at 7:00 PM EDT on April 30, 2009
Thanks a whole lot for this
And if it's not too hard to do, could you also output the number of channels?
by furrybob at 12:29 PM EDT on May 9, 2009
So, any idea of when this feature will be added?
by hcs at 5:43 PM EDT on May 9, 2009
No schedule, hobby. And I'm on the low end of the motivation/demotivation cycle for a month or so now.
by arbingordon at 6:40 PM EDT on May 9, 2009
hcs, to quote unknownfile, get your ass in gear

you were supposed to get vgmstream running on a toaster back in february

get to work
by furrybob at 7:03 PM EDT on May 9, 2009
eh, whatever, i'm patient, just as long as you add it in a month or so
by bxaimc at 12:15 AM EDT on May 10, 2009
@Mastery:
Plans change all the time...
by furrybob at 10:57 PM EDT on May 29, 2009
not to sound rude or anything, but i would really like it if you could do this soon

edited 11:17 PM EDT May 29, 2009
by arbingordon at 12:06 AM EDT on May 30, 2009
no
by hcs at 3:14 AM EDT on May 30, 2009
I'm sorry I just haven't been able to get around to it. It is on my to do list, it's just that nothing on that list is getting done.

edited 3:26 AM EDT May 30, 2009
by furrybob at 11:38 AM EDT on May 30, 2009
k, just making sure you hadn't forgotten about it or anything
by furrybob at 4:51 PM EDT on June 9, 2009
sorry if i sounded demanding before, it's just that this is all I need to finish my brstm encoder and I wanted to get it distributed to some people
by furrybob at 12:57 PM EDT on June 24, 2009
Any news on this? I'm kinda running out of time to finish making my converter thing
by hcs at 1:02 PM EDT on June 24, 2009
What exactly had we agreed to do?
by furrybob at 1:42 PM EDT on June 24, 2009
in the test.exe that came with vgmstream you were going to add an option that simply outputs:

start loop sample
end loop sample
total samples
number of channels
and if the input file loops or not, 0 for no 1 for yes

as something like
set lstart=1172448 & set lend=3663259 & set tsamp=3663259 & set chan=2 & set loop=1

so that those variables could be inputed to the command line

so one could do something like:
test -o song.wav song.adx
test -option song.adx > bat.bat
call bat.bat

edited 1:42 PM EDT June 24, 2009
by hcs at 4:12 PM EDT on June 24, 2009
Ok, I put something like that in r663. You have a fname variable as well, so you just have to call it once (with the -b option). Let me know if there's anything more.
by furrybob at 4:16 PM EDT on June 24, 2009
ok, thank you so much for this

Tested it and it seems to work perfectly, thanks

edited 4:22 PM EDT June 24, 2009
by hcs at 10:16 AM EDT on July 23, 2009
Minor revb update (now 0.4), just a few things that had been bothering me, no new functionality.
by Xane at 7:04 AM EST on December 4, 2009
How much work would it be to make revb support more than 2 channels for building BRSTMs? :>
by hcs at 10:00 AM EST on December 4, 2009
Probably not much. I'll only bill you for 2 hours.
by Xane at 11:59 AM EST on December 4, 2009
I think I can live with that. ;D
Greatly appreciated for taking your time!
by hcs at 12:20 PM EST on December 4, 2009
Haven't agreed to do it yet :P
I've been pretty much burned out after xma_parse, ww2ogg, and a cold.
by Sir-Sabin at 12:25 PM EST on December 4, 2009
does this mean you are close to putting xma in vgmstream?
by Xane at 5:00 PM EST on December 4, 2009
Ah ok, well then, take your time. :>
by hcs at 7:46 PM EST on December 4, 2009
Sir-Sabin: No, I've resigned to making the existing tools more useful. Maybe some day when I know more about synthesis and have a huge amount of free time.
by Xane at 9:19 AM EST on December 5, 2009
Oh, I just saw that the source is embedded in the exe.
I've just added support for multiple channels myself, thanks for releasing the source aswell! :D
by hcs at 11:27 PM EDT on August 12, 2010
White Dragon seems to have also added multichannel support.


Go to Page 0

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source