Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2010-12-30 06:12:49

Chaos Rush
Member
Registered: 2010-10-16
Post 6/62

Is there ANY proper documentation on GBC music?

One of the main reasons why I'm not doing an active GBC hack is because it's nearly impossible to hack in new music. Most people ignore it, but to me, music is one of the most important things, hence why in my PC hack (Pokemon DarkViolet), you'll notice that there's a lot of edited/custom music.

I found this document, but it hardly helps. I've looked around EVERYWHERE for documentation on custom GBC music, and I've found nothing (other than that). I'm wondering how Koolboyman managed to insert custom music into Pokemon Prism when there's pretty much no information on how.

Here's what I would like to do:
*Port Red/Blue music to Gold/Silver
*Insert custom music

With the GBA games, you could convert midi into binary files to be inserted with Sappy, which works just fine. Is there any way to convert midi to GBC music? If not, how do you even insert custom music at all?

Offline

#2 2010-12-30 06:29:51

Miksy91
Member
Registered: 2010-10-16
Post 230/2,305

Re: Is there ANY proper documentation on GBC music?

The music data in 1st gen is similar to 2nd gen, so you could add its music to your game easily.
Just make the game load the "parts" of the song (for example "Error") in area with free space and check where the music in Red or Blue is stored (which you want to add) and just write the bytes of that song to your free space.
And, repeat (with other part of the songs) :D

Just make sure you change E0 to D0, E1 to D1 and so on...


P.S
I think Koolboyman had someone to compose music for him so it's not definitely easy to add in your own music which would actually work.
And, doing it would take some time as well.

Last edited by Miksy91 (2010-12-30 06:32:42)

Offline

#3 2010-12-30 06:44:09

95/700

Re: Is there ANY proper documentation on GBC music?

chaosrush wrote:

I found this document, but it hardly helps.

Why doesn’t it help? How could the document be improved? (There’s a copy here, if anyone wants to comment.)

chaosrush wrote:

With the GBA games, you could convert midi into binary files to be inserted with Sappy, which works just fine. Is there any way to convert midi to GBC music?

No. Well, never say never, but MIDI is a complex format and converting it to G/S format would be a waste of time because they aren’t even remotely similar (unlike, say, the Sappy format).

chaosrush wrote:

If not, how do you even insert custom music at all?

Currently? In hex, or with Famitracker. I believe some of Prism’s music was copied straight from Pokémon Pinball, which uses the same music engine.

#4 2010-12-30 07:13:49

Chaos Rush
Member
Registered: 2010-10-16
Post 7/62

Re: Is there ANY proper documentation on GBC music?

IIMarckus wrote:
chaosrush wrote:

I found this document, but it hardly helps.

Why doesn’t it help? How could the document be improved? (There’s a copy here, if anyone wants to comment.)

It didn't help me much because I still had no idea on how to make and insert custom music. I also tried porting Gen I music to Gen II (by changing E0 to D0 and E1 to D1 and so on), but that got me strange noises. I still felt like I'm missing something... Also, what is the offset for Route 33? That's one of the songs I wanted to change because it's the song that plays in the New Game intro.

IIMarckus wrote:
chaosrush wrote:

If not, how do you even insert custom music at all?

Currently? In hex, or with Famitracker. I believe some of Prism’s music was copied straight from Pokémon Pinball, which uses the same music engine.

But there's still custom music in Pokemon Prism, such as those "power-ranger-lookalike people" battle theme. And the tutorial you linked to contains custom music as an example.

But before I say more, I'll have to try Famitracker again... I've tried it before and couldn't figure out how to do ANYTHING with it, but I just noticed that it comes with a help file.

Offline

#5 2010-12-30 11:52:27

Miksy91
Member
Registered: 2010-10-16
Post 231/2,305

Re: Is there ANY proper documentation on GBC music?

chaosrush wrote:

It didn't help me much because I still had no idea on how to make and insert custom music. I also tried porting Gen I music to Gen II (by changing E0 to D0 and E1 to D1 and so on), but that got me strange noises.

For example Octave 5 in G/S/C is defined by byte E2 and in R/R/Y, by byte D2.
If you were up to adding music of pokemon R/B/Y to your G/S/C ROM, you'd have to convert D2 to E2 and so on...

For example, this is the music header of Pallet Town.
80 C5 67 01 5F 68 02 DE 68


C5 67, 5F 68 and DE 68 are the pointers to the music data.

So, the music data of Pallet Town is originally loaded from offsets:
0xA7C5, 0xA85F and 0xA8DE


And in those offsets, you'd find the music data of Pallet Town and if you planned on using the music of Pallet Town in G/S/C (which practically already exists), you'd have to change D2 to E2 etc.

Last edited by Miksy91 (2010-12-30 12:03:02)

Offline

#6 2010-12-30 23:38:51

Chaos Rush
Member
Registered: 2010-10-16
Post 8/62

Re: Is there ANY proper documentation on GBC music?

Using the RBY music importer, I tried editing the pkms file to GSC format, but it ends up giving me blank music. Any help?


This is what I edited it to:

; ===========================================================================
; PKMS equates and macros
;
; ===========================================================================

; equs
MUSIC EQU 0
SFX EQU 4
CH1 EQU 0
CH2 EQU 1
CH3 EQU 2
CH4 EQU 3

; notes
ntC EQU $00
ntC# EQU $10
ntD EQU $20
ntD# EQU $30
ntE EQU $40
ntF EQU $50
ntF# EQU $60
ntG EQU $70
ntG# EQU $80
ntA EQU $90
ntA# EQU $A0
ntB EQU $C0
ntRst EQU $B0

; special drum EQUs
dNote EQU $C0
dRst EQU $B0
dNormSpd EQU $DC
d4d3Spd         EQU $D8
d5d3Spd         EQU $D4
d2Spd EQU $D0

; octaves
oct0 EQU $D7
oct1 EQU $D6
oct2 EQU $D5
oct3 EQU $D4
oct4 EQU $D3
oct5 EQU $D2
oct6 EQU $D1
oct7 EQU $D0


; header stuff
pkmsHeader: MACRO
db ((\1 - 1) * $40) | (\2 + \3)
ENDM

pkmsChannel: MACRO
dw \1

IF \2 != 0
db \2
ENDC
ENDM

; coordination flags

; set velocity/note fade (\1 is velocity, \2 is note length, both 0-15)
; format: pkmsSetVel vel, length
pkmsSetVel: MACRO
db $DC
db ((\1 << 4) | \2)
ENDM
; stop sound
; format: pkmsEndSound
pkmsEndSound: MACRO
db $FF
ENDM

; $E8 (unknown)
; format: pkmsE8
pkmsE8: MACRO
db $E8

ENDM

; set modulation (\1 is delay, \2 is depth, \3 is rate)
; format: pkmsModSet delay, depth, rate
pkmsModSet: MACRO
db $E1
db \1
db ((\2 << 4) | \3)
ENDM

; set duty cycle (\1: 0 = 12.5%, 1 = 25%, 2 = 50%, 3 = 75%)
; format: pkmsSetDuty duty
pkmsSetDuty: MACRO
db $DB
db \1
ENDM

; set music tempo (\1 is divider, \2 is modifier)
; format: pkmsSetTempo divider, modifier
pkmsSetTempo: MACRO
db $DA
db \1
db \2
ENDM

; set volume (\1 is volume)
; format: pkmsSetVolume volume
; (may actually be panning?)
pkmsSetVolume: MACRO
db $F0
db \1
ENDM

; call offset \1
; format: pkmsCall offset
pkmsCall: MACRO
db $FE
dw ((\1 % $4000) + ((\1 >= $4000) * $4000))
ENDM

; jump to offset \1
; format: pkmsJump offset
pkmsJump: MACRO
db $FD
db $00
dw ((\1 % $4000) + ((\1 >= $4000) * $4000))
ENDM

Last edited by Chaos Rush (2010-12-30 23:39:09)

Offline

#7 2011-01-08 03:38:28

blackopient
Member
From: Houston, TX
Registered: 2010-11-01
Post 6/15

Re: Is there ANY proper documentation on GBC music?

I've tried something similar and come out with just random noise, although I don't think I edited the pkms file properly. I am also extremely interested in getting this to work.
Music is my 2nd love. After my fiance, and before pokemon hacking.

Offline

#8 2011-01-22 21:31:50

blackopient
Member
From: Houston, TX
Registered: 2010-11-01
Post 11/15

Re: Is there ANY proper documentation on GBC music?

I've gone back and looked at pkms.asm file and re-edited it with a little more research. The only thing that hasn't been changed was when the same bytes mean the same thing in R/B/Y and G/S, and the Drum/Noise Channel bytes, as I don't have enough information on how what bytes G/S uses. I cross-referenced meanmrmustard's gold hacking notes and the document posted here .

; ===========================================================================
; PKMS equates and macros
;
; ===========================================================================

; equs
MUSIC            EQU 0
SFX            EQU 4
CH1            EQU 0
CH2            EQU 1
CH3            EQU 2
CH4            EQU 3

; notes
ntC            EQU $10
ntC#            EQU $20
ntD            EQU $30
ntD#            EQU $40
ntE            EQU $50
ntF            EQU $60
ntF#            EQU $70
ntG            EQU $80
ntG#            EQU $90
ntA            EQU $A0
ntA#            EQU $B0
ntB            EQU $C0
ntRst            EQU $D0

; special drum EQUs
dNote            EQU $B0
dRst            EQU $C0
dNormSpd        EQU $DC
d4d3Spd            EQU $D8
d5d3Spd            EQU $D4
d2Spd            EQU $D0

; octaves
oct0            EQU $D7
oct1            EQU $D6
oct2            EQU $D5
oct3            EQU $D4
oct4            EQU $D3
oct5            EQU $D2
oct6            EQU $D1
oct7            EQU $D0

            
; header stuff
pkmsHeader:    MACRO
            db    ((\1 - 1) * $40) | (\2 + \3)
        ENDM
                
pkmsChannel:    MACRO
                dw    \1
                    
                IF \2 != 0
                    db    \2
                ENDC
            ENDM

; coordination flags

; set velocity/note fade (\1 is velocity, \2 is note length, both 0-15)
; format:    pkmsSetVel        vel, length
pkmsSetVel:        MACRO
                db    $DC
                db    ((\1 << 4) | \2)
            ENDM
; stop sound
; format:    pkmsEndSound
pkmsEndSound:    MACRO
                db     $FF
            ENDM
            
; $E8 (unknown)
; format:    pkmsE8
pkmsE8:        MACRO
                db    $E8

            ENDM
            
; set modulation (\1 is delay, \2 is depth, \3 is rate)
; format:    pkmsModSet        delay, depth, rate
pkmsModSet:        MACRO
                db    $E1
                db    \1
                db    ((\2 << 4) | \3)
            ENDM

; set duty cycle (\1: 0 = 12.5%, 1 = 25%, 2 = 50%, 3 = 75%)
; format:    pkmsSetDuty        duty
pkmsSetDuty:    MACRO
                db    $DB
                db    \1
            ENDM
            
; set music tempo (\1 is divider, \2 is modifier)
; format:    pkmsSetTempo    divider, modifier
pkmsSetTempo:    MACRO
                db    $DA
                db    \1
                db    \2
            ENDM
            
; set volume (\1 is volume)
; format: pkmsSetVolume        volume
; (may actually be panning?)
pkmsSetVolume:    MACRO
                db    $E5
                db    \1
            ENDM

; call offset \1
; format:    pkmsCall    offset
pkmsCall:        MACRO
                db    $FD
                dw    ((\1 % $4000) + ((\1 >= $4000) * $4000))
            ENDM
                        
; jump to offset \1
; format:    pkmsJump    offset
pkmsJump:        MACRO
                db    $FE
                db    $00
                dw    ((\1 % $4000) + ((\1 >= $4000) * $4000))
            ENDM

I haven't been able to test this yet but it's worth a shot to anyone who understands how to work the importer. I'm having trouble understanding the pointer and inject offsets.

Offline

Board footer

Powered by FluxBB