-
Notifications
You must be signed in to change notification settings - Fork 3
Sound and Music workflow
Jay Garcia edited this page Jan 8, 2020
·
4 revisions
https://github.com/ModusCreateOrg/modite-adventure/wiki/Development-Workflow
- Music : Open ModPlug Tracker
- SFX : Any Sound editor
Most of the below is for new, but the "edit" workflow is similar, minus the additions.
- Add a song to
<project_root>/modite-adventure-resources/resources/music
. - Add the to
<project_root>/modite-adventure/src/Resources.r
like the following:
########### SOUND :: MUSIC ###########
PATH resources/music/
RAW EmptySong.xm <--- Do not touch this one
RAW Main_Menu.xm
RAW Your_New_Song.xm
- Compile resources :
# within modite-adventure/
make resources
If the above fails, you may have not named file appropriately in Resources.r
.
- Add your song to the game by editing
GSoundPlayer.cpp
(inmodite-adventure/src/
)
static const TUint16 allSongs[] = {
EMPTYSONG_XM,
MAIN_MENU_XM,
YOUR_NEW_SONG_XM
};
- Add your song to the area within the game you'd like to play. Eg. Main Menu:
GMainMenuState::GMainMenuState() : BGameEngine(gViewPort) {
gSavedGameList.LoadSavedGameList();
mFont16 = new BFont(gResourceManager.GetBitmap(FONT_16x16_SLOT), FONT_16x16);
mPlayfield = new GMainMenuPlayfield();
AddProcess(new GMainMenuProcess());
gWidgetTheme.Configure(
WIDGET_TEXT_BG, COLOR_TEXT_BG,
WIDGET_TITLE_FONT, mFont16,
WIDGET_TITLE_FG, COLOR_TEXT,
WIDGET_TITLE_BG, -1,
WIDGET_WINDOW_BG, gDisplay.renderBitmap->TransparentColor(),
WIDGET_WINDOW_FG, gDisplay.renderBitmap->TransparentColor(),
WIDGET_END_TAG);
gDisplay.SetColor(COLOR_TEXT, 255, 255, 255);
gDisplay.SetColor(COLOR_TEXT_BG, 255, 92, 93);
#ifdef ENABLE_AUDIO
gSoundPlayer.PlayMusic(MAIN_MENU_XM);
#endif
}
- Run the game, go to whatever area of the game to listen to the music :)
- If the above fails, check
Resources.h
for your song and make sure yourpre-processor
reference (Eg.MAIN_MENU_XM
) is correct.
- All Songs should use no more than 10 channels and saved in the Impluse Tracker (XM) format.
- Songs use 8-bit samples from NES, and Gameboy
- Use the
SONG_TEMPLATE.xm
for new song creations - SFX files should be saved in 16Bit 44.1Khz Mono Windows Wave (
.wav
).
All resources are stored within the Modite Adventure Resources repository within:
resources/ ├── music └── sound_effects
-
Important: Only special characters allowed in song names are
_
and.
; - Music:
Song_Title.xm
- SFX:
SFX_some_action.wav
.
Examples:
├── SFX_empty.wav ## Please do not edit
├── SFX_enemy_death.wav
├── SFX_enemy_take_damage.wav
├── SFX_item_heart.wav
├── SFX_player_earn_key.wav
├── SFX_player_quaff_fire_spell.wav
├── SFX_player_slash.wav
└── SFX_player_take_damage.wav