Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decompile songs to MIDI files #137

Merged
merged 105 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
49c1d2c
Dump songs to MIDI files.
laqieer Jan 4, 2022
6af0963
Dump MIDI files with camthesaxman/pokeruby_mus_riper fork of gba-mus-…
laqieer Jan 4, 2022
8b6fe81
Add MPlayDef.s.
laqieer Jan 4, 2022
7355db6
Fix dummy song.
laqieer Jan 5, 2022
fd9ed69
Make MIDI files to build.
laqieer Jan 5, 2022
c0c04b5
Replace song001.mid with the one dumped by VGMusicStudio but it still…
laqieer Jan 6, 2022
f015818
Remove useless line endings conversion for .pal files in Makefile.
laqieer Mar 1, 2022
2963c4c
Remove label gcc2_compiled.
laqieer Mar 2, 2022
b4c3111
Merge branch 'FireEmblemUniverse:master' into master
laqieer Apr 25, 2022
56ec986
Fix make clean.
laqieer Apr 28, 2022
0ec9639
Fix: note doesn't end.
laqieer Apr 28, 2022
1105344
Add some workarounds to mid2agb from https://github.com/freshollie/sa2.
laqieer Apr 28, 2022
b211702
Comment some bugs in sound dump script to generate songs.mk.
laqieer Apr 28, 2022
fb1f6ba
Split songs with different size to non_matching folder.
laqieer Apr 28, 2022
5ebc938
Add workaround to fix track alignment.
laqieer Apr 29, 2022
74c58f4
Fix Makefile.
laqieer Apr 29, 2022
65ad237
Match song067.
laqieer Apr 30, 2022
ef859ec
Revert "Add some workarounds to mid2agb from https://github.com/fresh…
laqieer Apr 30, 2022
13a8c4d
Re-export all midis with VGMusicStudio's reverse volume feature on.
laqieer Apr 30, 2022
bdbe480
Fix volumes set in songs.mk.
laqieer Apr 30, 2022
1854281
Fix song067's KEYSH order.
laqieer Apr 30, 2022
1c789ec
Fix song072's KEYSH order.
laqieer Apr 30, 2022
4b58ad9
Fix value of v069.
laqieer Apr 30, 2022
570fbc9
Fix song096's time signature.
laqieer May 1, 2022
8ced17c
Fix KEYSH order in song 101, 102, 103, 104, 105, 106, 107, 110.
laqieer May 1, 2022
96d083c
Change song115's time signature to 1/4.
laqieer May 1, 2022
3a6d06e
Change song130's time signature to 1/4.
laqieer May 1, 2022
6c9daaa
Change song133's time signature to 1/4.
laqieer May 1, 2022
d18984e
Change song136's time signature to 1/4.
laqieer May 1, 2022
070bffa
Change song171's time signature to 1/4.
laqieer May 1, 2022
69dbdfd
Change song175's time signature to 1/4.
laqieer May 1, 2022
c577968
Change song180's time signature to 1/4.
laqieer May 1, 2022
ef21f2f
Change song181's time signature to 1/4.
laqieer May 1, 2022
3cc9721
Fix KEYSH order in song 117, 118, 122.
laqieer May 1, 2022
32348fc
Add script to edit time signature and use it to change song182's time…
laqieer May 1, 2022
aca4ba9
Batch change time signature with scripting.
laqieer May 1, 2022
b34d847
Add MML compatible mode for mid2agb and use it to match song700.
laqieer May 2, 2022
9136b88
Add script to omit volume 127 at the start of track for MML compatibl…
laqieer May 2, 2022
b94d81f
Improve MML compatible mode and use it to match most songs converted …
laqieer May 2, 2022
7f38073
Change song785's time signature to 7/4.
laqieer May 2, 2022
469a206
Disable velocity optimization and match song805.
laqieer May 2, 2022
45e3fa1
Change song962's time signature to 5/4.
laqieer May 2, 2022
ac9f353
MML compatible mode cannot match song962.
laqieer May 2, 2022
28fe7f8
Disable compression for some songs converted from MML to match them.
laqieer May 2, 2022
310abc2
Remove confirmed unmatchable MML songs from songs/midi/non_matching.
laqieer May 2, 2022
fc1ae82
Change song058's time signature to 6/4.
laqieer May 2, 2022
e347b10
Change song063's time signature to 3/4.
laqieer May 2, 2022
c54906a
Change song058's time signature to 3/4.
laqieer May 2, 2022
a0afbdb
Change song092's time signature to 1/4.
laqieer May 2, 2022
d639df4
Change song113's time signature to 1/4.
laqieer May 2, 2022
3985a2a
Change song141's time signature to 1/4.
laqieer May 2, 2022
c842e71
Change song143's time signature to 1/4.
laqieer May 2, 2022
0e34ad4
Change song142's time signature to 1/4.
laqieer May 2, 2022
8b669c5
Change song179's time signature to 1/4.
laqieer May 2, 2022
7dd82f3
Change song186's time signature to 1/4.
laqieer May 2, 2022
b9e7b4f
Change song230's time signature to 1/4.
laqieer May 2, 2022
5471bea
Change song251's time signature to 1/4.
laqieer May 2, 2022
06f0694
Change song253's time signature to 1/4.
laqieer May 2, 2022
9e33b7f
Change song258's time signature to 1/4.
laqieer May 2, 2022
e8ab178
Change song266's time signature to 1/4.
laqieer May 2, 2022
47d19f3
Change song276's time signature to 1/4.
laqieer May 2, 2022
0b4447e
Change song292's time signature to 1/4.
laqieer May 2, 2022
ae98227
Change song304's and song305's time signature to 1/4.
laqieer May 2, 2022
20dc585
Change song312's, song313's and song315's time signature to 1/4.
laqieer May 2, 2022
4b87e79
Change song617's time signature to 3/4 and fix its tune.
laqieer May 2, 2022
26ae88a
Change song618's time signature to 1/4.
laqieer May 2, 2022
97cbd17
Change song896's time signature to 1/4.
laqieer May 2, 2022
4be8c7f
Change song976's time signature to 1/4.
laqieer May 2, 2022
f851dcc
Change song090's time signature to 1/4.
laqieer May 2, 2022
31c7000
Change song109's time signature to 1/4.
laqieer May 2, 2022
eb61d1d
Change song123's time signature to 1/4.
laqieer May 2, 2022
ad9b09f
Change song129's time signature to 1/4.
laqieer May 2, 2022
4d0f71c
Change song144's time signature to 1/4.
laqieer May 2, 2022
af5c4fe
Change song145's time signature to 1/4.
laqieer May 2, 2022
5b68864
Change song116's time signature to 1/4 and omit the volume.
laqieer May 2, 2022
09a0ebb
Change song322's time signature to 1/4.
laqieer May 2, 2022
2ccbb89
Change song055's time signature to 3/4.
laqieer May 2, 2022
072fc94
Remove song617 from non_matching because it has been matched.
laqieer May 2, 2022
efd80bc
Match song010 by Shift its time signature.
laqieer May 3, 2022
611ecb3
Shift song002's time signature by 24 ticks.
laqieer May 3, 2022
d36d715
Change song007's time signature to 3/4 +24.
laqieer May 3, 2022
72128b2
Shift song009's time signature by 24.
laqieer May 3, 2022
48b1fd3
Shift song011's time signature by 24.
laqieer May 3, 2022
1e87958
Change song014's time signature to 3/4.
laqieer May 3, 2022
84da87d
Change song018's time signature to 3/4.
laqieer May 3, 2022
b20e003
Change song023's time signature to 3/4.
laqieer May 3, 2022
8313e75
Change song029's time signature to 3/4.
laqieer May 3, 2022
f8f663b
Change song031's time signature to 3/4 +24.
laqieer May 3, 2022
637cf1b
Change song032's time signature to 3/4.
laqieer May 3, 2022
55df13f
Shift song023's time signature by 24.
laqieer May 3, 2022
a69742e
Change song044's time signature to 3/4.
laqieer May 3, 2022
482c031
Change song045's time signature to 3/4.
laqieer May 3, 2022
0bd2a06
Change song046's time signature to 3/4 +24.
laqieer May 3, 2022
9141bbd
Shift song066's time signature by 24.
laqieer May 3, 2022
645411b
Change song068's time signature to 3/4.
laqieer May 3, 2022
6f78c2d
Shift song069's time signature by 24.
laqieer May 3, 2022
8d06134
Match song027 by adding time signatures and fixing its length.
laqieer May 3, 2022
a0bb889
Match song028 by adding time signatures.
laqieer May 3, 2022
3dc0b67
Match song038 by adding time signatures.
laqieer May 3, 2022
0f343ee
Match song057 by adding time signatures.
laqieer May 3, 2022
4be270d
Merge branch 'FireEmblemUniverse:master' into master
laqieer May 3, 2022
4ac4ae6
Merge branch 'master' into midi
laqieer May 3, 2022
5464368
Move song814, song815, song816, song962 to mml folder.
laqieer May 3, 2022
a5e5dba
Rename all songs to meaningful names.
laqieer May 3, 2022
4dd7fa0
Remove songs.ini.
laqieer May 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,11 @@ MigrationBackup/
gccdump/

# Artifact of dump_sound
scripts/dump_sound/bin
scripts/dump_sound/obj
scripts/dump_sound/sound
scripts/dump_sound/sound.s
!scripts/dump_sound/Program.cs
scripts/dump_sound/

# Converted sound samples
sound/direct_sound_samples/*.bin

# Converted songs
sound/songs/midi/*.s
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CPP ?= $(PREFIX)cpp$(EXE)
AS := $(PREFIX)as$(EXE)
LD := $(PREFIX)ld$(EXE)
OBJCOPY := $(PREFIX)objcopy$(EXE)
STRIP := $(PREFIX)strip$(EXE)

CC1 := tools/agbcc/bin/agbcc$(EXE)
CC1_OLD := tools/agbcc/bin/old_agbcc$(EXE)
Expand All @@ -25,6 +26,7 @@ BIN2C := tools/bin2c/bin2c$(EXE)
GBAGFX := tools/gbagfx/gbagfx$(EXE)
SCANINC := tools/scaninc/scaninc$(EXE)
AIF2PCM := tools/aif2pcm/aif2pcm$(EXE)
MID2AGB := tools/mid2agb/mid2agb$(EXE)

ifeq ($(UNAME),Darwin)
SED := sed -i ''
Expand All @@ -46,23 +48,26 @@ ASFLAGS := -mcpu=arm7tdmi -mthumb-interwork -I include

C_SUBDIR = src
ASM_SUBDIR = asm
DATA_ASM_SUBDIR = data
DATA_SUBDIR = data
SAMPLE_SUBDIR = sound/direct_sound_samples
MID_SUBDIR = sound/songs/midi

ROM := fireemblem8.gba
ELF := $(ROM:.gba=.elf)
MAP := $(ROM:.gba=.map)
LDSCRIPT := ldscript.txt
SYM_FILES := sym_iwram.txt sym_ewram.txt
CFILES := $(wildcard src/*.c)
ASM_S_FILES := $(wildcard asm/*.s)
DATA_S_FILES := $(wildcard data/*.s)
SOUND_S_FILES := $(wildcard sound/*.s sound/songs/*.s)
CFILES := $(wildcard $(C_SUBDIR)/*.c)
ASM_S_FILES := $(wildcard $(ASM_SUBDIR)/*.s)
DATA_S_FILES := $(wildcard $(DATA_SUBDIR)/*.s)
SOUND_S_FILES := $(wildcard sound/*.s sound/songs/*.s sound/songs/mml/*.s)
SFILES := $(ASM_S_FILES) $(DATA_S_FILES) $(SOUND_S_FILES)
C_OBJECTS := $(CFILES:.c=.o)
ASM_OBJECTS := $(SFILES:.s=.o)
BANIM_OBJECT := data/banim/data_banim.o
ALL_OBJECTS := $(C_OBJECTS) $(ASM_OBJECTS) $(BANIM_OBJECT)
MID_FILES := $(wildcard $(MID_SUBDIR)/*.mid)
MID_OBJECTS := $(MID_FILES:.mid=.o)
ALL_OBJECTS := $(C_OBJECTS) $(ASM_OBJECTS) $(BANIM_OBJECT) $(MID_OBJECTS)
DEPS_DIR := .dep

# Use the older compiler to build library code
Expand All @@ -87,6 +92,8 @@ clean:
$(RM) -f data/banim/*.bin data/banim/*.o data/banim/*.lz data/banim/*.bak
# Remove converted sound samples
$(RM) -f $(SAMPLE_SUBDIR)/*.bin
# Remove converted songs
$(RM) -f $(MID_SUBDIR)/*.s

.PHONY: clean

Expand All @@ -100,6 +107,7 @@ tag:
# Graphics Recipes

include graphics_file_rules.mk
include songs.mk

%.s: ;
%.png: ;
Expand All @@ -109,15 +117,7 @@ include graphics_file_rules.mk
%.1bpp: %.png ; $(GBAGFX) $< $@
%.4bpp: %.png ; $(GBAGFX) $< $@
%.8bpp: %.png ; $(GBAGFX) $< $@
%.gbapal: %.pal
ifneq ($(OS),Windows_NT)
ifeq ($(UNAME),Darwin)
$(SED) $$'s/\r*$$/\r/' $<
else
$(SED) -e 's/\r*$$/\r/' $<
endif
endif
$(GBAGFX) $< $@
%.gbapal: %.pal ; $(GBAGFX) $< $@
%.gbapal: %.png ; $(GBAGFX) $< $@
%.lz: % ; $(GBAGFX) $< $@
%.rl: % ; $(GBAGFX) $< $@
Expand Down Expand Up @@ -153,6 +153,7 @@ $(DEPS_DIR)/%.d: %.c

$(ELF): $(ALL_OBJECTS) $(LDSCRIPT) $(SYM_FILES)
$(LD) -T $(LDSCRIPT) -Map $(MAP) $(ALL_OBJECTS) -R $(BANIM_OBJECT).sym.o -L tools/agbcc/lib -o $@ -lc -lgcc
$(STRIP) -N .gcc2_compiled. $@

%.gba: %.elf
$(OBJCOPY) --strip-debug -O binary --pad-to 0x9000000 --gap-fill=0xff $< $@
Expand Down
1 change: 1 addition & 0 deletions build_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ make -C tools/gbagfx
make -C tools/scaninc
make -C tools/bin2c
make -C tools/aif2pcm
make -C tools/mid2agb
1 change: 1 addition & 0 deletions build_tools_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ make -C tools/gbagfx CXX=clang++
make -C tools/scaninc CXX=clang++
make -C tools/bin2c CXX=clang++
make -C tools/aif2pcm CXX=clang++
make -C tools/mid2agb CXX=clang++
2 changes: 1 addition & 1 deletion ldscript.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ SECTIONS
. = ALIGN(4); data/const_data_205714.o(.rodata);
. = ALIGN(4); src/statscreen.o(.rodata);
. = ALIGN(4); data/const_data_205B84.o(.rodata);
INCLUDE "linker_script_sound.txt"
INCLUDE "songs.txt"
. = ALIGN(4); src/agb_sram.o(.rodata);
. = ALIGN(4); *libc.a:vfprintf.o(.rodata);
. = ALIGN(4); *libc.a:dtoa.o(.rodata);
Expand Down
Loading