Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#26 2013-01-16 04:32:14

stag019
Idea Killer
Registered: 2011-01-05
Post 277/630

Re: Music Hacking Resource Document

Hey Danny. Music data is something that's severely lacking in the pokered disassembly (someone started on it, but since then, they've disappeared, leaving it incomplete). If you're able to get a good grip on how it works, perhaps you could take some time to try and add the data into the disassembly. It would be a good way to get you familiar to the disassembly and a great way to contribute.

P.S.: Since I made that post in your palette thread about looking into the disassembly to help you hack, have you looked into it again at all to help you with anything else?


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#27 2013-01-16 05:56:16

FroggestSpirit
Member
Registered: 2012-03-12
Post 41/300
Website

Re: Music Hacking Resource Document

Danny, the Dx command on the Wave channel will change the instrument. The first nybble has to be either 0,1,2,or 3. they pick the volume. I believe 1 is full volume, 2 is half, idk about 3 and 0. the second nybble is the instrument. When working with RBY, you have 5 instruments (0-4) ... or was it 6? Anyways, GSC has 9 or 10, with the first ones being identical to RBY. Also, if youre working with the music patch i added to your hack, you have all 9 or 10 from GSC.
Tempo is declared once usually in channel 1, so I believe it will change the whole song.
Also! When doing custom songs, dont put the main melody on pulse/channel 1! it gets cut out by SFX and low hp. The game usually puts it on 2 or 3


This isn't easy to say, but…
Music and ASM hacker

Offline

#28 2013-01-16 06:56:16

Danny-E 33
Administrator
Registered: 2012-06-09
Post 372/1,119

Re: Music Hacking Resource Document

stag019 wrote:

Hey Danny. Music data is something that's severely lacking in the pokered disassembly (someone started on it, but since then, they've disappeared, leaving it incomplete). If you're able to get a good grip on how it works, perhaps you could take some time to try and add the data into the disassembly. It would be a good way to get you familiar to the disassembly and a great way to contribute.

Yeah, that's absolutely something I'm interested in! I would love the experience. My email's a good way to get a hold of me to fill me in on how to get started.

stag019 wrote:

P.S.: Since I made that post in your palette thread about looking into the disassembly to help you hack, have you looked into it again at all to help you with anything else?

Like you said, I used the disassembly to send a SGB packet during the loading of the Pokedex with the excerpt from the disassembly you referred me to.
I also used the disassembly's comments on the Oak intro script to plan where to send SGB packets to appropriately color the sprites. There may be others. I'm too tired to think right now.
I know I want to use it more to make my hack as creative as possible and to learn as much as I can. The problem with it so far is that I don't know how to find what I'm looking for in the disassembly by myself. Others have always told me where to find what I'm looking for.

FroggestSpirit wrote:

Danny, the Dx command on the Wave channel will change the instrument. The first nybble has to be either 0,1,2,or 3. they pick the volume. I believe 1 is full volume, 2 is half, idk about 3 and 0. the second nybble is the instrument. When working with RBY, you have 5 instruments (0-4) ... or was it 6? Anyways, GSC has 9 or 10, with the first ones being identical to RBY. Also, if youre working with the music patch i added to your hack, you have all 9 or 10 from GSC.
Tempo is declared once usually in channel 1, so I believe it will change the whole song.
Also! When doing custom songs, dont put the main melody on pulse/channel 1! it gets cut out by SFX and low hp. The game usually puts it on 2 or 3

When I say triangle and you say wave, are we both talking about the same channel? Do you mean the "bass" channel?
So the triangle, or wave, does have more than "on" or "off" for volume, but not as many levels as the two squares?
And if Dx has a different effect on the triangle than it does square 1 or square 2, are there other differences with effects?

FroggestSpirit wrote:

I actually made a small tool to port gsc to rby (music that is). maybe I should finalize it, add rby to gsc, and release it. (it also adjusts pointers for calls and jumps)

If you finalized this, would it be simple enough to port over the rest of GSC's Kanto music like towns and such on my own and not have to bother you with it?

Last edited by Danny-E 33 (2013-01-16 07:28:18)

Offline

#29 2013-01-16 07:54:07

stag019
Idea Killer
Registered: 2011-01-05
Post 278/630

Re: Music Hacking Resource Document

Danny-E 33 wrote:
stag019 wrote:

Hey Danny. Music data is something that's severely lacking in the pokered disassembly (someone started on it, but since then, they've disappeared, leaving it incomplete). If you're able to get a good grip on how it works, perhaps you could take some time to try and add the data into the disassembly. It would be a good way to get you familiar to the disassembly and a great way to contribute.

Yeah, that's absolutely something I'm interested in! I would love the experience. My email's a good way to get a hold of me to fill me in on how to get started.

I sent you an email then...


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#30 2013-01-16 15:22:06

FroggestSpirit
Member
Registered: 2012-03-12
Post 42/300
Website

Re: Music Hacking Resource Document

I might finish the tool, but id rather wait until we have more documented, especially with the noise channel.
And yes, the wave channel is what i was meaning when you said triangle. The GB(C) has 4 channels, 2 pulses, a wave and a noise (NES had a triangle channel)
The only other command I think is different, is the one to change the pulse duty. I think it does nothing on the Wave channel. The wave channel has 4 volumes, 0%, 25%, 50% and 100%


This isn't easy to say, but…
Music and ASM hacker

Offline

#31 2013-01-16 17:22:08

Danny-E 33
Administrator
Registered: 2012-06-09
Post 374/1,119

Re: Music Hacking Resource Document

stag019 wrote:

I sent you an email then...

Alright, I'll have to check it when I get home. My school's wifi doesn't let me check my email. I'm lucky it lets me on here. :P

FroggestSpirit wrote:

I might finish the tool, but id rather wait until we have more documented, especially with the noise channel.

Alright, we'll work on this then!

Offline

#32 2013-01-17 02:14:58

FroggestSpirit
Member
Registered: 2012-03-12
Post 43/300
Website

Re: Music Hacking Resource Document

I ripped all 45 songs from RBY (not including the hidden one) and I'm going to try porting all of them to GSC. Fun fact, every song from RBY fits within 2 banks of GSC, with extra space left over.
Edit: ive made progress converting songs, learned about a new code FC, used in jigglypuffs song. All i need to figure out, is how the drums work. They seem a lot simpler in gsc

Last edited by FroggestSpirit (2013-01-19 17:45:54)


This isn't easy to say, but…
Music and ASM hacker

Offline

#33 2013-01-19 20:44:41

Danny-E 33
Administrator
Registered: 2012-06-09
Post 380/1,119

Re: Music Hacking Resource Document

Sorry to put this here, but I see you've been on today to edit this post.
Have you seen my request in the graphics patch thread?

Offline

#34 2013-01-19 21:50:50

FroggestSpirit
Member
Registered: 2012-03-12
Post 44/300
Website

Re: Music Hacking Resource Document

Sure, I could do that. Also, I got 26/45 songs from RBY converted to GSC. The rest have drums, pitch bend (haven't fully figured that out yet) or Jigglypuff's song (this one i understand, i just need to see if there's a GSC equivalent to the FC command)


This isn't easy to say, but…
Music and ASM hacker

Offline

#35 2013-01-20 02:01:03

Danny-E 33
Administrator
Registered: 2012-06-09
Post 382/1,119

Re: Music Hacking Resource Document

This sounds really cool! You should format a ROM to be a gen I AND II music player that has all songs from both games, but plays them all in one game's format (GSC, I'm sure)

EDIT: Hey, I think I just realized your Red Music Player doesn't have a channel 0 for songs 14-1A... :P

Last edited by Danny-E 33 (2013-01-20 05:25:34)

Offline

#36 2013-01-20 05:58:49

FroggestSpirit
Member
Registered: 2012-03-12
Post 45/300
Website

Re: Music Hacking Resource Document

I like the idea of that, perhaps, but I'm not sure. Also, that's how the songs are supposed to play. none of them had the noise channel used. (battle and victory themes)


This isn't easy to say, but…
Music and ASM hacker

Offline

#37 2013-01-20 19:20:26

Danny-E 33
Administrator
Registered: 2012-06-09
Post 385/1,119

Offline

#38 2013-01-20 19:46:25

FroggestSpirit
Member
Registered: 2012-03-12
Post 46/300
Website

Re: Music Hacking Resource Document

Are you sure its on in your emulator? Its working fine for me. I just count them as 1-4, but counting them 0-3 is the same idea. I got the original song done for your hack, and i figured out the drum channels for both gsc and rby. My converter is converting them good, with a small bug i need to fix.


This isn't easy to say, but…
Music and ASM hacker

Offline

#39 2013-01-20 19:59:44

Danny-E 33
Administrator
Registered: 2012-06-09
Post 386/1,119

Re: Music Hacking Resource Document

If you already read what I wrote before this edit, forget about it. It was entirely wrong. Here's what I figured out.
Channel 0 doesn't work just for songs 14-1A if you just changed bgb's system setting. You have to hit apply twice and reload the rom and channel 0 starts working for songs 14-1A.
No idea how this happens.

Anyway, could you uplaod an .ips or .gb that just changes the necessary components from the Graphics patch V1.0?
That way, I can keep straight what it's changing. Thanks.

And it's cool you got alot more figured out! :)

Last edited by Danny-E 33 (2013-01-20 20:07:51)

Offline

#40 2013-01-21 17:41:21

FroggestSpirit
Member
Registered: 2012-03-12
Post 49/300
Website

Re: Music Hacking Resource Document

Here are my findings:
Pokemon GSC Commands:

(x=length of note/Delay until next note)
0x - Mute
1x - C
2x - C#
3x - D
4x - D#
5x - E
6x - F
7x - F#
8x - G
9x - G#
Ax - A
Bx - A#
Cx - B

D0 - Change octave to 7
D1 - Change octave to 6
D2 - Change octave to 5
D3 - Change octave to 4
D4 - Change octave to 3
D5 - Change octave to 2
D6 - Change octave to 1
D7 - Change octave to 0

D8 XX YZ - Speed and Envelope
XX=Number of frames per note (0C is 16 notes per bar, 06 is 32 notes per bar)
YZ=Envelope (Y is the volume 0 is mute, F is full volume) (Z is Fade. 0 is no fade, 1 is quickest fade, 7 is slowest fade. When the number is greater than 7, subtract 8, and fade up instead)
D9 XY - Modify All notes? (Used in Kanto Trainer Battle)
X=Octaves to move all notes down by?
Y=Notes to transpose all up by?
DA XXXX - Tempo
XXXX=Tempo change, 16 bit A tempo of 156 should read "DA 00 9C"
DB XX - Duty/Pulse Shape
XX=(for pulse, 00 is 1/8 wave, 01 is 1/4 wave, 02 is 1/2 wave, 03 is 3/4 wave (same as 01 basically))
DC YZ - Envelope/Wave Instrument
YZ=Envelope (Y is the volume 0 is mute, F is full volume) (Z is Fade. 0 is no fade, 1 is quickest fade, 7 is slowest fade. When the number is greater than 7, subtract 8, and fade up instead) (for wave set wave pattern, and volume)
DD XX - Pulse 1 Sweep
XX=Pulse 1 Sweep
DE XX - Arpeggiate Pulse Duty
(Same as FC in RBY)
E0 XX YY - Some Pitch Bend?
E1 XX YZ - Vibrato
XX=will set the delay to that number, decrementing by one each frame. When it tries subtracting from 0, it starts decrementing from the speed timer (Z)
Y=Depth. The mod will first add, then subtract from the original frequencey each time. When Y is an odd number, it will mod higher an extra number
EX. normal pitch of 405, if Y=3, it will alternate between 407 and 404. Timers do NOT reset when a new note is played. only when the song stops or changes. (also, because a timer counts 0, a timer of 5 will take 6 frames to change)
Z=will decrement by one each frame, when it tries decramenting from 0, it mods the frequencey by half of Y, and resets to Z
E2 XX - Unknown
E3 XX - Drumset
XX=Which drumset to use
E4 XX - Same as E5?
E5 XX - Output
XX=in bits, 0-7 telling which of the 4 channels play through what speakers
E6 XXXX - Tune
XXXX=?
FD XX yyYY - Timed Jump
XX=number of times to jump (0 is infinite)
yyYY=Address to jump to. Lower byte first. EX. jumping to 25DC would read "DC 65"
When FD is already called for looping, it will act as an end point. It is usually used to repeat a part, and will jump to a part right before itself. when it reads itself again, it will keep jumping as long as the number of times hasnt ran out.
This is used at the end of a song to loop it.
FE yyYY - Jump
yyYY=Address to jump to. Lower byte first. EX. jumping to 3365 would read "65 73"
FF - End/Return from FE Jump
This will jump to the byte after yyYY of the last FE called.

Drums:
Envelope changing commands, like setting speed, only set speed, no parameter for envelope.
E3 changes the drumset.
drumset 00 contains instruments 01-0C of RBY
drumset 01 contains instruments 08-13 of RBY
other drumsets have not been documented yet (but there are more instruments in GSC)

after a drumset is set, it works just like other channels
0x-mute
1x-first instrument of drumset
2x-second instrument of drumset
...
Cx-twelth instrument of drumset
x=delay to next command

Pokemon RBY Commands:

(x=length of note/Delay until next note)
0x - C
1x - C#
2x - D
3x - D#
4x - E
5x - F
6x - F#
7x - G
8x - G#
9x - A
Ax - A#
Bx - B
Cx - Mute

Dx YZ - Envelope/Wave Instrument
x=Speed (Speed is set to 12/x, so that means DC would be normal speed (4/4) time signature)
YZ=Envelope (Y is the volume 0 is mute, F is full volume) (Z is Fade. 0 is no fade, 1 is quickest fade, 7 is slowest fade. When the number is greater than 7, subtract 8, and fade up instead) (for wave set wave pattern, and volume)
E0 - Change octave to 7
E1 - Change octave to 6
E2 - Change octave to 5
E3 - Change octave to 4
E4 - Change octave to 3
E5 - Change octave to 2
E6 - Change octave to 1
E7 - Change octave to 0

E8 - Unknown
EA XX YZ - Vibrato
XX=will set the delay to that number, decrementing by one each frame. When it tries subtracting from 0, it starts decrementing from the speed timer (Z)
Y=Depth. The mod will first add, then subtract from the original frequencey each time. When Y is an odd number, it will mod higher an extra number
EX. normal pitch of 405, if Y=3, it will alternate between 407 and 404. Timers do NOT reset when a new note is played. only when the song stops or changes. (also, because a timer counts 0, a timer of 5 will take 6 frames to change)
Z=will decrement by one each frame, when it tries decramenting from 0, it mods the frequencey by half of Y, and resets to Z
EB XX YY - Pitch Bend
No idea how this works to be honest (used in evolution/safari)
EC XX - Duty/Pulse Shape
XX=(for pulse, 00 is 1/8 wave, 01 is 1/4 wave, 02 is 1/2 wave, 03 is 3/4 wave (same as 01 basically))
ED XXXX - Tempo
XXXX=Tempo change, 16 bit A tempo of 156 should read "ED 00 9C"
EE XX - same as F0?
EF - Unknown
F0 XX - Output
XX=in bits, 0-7 telling which of the 4 channels play through what speakers
F8 - Unknown
FC XX - Arpeggiate Pulse Duty
XX=There are 4 defineable duties. Each duty is defined by 2 bits (00=1/8, 01=1/4, 10=1/2, 11=3/4), making a 1 byte parameter. Each frame, the channel will change it's duty to the next defined one.
Ex. say you set FC A5 (like in jigglypuff's song) it will play duty 1/2 for 2 frames, then duty 1/4 for 2 frames, then repeat.
FD yyYY - Jump
yyYY=Address to jump to. Lower byte first. EX. jumping to A901 would read "01 29"
FE XX yyYY - Timed Jump
XX=number of times to jump (0 is infinite)
yyYY=Address to jump to. Lower byte first. EX. jumping to 25DC would read "DC 65"
When FD is already called for looping, it will act as an end point. It is usually used to repeat a part, and will jump to a part right before itself. when it reads itself again, it will keep jumping as long as the number of times hasnt ran out.
This is used at the end of a song to loop it.
FF - End/Return from FE Jump
This will jump to the byte after yyYY of the last FE called.

Drums:
Dx - only sets speed, no envelope parameter

Format appears to be:
Bx YY - x=length/delay YY=drum/precussion instrument
Cx - rest

There are 13 instruments?
00=mute
01-04 Snare 01 is louder, 04 is quieter
05=Snare swoosh
06=Triangle
07=Triangle 2
08-0B=Snareish, 08 is higher pitched, 0B is lower pitched
0C-0E=Cymbal Crash 0C is higher pitched, 0B is lower pitched
0F=Muted Snare
10=Triangle 3
11-13=Muted Snare 11 is louder, 13 is quieter

Last edited by FroggestSpirit (2014-11-28 00:53:35)


This isn't easy to say, but…
Music and ASM hacker

Offline

#41 2013-01-21 21:39:21

Danny-E 33
Administrator
Registered: 2012-06-09
Post 394/1,119

Re: Music Hacking Resource Document

This is fantastic!
Are you considering releasing your tool to convert GSC songs to RBY format so I can put the rest of the GSC Kanto songs such as the OW themes into the GFX&Music patch?

Offline

#42 2013-01-22 03:06:18

FroggestSpirit
Member
Registered: 2012-03-12
Post 51/300
Website

Re: Music Hacking Resource Document

I'm not sure yet. There is a lot of difficulties with it (mostly regarding that command in GSC that modifies all notes) it would have to parse the data, modify them manually, and make sure all loops and jumps align. Then theres the fact of getting it all in RBY. (I had to have some asm jump the battle themes to the right bank.) I'll see what I can do, but also, the noise channel will only have instruments that RBY has


This isn't easy to say, but…
Music and ASM hacker

Offline

#43 2013-03-19 23:00:17

Nic7C5
Member
From: Germany
Registered: 2012-10-13
Post 36/52

Re: Music Hacking Resource Document

Is there a way to globally change slow down all audio (music, cries etc.)?

Offline

#44 2013-03-19 23:12:19

comet
Member
Registered: 2012-04-09
Post 163/679

Re: Music Hacking Resource Document

how slow are we talking?

Offline

#45 2013-03-20 01:53:36

Tauwasser
Member
Registered: 2010-10-16
Post 361/452

Re: Music Hacking Resource Document

Do you mean for double speed mode? If so, you need to use the standard sound routine calls and just add a little counter somewhere in RAM where you count if you're in an even cycle. If so, let the logic advance the music, if not, don't.

cYa,

Tauwasser

Offline

#46 2013-03-20 01:56:17

comet
Member
Registered: 2012-04-09
Post 164/679

Re: Music Hacking Resource Document

the counter already exists, it's in hram (gold: $ff9d, crystal: $ff9b)

Offline

#47 2013-03-20 01:59:24

FroggestSpirit
Member
Registered: 2012-03-12
Post 140/300
Website

Re: Music Hacking Resource Document

as for double speed mode, i dont think it matters, as it is part of VBLANK (correct me if I'm wrong), but couldnt you just have it call update music, update sound, update cry calls less? (instead of once per frame, maybe like once every other frame?)


This isn't easy to say, but…
Music and ASM hacker

Offline

#48 2013-03-20 03:20:13

Tauwasser
Member
Registered: 2010-10-16
Post 362/452

Re: Music Hacking Resource Document

Ah, ok. If it's vblank-based, that's good. I recently worked on a game where it was timer based ;) Have never really had that much knowledge about music to begin messing with this stuff :)

cYa,

Tauwasser

Offline

#49 2013-03-20 18:35:14

Nic7C5
Member
From: Germany
Registered: 2012-10-13
Post 37/52

Re: Music Hacking Resource Document

As you guessed, I want normal music while having my gameboy set to double speed. So its not done by editing a few HEX digits... ?

Offline

#50 2013-03-22 16:12:22

FroggestSpirit
Member
Registered: 2012-03-12
Post 149/300
Website

Re: Music Hacking Resource Document

Nic7C5, do nothing. Double speed mode should not affect it. (atleast it didn't when I used double speed mode in the pokemon red in color hack)


This isn't easy to say, but…
Music and ASM hacker

Offline

Board footer

Powered by FluxBB