Moving and Importing Music Data

From ZeldaHacking Wiki
Jump to navigation Jump to search

Occasionally, you might want to import music from one of the Oracles games to the other. In this page, we'll give you an example on how to do just that.

Sound Pointers

For this example, we will import overworldPast.s from Oracle of Ages into Seasons. The three main .s files must be edited. We will start with audio/seasons/soundPointers.s. Decide which index will be replaced with musOverworldPast (the base label for the music data). Reminder that music only goes up to index $4b, and therefore another piece must be replaced. There are several blank indices, but if you use those, you might run into storage issues in a later step. For this example, we will replace musCarnival, index $08.

Constants

An additional step would be to change the constant at constants/common/music.s, but this is not required. It is however recommended to close the project in LynnaLab when editing these constants.

Sound Channel Pointers

The next step is to either add or replace the the channel pointers at audio/seasons/soundChannelPointers.s. In our case, we would replace the one referencing musCarnival to musOverworldPast.

musCarnival:
	.db $00
	.dw musCarnivalChannel0
	.db $01
	.dw musCarnivalChannel1
	.db $04
	.dw musCarnivalChannel4
	.db $06
	.dw musCarnivalChannel6
	.db $ff

becomes

musOverworldPast:
	.db $00
	.dw musOverworldPastChannel0
	.db $01
	.dw musOverworldPastChannel1
	.db $04
	.dw musOverworldPastChannel4
	.db $06
	.dw musOverworldPastChannel6
	.db $ff

Sound Channel Data

Finally, we will need to either add or replace the actual music data into soundChannelData.s. We can place this anywhere as long as it fits within the bank, but we'll replace the .include of carnival to overworldPast in our case. If it doesn't fit, we can delete other music data, but we would need to remove the references as well. Therefore,

.include "audio/seasons/mus/carnival.s"

is replaced by

.include "audio/ages/mus/overworldPast.s"

For consistency, we could move the music data to the appropriate games' folder, but this is not necessary.