-
Notifications
You must be signed in to change notification settings - Fork 18
Cookbook Audio
Def shapes and the full pipeline: Guide: Audio Authoring; worked path: Tutorial 09.
mod.content.map_songs:override("PALLET_TOWN", "Music_Routes1")Checkpoint: Pallet Town plays the Route 1 theme. map_songs maps map id
to a music id; a new song registered through music slots in the same
way.
mod.content.sfx:override("Save", { file = mod.assets:path("assets/save.ogg") })Checkpoint: saving plays your sound; every other SFX stays chip-synthed. Defs are shape-dispatched per id — replacing one never touches the rest. A def that fails to load is skipped with a mod-attributed log line when its cue fires.
local ChipAsm = require("src.audio.ChipAsm")
mod.content.music:register("Music_ModChip", ChipAsm.song({
tempo = 140,
channels = {
{ program = {
{ label = "top" },
{ notetype = { speed = 12, volume = 15, fade = 2 } },
{ octave = 4 },
{ note = "C", len = 4 }, { note = "E", len = 4 },
{ note = "G", len = 4 },
{ loop = { count = 0, to = "top" } },
} },
},
}))
mod.content.map_songs:override("PALLET_TOWN", "Music_ModChip")Checkpoint: an authentic GB channel program plays with no audio file in
the mod. src.audio.ChipAsm is a supported require; the event
vocabulary is in Audio Authoring.
MSU protocol is not implemented; streamed { file, loopFile } songs are
the supported path for CD-quality replacements:
mod.content.music:override("Music_PalletTown", {
file = mod.assets:path("assets/pallet_intro.ogg"),
loopFile = mod.assets:path("assets/pallet_loop.ogg"),
})Checkpoint: Pallet Town plays your OGG; other maps stay chip. Pair with
music.select if you need contextual swaps.
mod.hooks:wrap("music.volume", function(next, vol, ctx)
vol = next(vol, ctx)
if ctx.mapId and ctx.mapId:find("POKECENTER") then
return vol * 0.5 -- muffled indoors
end
return vol
end)Checkpoint: centers are quieter; the hook re-runs every frame while
wrapped so tile-distance ramps work too (ctx.x / ctx.y).
Engine 1.0.0 · mod API 2 · repository · Discord
This project ships no ROM data. All game content is decoded on the player's machine from their own verified Pokemon Red ROM; mods ship recipes and original assets, never extracted content.
Start here
Concepts
Tutorials
- The ladder
- 01 Sprite and Text Tweak
- 02 Balance Patch
- 03 New Species
- 04 New Item and Ball
- 05 New Move
- 06 NPC and Dialogue
- 07 New Map
- 08 Quest
- 09 Custom Music
- 10 New Mechanic
- 11 Custom UI Screen
- 12 Mini Total Conversion
Reference
Guides
- Art Pipeline
- Audio Authoring
- Translations
- Total Conversions
- Link Compatibility
- Publishing a Mod
- Docs Style Guide
Playing