Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 1970-01-01 00:33:30

Sonic65
New member
Registered: 2010-10-16
Post 1/4

RBY Music Importer (for .FTMs)

Figured I should probably register and post this here too, since this thread here was a big help to me...even if this entire post is basically just a copypaste from the Pokecommunity one (well, will be as soon as it gets approved anyway)

Anyway, I've been researching R/B/Y ROM hacking for a short while now, and I found that there was little real documentation or tools on the music side of the game (well actually in general, compared to 2nd/3rd gen). So I made this program to import music into an R/B/Y ROM - more specifically, import .ftm songs made with the program Famitracker, a music tracker for the NES.

2i2a6c7.png

Example of what this program can output (in-game sound recording)

What does it support?

  • Importing of all 4 basic sound channels (square 1/2, triangle, noise)

  • Both .ASM and .BIN export

  • Quick ROM inject feature for .BINs

  • Famitracker note fade-outs (using the volume column) and duty cycle changes (by changing instruments)

What doesn't it support?

  • MIDI import or any other file format other than .ftm

  • Any Famitracker effects

Link to download

Files in zip:

  • rbyImport.exe - The actual RBY Music Importer program.

  • blitz3d_gui_dll.dll - A DLL the program uses.

  • readme.txt - Derp. Doesn't have anything this post doesn't anyway.

  • route202.ftm - Sample FTM file to import (used in tutorial below). A NES/GB demake of the Route 202 theme for Pokemon Diamond/Pearl.

  • noiseChannelDoc.txt - Documentation on the music format Pokemon R/B/Y uses for noise channels (this didn't seem to be documented anywhere, so I investigated it myself - it's different from the regular music channels, and uses drum presets)

  • pkms.asm - Macros and equates for ASM files created with RBY Music Importer. (PKMS is what I call the Pokemon RBY music format, standing for Pokemon Music System)

  • rgbasm.exe - GB compiler, part of RGBDS suite

  • xlink.exe - GB linker, part of RGBDS suite

How to Use: A Tutorial

To illustrate how to use RBY Music Importer, we're going to import the sample song (route202.ftm) and replace Pallet Town's music with it. Here's a step-by-step guide (I suck at writing tutorials but hopefully you'll understand this):

  • Open up RBY Music Importer and go to the FTM->ASM section. Load route202.ftm using the Load FTM button.

  • Using the DataCrystal ROM map of Pokemon Red, you'll find that Pallet Town's music data starts at $A7C5, so put in $A7C5 as the start offset.

  • Check the "Import noise channel" box. You don't need to change the tempo for this particular song, but you might need to for other songs (more on that later).

  • Click the "Make ASM File" button. RBY Music Importer will generate an .asm file called route202.asm. At this point you have one of two options: either you can go and tweak the ASM file (changing notes, adding effects like vibrato and modulation, etc.), or just proceed straight to .BIN conversion. Let's go straight to .BIN conversion and injecting, for the purposes of this tutorial.

  • Go to the ASM->BIN section and load the route202.asm file we just created.

  • Click the "Inject music into ROM" checkbox.

  • Set $A7C5 (the same offset as above) as the injection offset. (If you changed the start offset in the ASM file, you'd put that value here instead.) Using the same ROM map as above, you'll find that Pallet Town's song pointers start at $822E, so input that for the pointer offset.

  • Click the "Compile BIN File" button.

  • Done! If you did everything right, when you load your RBY ROM, Pallet Town's music should be replaced with Route 202!

Special Notes

There doesn't appear to be any hard-set formula for converting Famitracker song tempo into PKMS song tempo, but here are a few tempo matchups which might be useful to you:

$E0 - speed 6, tempo 85
$D0 - speed 6, tempo 90
$C0 - speed 6, tempo 100
$B0 - speed 6, tempo 110
$A0 - speed 6, tempo 120
$90 - speed 6, tempo 140
$80 - speed 6, tempo 160
$70 - speed 6, tempo 180
$60 - speed 6, tempo 200
$50 - speed 6, tempo 220
$40 - speed 6, tempo 260
$30 - speed 6, tempo 340

Finally, I'd like to thank:

  • Coolboyman and Melash, for creating the document I linked

  • Data Crystal, for their Pokemon ROM map

So yeah, that's all. Hopefully this utility will be useful to somebody other than me.

Offline

#2 1970-01-01 00:33:30

Luigi-San
Member
Registered: 2010-10-16
Post 16/129

Re: RBY Music Importer (for .FTMs)

It never asked me for the song pointer offset.

Offline

#3 1970-01-01 00:33:30

Sonic65
New member
Registered: 2010-10-16
Post 2/4

Re: RBY Music Importer (for .FTMs)


It never asked me for the song pointer offset.

Wait, it didn't? Did you say Yes when it asked you whether you wanted to inject the song in or not?

Works fine on here and on the other computers in the house.

Offline

#4 1970-01-01 00:33:30

Luigi-San
Member
Registered: 2010-10-16
Post 17/129

Re: RBY Music Importer (for .FTMs)


It never asked me for the song pointer offset.

Wait, it didn't? Did you say Yes when it asked you whether you wanted to inject the song in or not?

Works fine on here and on the other computers in the house.

Yeah, I said yes.

Offline

#5 1970-01-01 00:33:30

~Red
Member
Registered: 2010-10-16
Post 56/276

Re: RBY Music Importer (for .FTMs)

You could've atleast made it possible to show errors. Whenever I try to compile to bin it throws a compilation error at me and when I attempt to view the errors the prompt closes before I can so I don't know what the problem is. Fix it please.


EDIT: I tried a different file and it just caused my game to freeze when the music was supposed to play.

Offline

#6 1970-01-01 00:33:30

Sonic65
New member
Registered: 2010-10-16
Post 3/4

Re: RBY Music Importer (for .FTMs)

Updated OP with new version (the interface's also been slightly changed, so check the also-updated tutorial if there's any confusion). Hopefully this will fix some of the bugs people are having.

Offline

#7 1970-01-01 00:33:30

38/703

Re: RBY Music Importer (for .FTMs)

Looks like a useful tool. Haven’t tried it yet, but I certainly like the idea.

#8 1970-01-01 00:33:30

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 298/3,578

Re: RBY Music Importer (for .FTMs)

This seems like a pretty nifty program. I haven't tried it out as I don't hack Red myself, but I'm sure people will find it useful. Do you think it would be possible to make a version that compiles songs in the GSC format as well?

Offline

#9 1970-01-01 00:33:30

Miksy91
Member
Registered: 2010-10-16
Post 148/2,339

Re: RBY Music Importer (for .FTMs)

I'm not that big fan of D/P/P but that was just amazing in R/B/Y  :D

Btw Sonic65, you made a really nice tool (and the one for G/S/C wouldn't hurt either)  ☺

Offline

#10 1970-01-01 00:33:30

39/703

Re: RBY Music Importer (for .FTMs)


This seems like a pretty nifty program. I haven't tried it out as I don't hack Red myself, but I'm sure people will find it useful. Do you think it would be possible to make a version that compiles songs in the GSC format as well?

Should be.

#11 1970-01-01 00:33:30

~Red
Member
Registered: 2010-10-16
Post 57/276

Re: RBY Music Importer (for .FTMs)

Still does not work. Still freezes the game when the music loads. Only route202.asm has worked so far.

Offline

#12 1970-01-01 00:33:30

Sonic65
New member
Registered: 2010-10-16
Post 4/4

Re: RBY Music Importer (for .FTMs)


Still does not work. Still freezes the game when the music loads. Only route202.asm has worked so far.

Can you attach/send the .ftm file you used? All the .ftms I tried are working (though most of them are ones I've composed/sequenced myself).

Alternatively, try importing without the noise channel enabled.

Remember, it doesn't support Famitracker effects as of now (this shouldn't cause any huge problems because the code skips over them but maybe there's a bug there).

Offline

#13 2011-09-02 10:54:46

~Red
Member
Registered: 2010-10-16
Post 144/276

Re: RBY Music Importer (for .FTMs)

Here is the ftm file. I'm trying to overwrite Route 12's music:

http://www.mediafire.com/?hj0hj67x9b6yuh2

Offline

#14 2012-11-10 06:14:46

hacker
Member
From: Batam Grove City
Registered: 2011-07-30
Post 338/548
Website

Re: RBY Music Importer (for .FTMs)

Btw, did you guys have RSE trainer battle song ftm?
If yes, could you guys posting to this thread pleease..,

I've the song too, but I can't play it in Famitracker.,
So, I need your help guys.. :)


[POKÉMON JOURNEY] hacking planning 2012
Visit my website  www.pokemonhackingblog.blogspot.com

Offline

#15 2013-05-07 19:21:49

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 217/1,199
Website

Re: RBY Music Importer (for .FTMs)

Could someone tell me what the Vibrato effect is in ASM code?


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#16 2013-05-10 14:47:19

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

Re: RBY Music Importer (for .FTMs)

Try pkmsSetMod


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

Offline

#17 2013-05-11 16:17:41

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 239/1,199
Website

Re: RBY Music Importer (for .FTMs)

FroggestSpirit wrote:

Try pkmsSetMod

How does that work?


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#18 2013-05-27 14:00:37

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 284/1,199
Website

Re: RBY Music Importer (for .FTMs)

The Trainer Battle music is stored at $22919


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#19 2013-09-14 18:13:24

Zlew
New member
Registered: 2013-09-14
Post 1/9

Re: RBY Music Importer (for .FTMs)

THE LINK is dead
reupload plz

Offline

#20 2013-09-14 18:17:22

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 741/1,199
Website

Re: RBY Music Importer (for .FTMs)

I can upload it, if the creator finds it OK.


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#21 2014-07-23 21:44:09

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,102/1,199
Website

Re: RBY Music Importer (for .FTMs)

I have decided to re-upload rbyImport, so everyone who hasn't dowloaded it but wanted to can also enjoy the program.
Credits to Sonic65.


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#22 2014-11-13 00:15:04

Deathkiller90
New member
Registered: 2014-11-12
Post 1/2

Re: RBY Music Importer (for .FTMs)

Theres a bit of a problem... I can't find a rom for Pokemon Red/Blue/Yellow that has a format of .gbc, or .bin, Can you add .gb, Video Tutorial, a more specific Tutorial or am I doing something wrong? I just made this Awesome remake of the music from Deku Palace from Majora's mask in Famitracker. If not can you at least tell me where to find the correct ROM?

(EDIT: I found out you can just change the .gb into the .gbc format and still work, I just feel stupid now.)
(EDIT 2: Now it keeps crashing when it trys to play, I got the pointers Right, I will give you a download link to the FTM file.)


(Deku Palace: http://www.mediafire.com/download/bbm8m … Palace.ftm )

Also when I check the asm file, It shows that its blankish, None of the channels, There REALLY needs to be a video tutorial.

Last edited by Deathkiller90 (2014-11-13 01:09:50)

Offline

#23 2014-11-13 01:45:54

YORAMRW
Member
From: The Netherlands
Registered: 2013-03-29
Post 1,130/1,199
Website

Re: RBY Music Importer (for .FTMs)

Deathkiller90 wrote:

Theres a bit of a problem... I can't find a rom for Pokemon Red/Blue/Yellow that has a format of .gbc, or .bin, Can you add .gb, Video Tutorial, a more specific Tutorial or am I doing something wrong? I just made this Awesome remake of the music from Deku Palace from Majora's mask in Famitracker. If not can you at least tell me where to find the correct ROM?

(EDIT: I found out you can just change the .gb into the .gbc format and still work, I just feel stupid now.)
(EDIT 2: Now it keeps crashing when it trys to play, I got the pointers Right, I will give you a download link to the FTM file.)


(Deku Palace: http://www.mediafire.com/download/bbm8m … Palace.ftm )

Also when I check the asm file, It shows that its blankish, None of the channels, There REALLY needs to be a video tutorial.

Edit 1: :P
Edit 2: There are a lot of things that are needed to make this method work, and it can be very difficult and tedious to make it all work properly. You need the right versions of FamiTracker to make working FTM's. I recommend to make them in 0.3.6 and then open them in 0.3.5 and overwrite them in that version after you set New style to Old style in the module properties.
Also, the FTM's can't be too complicated because the program as far as I know only recognizes the length of each note by the volumes you have typed in the note bar, the pulse duty you gave an instrument and the notes itself.
In the most cases, you need to edit the output ASM manually because the program puts random mistakes in it. If want it, you could also edit the ASM a little to make it even better before you inject it into the ROM. When you inject it, you have to give an offset and pointer of an existing song to replace (example: Pallet Town: offset = $A7C5, pointer = $822E).
If you are good at hex editing, you can even edit the code of your song and make it fancier with effects like arpeggiated duty, which I did once.

A short tutorial from me, I hope it helps you and maybe other people a bit. ;)


Hacks Gameboy 8-bit music in Pokémon Gen I & II, composes 8-bit music in FamiTracker

Offline

#24 2014-11-13 02:28:56

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

Re: RBY Music Importer (for .FTMs)

At this point, you're better off composing a midi and using mtolly's pokemid to create a source file that works with pokered.

Offline

#25 2014-11-13 04:08:11

Deathkiller90
New member
Registered: 2014-11-12
Post 2/2

Re: RBY Music Importer (for .FTMs)

I just started this FamiTracker thing, and I wish I knew how to bring the Deku Palace thing into 0.3.5... Because the version i'm using is the Newest one.

Offline

Board footer

Powered by FluxBB