News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Utilities: GBAMusRiper released  (Read 82755 times)

Pandemoniu

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #100 on: June 15, 2014, 10:10:35 am »
Ah! Thank you so much for the explanations. I'll try to keep those general things in mind for later.

As for the game in question, I was trying Yugioh 7 Trials to Glory: World Championship 2005, with the hope that afterwards, if successful, I'll go on to Yugioh Ultimate Masters: World Championship 2006.

When I didn't seem to get any headway with 7 Trials to Glory, I thought I'd try Pokemon Emerald, since I read on page 4 or 5 that someone got it working beautifully using Emerald. But that still didn't work. So I don't know.

It is supposed to be a .GBA file, right? Not .bin or anything?

Bregalad

  • Hero Member
  • *****
  • Posts: 2637
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #101 on: June 15, 2014, 01:33:47 pm »
It does not matter whether it is called '.gba' or '.bin'

This particular game doesn't seem to use sappy engine so its no wonder you can't rip it. I get a "There's no sappy engine here" message, I don't know how you managed to get this "can't seek" or whatever. Maybe it's from a different region and that gbamusriper was tricked into thinking there was a sappy here at some time.

The detection is extremely hard to work hard, if I tighten the condition it breaks games which does actually use sappy (like it did for Pokemon in the previous version), and if I release them it makes fake positives on games which doesn't use sappy...

nex01

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #102 on: June 15, 2014, 02:41:59 pm »
I think I'm doing something wrong but I'm not entirely sure.

First I scan my game with sappy, this comes out:
Code: [Select]
Sappy sound engine detector (c) 2013 by Bregalad
Searching...............Sound engine detected : Stereo version
# of song levels : 0
Fake alert. Continue searching
Sound engine detected : Stereo version
# of song levels : 8
Engine parameters :
Main Volume : 15 Polyphony : 10 channels, Dac : 8 bits, Sampling rate : 31536 Hz

Song table located at : 0x1c4530

Then trying to rip the file.

song_riper.exe gs2.gba blah.mid 0x1c4530 <- the given adress.

and it gives me following error:
Code: [Select]
GBA ROM sequence ripper (c) 2012 Bregalad
Invalid amount of tracks 152 ! (must be 1-16)

I assume the game has 152 tracks, but the tool can only  rip 16? 
So this means I can't dump games with more than 16 tracks?  :o

it is not the only game i tried, other games giving me this error too.

Pandemoniu

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #103 on: June 15, 2014, 08:29:37 pm »
It does not matter whether it is called '.gba' or '.bin'

This particular game doesn't seem to use sappy engine so its no wonder you can't rip it. I get a "There's no sappy engine here" message, I don't know how you managed to get this "can't seek" or whatever. Maybe it's from a different region and that gbamusriper was tricked into thinking there was a sappy here at some time.

The detection is extremely hard to work hard, if I tighten the condition it breaks games which does actually use sappy (like it did for Pokemon in the previous version), and if I release them it makes fake positives on games which doesn't use sappy...
:'(

Wow...I just cannot seem to get this game's music. I wish I could get someone to rip it, but who would I ask? Another frustrating thing is that I can't seem to get any other game to work, so I have no clue what it looks like done correctly.

Well, thanks for your time and answers.

I don't suppose you know any other way to rip this game's music?

Bregalad

  • Hero Member
  • *****
  • Posts: 2637
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #104 on: June 16, 2014, 02:47:05 am »
If you want me to be of any help, you should tell me exactly what's wrong. You should tell me what you are trying to do, what you are trying to rip, and why it does not work - what it displays on screen exactly. I can't be of any help otherwise.

As for other ways to rip it, yes, there is an older GBA2MID program, so you can also try it. It only rips sequences, not sound fonts, however.

loveemu

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #105 on: August 30, 2014, 10:00:17 pm »
Hi Bregalad. I am a fan of your GBAMusRiper. It does everything I've wanted, in very beautiful approach. However, I've encountered to a little problem with it.

Problem with Unused Instrument

Song 29 of Castlevania Harmony of Dissonance (Maxim Theme; song header is at ROM:$25f648) does not sound correctly. This is because GBAMusRiper considers that instrument #4 (GBA pulse; instrument header is at ROM:$19e414) is unused.

As for workaround, I could avoid the problem by removing the branch like `if (inst.word0 == 0x3c01 ...)`. Can you provide an option to force to output the "potentially unused" instruments, or apply an other good workaround for the problem? Or, I'm missing an existing way to do that? (I simply used `gba_mus_riper rom.gba` to get outputs.)

Problem with RPN/NRPN

You need to resend RPN messages after you have sent NRPN messages. Otherwise, Data Entry changes NRPN control value instead of RPN (e.g. tuning).

The simplest way to fix the problem is: send RPN/NRPN messages always ;)

Also, you may need to send Data Entry LSB = 0, if it had been changed before.

Edit: By the way, I'm just curious, but do you have a source code repository and/or issue tracker for your tool?
« Last Edit: August 30, 2014, 10:37:43 pm by loveemu »

Bregalad

  • Hero Member
  • *****
  • Posts: 2637
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #106 on: August 31, 2014, 04:51:01 pm »
Thank you, I'll look forward to fix those glitches for the next release.

And no I have no repository, outside of my hard disks.

I tried to detect unused instruments because that would make even more garbage in the converted sound font than there already is.

Bregalad

  • Hero Member
  • *****
  • Posts: 2637
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #107 on: December 22, 2014, 03:39:42 pm »
I just post to say there is currently an update in the queue. Once approved, the problems mentioned by loveemu with RPN/NRPN will be gone, and I use his supperior routine to detect sappy engine instead of my original way (which was too flawed, as it tended to have too many of both false positives and misses).

The Golden Sun synth instruments will now be (partially) supported. Doesn't sound exactly as good, but close enough.

loveemu

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #108 on: January 24, 2015, 03:40:05 am »
I recently noticed v2.2 update. Congratulations.

It works very good, but I'd like to mention to a few of nitpicky things.

Order of RPN/NRPN

GBAMusRiper sends LSB first, but AFAIK most MIDI files sends MSB first. (General MIDI Lite v1.0 RP (RP-033) PDF has an example of it)

I prefer GBAMusRiper changes MSB/LSB order of RPN/NRPN. (I mean, use 101, 100, 6, 38, rather than 100, 101, 6, 38)

Pan and Volume Curve

I guess GBA MP2000 uses linear pan (well, it's a guess). On other hand, GM2 compatible sound modules does not use linear pan, but they use sin/cos volume curve instead. (see RP024)

If you want to make the volume balance of output sequence more GBA-like, you probably need to convert pan value and adjust volume value.

Code: [Select]
// Takes a percentage pan value (linear volume curve)
// and converts it to a standard midi curve (sin/cos curve)
double ConvertPercentPanToStdMidiScale(double percent, double * ptr_volume_scale)
{
double panPI2 = atan2(percent, 1.0 - percent);
if (ptr_volume_scale != NULL)
{
*ptr_volume_scale = 1.0 / (cos(panPI2) + sin(panPI2)); // <= 1.0
}
return panPI2 / M_PI_2;
}

However, I like the current simple conversion. It's just a nitpick.

Bregalad

  • Hero Member
  • *****
  • Posts: 2637
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #109 on: January 26, 2015, 08:41:39 am »
Ok I will fix the RPN/NRPN order, I never though it mattered, but if it does then it's easy to get it in the other order.

About the pan, I'll have to verify or deny your guess somehow. If there is a linearity problem, then I could make it the same as the volume/velocity correction I already does (you can set it to native or corrected, but it defaults to corrected, so that "sounds" like the original - while destroying part of the information).

By the way, I am also not satisfied in how the Golden Sun synths sounds currently but I don't know how to make them sound better without a major rewrite of the instrument generation (something I don't feel like doing).

Evolite

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #110 on: January 30, 2015, 10:12:50 am »
i have some trouble running this program. some time it's says can't find the rom, sometimes says can't read from input gba file. I read the readme but english is not my mothertongue, im not sure to understand all perfecly. Im am very young myself please someone can explain it with simple words?

wyatt8740

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #111 on: February 02, 2015, 01:40:34 am »
Hey, I tried using this to rip the music from Mystery Dungeon: Red Rescue Team. it kind of works, but it too is missing some instruments.
Attached is the .mid file and the soundfont your program generated.
https://dl.dropboxusercontent.com/u/74519404/song.zip
I've tested it with BASSMIDI in windows XP, and with timidity in debian linux. Other (MOST) tracks from the game have the same problem.
When I run it in timidity, I get some useful warnings:
Code: [Select]
No instrument mapped to tone bank 0, program 21 - this instrument will not be heard
No instrument mapped to tone bank 0, program 46 - this instrument will not be heard
No instrument mapped to tone bank 0, program 76 - this instrument will not be heard
For comparison, here's approximately what it should sound like (This is taken from the NDS version (blue rescue team), but it gives a good idea of how bad it is; both use the same instruments and music).
https://www.youtube.com/watch?v=lC3P3Q71jUI

I recorded the GBA version by playing through the game a bit. It's a good game, so I could justify doing so. :D
This is how it sounds on a GBA emulator:
https://www.youtube.com/watch?v=kNO1UiiGdxI
When I use a different soundfont, it works but sounds terrible. So the data is there, but not the correct sounds in the soundfont.


If you need anything from me, let me know. :) I've loved your program for a lot of other games.


i have some trouble running this program. some time it's says can't find the rom, sometimes says can't read from input gba file. I read the readme but english is not my mothertongue, im not sure to understand all perfecly. Im am very young myself please someone can explain it with simple words?

First run sappy_detector and copy the 'song table' that it spits out.


for example, if it spits out 'Song table located at : 0x1e866bc', copy '0x1e866bc'.
then run this:
gba_mus_riper <rom> <offset> <optional parameters>.
So for mine, I'd type:
gba_mus_riper red.gba 0x1e866bc
and if I wanted to do something else, type the parameter after it.
« Last Edit: February 04, 2015, 12:56:56 am by wyatt8740 »

Bregalad

  • Hero Member
  • *****
  • Posts: 2637
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #112 on: February 04, 2015, 04:46:54 am »
I have many things to do these 2 weeks but in the second part of February I'll have time to take a indepth look in it and see if there is bugs to be corrected.

I have a few other corrections planned anyway for a future 3.1 release.

Besides it is not my role to teach anyone how to use a command line (or any other part of your computer for that matter), now that the program does not require Java (phew) anymore it is easy to run like any other command-line program.

EDIT : OK I looked into the problem and it seems there is empty instrumemnts : They are here but instead of containing references to samples they are empty. This is definitely a bug and I should look into fixing it.
« Last Edit: February 07, 2015, 04:53:55 am by Bregalad »

Bregalad

  • Hero Member
  • *****
  • Posts: 2637
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #113 on: February 21, 2015, 09:18:57 am »
I found the bug. It is at line 336 of gba_instr.cpp
To fix it, replace

Code: [Select]
if(!inst_type&0x07) continue;
by

Code: [Select]
if((inst_type & 0x07) != 0) continue;

I'll include this fix in the next release

Snubben

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #114 on: March 14, 2015, 09:40:42 am »
I'm having no luck trying to rip the sounds from the GBA Pokémon games even thought people previously have reported having success and according to the readme file the ROMs should have support as of version 2.0. When running gba_mus_riper I get this result:

Code: [Select]
C:\Users\Snubben\Desktop\gba_mus_riper_v22>gba_mus_riper.exe "C:\User
s\Snubben\Desktop\pkm_test\Pokemon Emerald\Pokemon Emerald.gba"
Sappy sound engine detector (c) 2014 by Bregalad and loveemu

Sound engine detected at offset 2e0124
# of song levels : 140991640
There is a problem :(

When allowing sappy_detector.c to go past the point were it stops by commenting the check I get the following result:

Code: [Select]
C:\Users\Snubben\Desktop\gba_mus_riper_v22>gba_mus_riper.exe "C:\User
s\Snubben\Desktop\pkm_test\Pokemon Emerald\Pokemon Emerald.gba"
Sappy sound engine detector (c) 2014 by Bregalad and loveemu

Sound engine detected at offset 2e0124
# of song levels : 140991640
Engine parameters :
Main Volume : 7 Polyphony : 7 channels, Dac : 17 bits, Sampling rate : invalid
Song table located at : 0x67d8cac0
Parsing song table...Collecting sound bank list... DEBUG 5fd8cac0GBA ROM sound f
ont ripper (c) 2012 Bregalad
Dumps a sound bank (or a list of sound banks) from a GBA game which is using the
 sappy sound engine to SoundFont 2.0 (.sf2) format
Usage : sound_font_riper in.gba out.sf2 [options] address1 [address2] ...
addresses will correspond to instrument banks in increasing order...
Available options :
-v : verbose : Display info about the sound font in text format. If -v is follow
ed by a file name,
     info is output to the specified file instead.
-s : Sampling rate for samples. Default : 22050 Hz
-gm : Give General MIDI names to presets. Note that this will only change the na
mes and will NOT
      magically turn the soundfont into a General MIDI compliant soundfont.
-mv : Main volume for sample instruments. Range : 1-15. Game Boy channels are un
naffected.

Rip completed !

With no sounds ripped. I get the same result for FireRed. Is it possible that the sappy engine searcher by loveemu doesn't work for the Pokémon games? I would try version 2.0 or 2.1, but can't find them anywhere. Trying the old java version included in the v2.2 download would not even claim to find the engine.

Bregalad

  • Hero Member
  • *****
  • Posts: 2637
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #115 on: March 15, 2015, 05:37:50 am »
Thanks for reporting. The problem seems to be (again) that for some reason the game adds more bytes somewhere and the location of the sound table isn't where I expect it to be. RAAH. I'll have to fix that in the next version, hopefully without breaking any games that are working fine right now.

Quote
When allowing sappy_detector.c to go past the point were it stops by commenting the check I get the following result:
Well there's a reason I make it stop if it detects an anomaly :)

March 15, 2015, 01:49:08 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
In the meantime you can rip it by affecting the following 2 code lines :

In sappy_detector.c replace
Code: [Select]
uint32_t *data = (uint32_t*)(inGBA_dump + offset - 16);by
Code: [Select]
uint32_t *data = (uint32_t*)(inGBA_dump + offset - 32);
In gba_mus_riper.cpp replace
Code: [Select]
if(fseek(inGBA, sound_engine_adr - 16, SEEK_SET))by
Code: [Select]
if(fseek(inGBA, sound_engine_adr - 32, SEEK_SET))

Now I'd need to make it autodetect whether it should use 16 or 32 somehow.
« Last Edit: March 15, 2015, 01:49:37 pm by Bregalad »

Snubben

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #116 on: March 15, 2015, 03:53:31 pm »
Thank you, it seems to be working fine now.
Not that it bothers me, but if you are interested a few songs seem to be using wrong soundbank when I play them with foobar2000 with BASSMIDI driver if I use separate banks, but are working if I use one bank. Generally though the song seem to be of lower quality when using one bank and playing with foobar2000 compared to separate banks. I can't really tell if this is expected or not.

Bregalad

  • Hero Member
  • *****
  • Posts: 2637
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #117 on: March 15, 2015, 06:06:33 pm »
Ok now the next version 2.3 is in the process queue and it fixes the 2 bugs mentionned above, among a couple of others. I am still unsatisfied with the loop handling on the MIDIs, so I'll probably have to release yet another update later. This is an endless project :-X

StarWolf3000

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #118 on: April 01, 2015, 09:11:40 am »
Was it intended to package a music dump of Golden Sun 2 TLA (French Version) with GBAMusRiper 2.3 (in /src)? I don't think so.

Bregalad

  • Hero Member
  • *****
  • Posts: 2637
    • View Profile
Re: Utilities: GBAMusRiper released
« Reply #119 on: April 01, 2015, 09:22:16 am »
No, and an edit to remove it is in the queue since 2 days.