Skip to content

Advanced Custom Audio

Kosei edited this page Feb 17, 2024 · 21 revisions

This page contains tutorials and explanations of the more advanced audio features in FMOD and Celeste. None of this is required if you just want to get custom audio into your mod. All the sections here can be read independently from one another, and no knowledge is assumed aside from what is taught in the Adding Custom Audio page, i.e. the basics of FMOD and custom audio (how to import audio files, re-route them into the right bus, adding loops, fade and modulation, adding the audio to your map, etc).

Planned/WIP:

Feel free to contribute your own!


Understanding Parameters

Understanding how parameters interact with the game's code and their purpose in FMOD Studio is extremely helpful in implementing your own audio features to make your audio more dynamic in-game. However, this is not essential knowledge; if you follow the tutorials on this page exactly as they are, you can add things like layers or progression without ever understanding exactly what a parameter does. This section is just here in case you are curious and want to fill the gaps in your knowledge.

Parameters can be found along the top of the event next to Timeline. They are essentially just tags with a name and a value between two numbers that can be changed at will. These names should be distinct and describe a certain function or purpose within the game. When added to an event, knobs will appear above them that can be turned to mimic how the game will change that parameter's value, and if you hit play on the event, the resulting effects on the audio will be applied in real time.

If you have followed the Adding Custom Audio page, then you have already implemented a basic parameter: fade:

  • You created a curve that changed the volume of the event based on the value of fade, where a value of 1 corresponded to 0 dB (full volume) and a value of 0 corresponded to -∞ dB (no volume). In FMOD, this is referred to as automation, and many different properties of an event and its audio can be controlled in this way.
  • You could now adjust the volume of the music in-game using the Music Fade Trigger in Lönn. This is because when this trigger is entered by the player, the game tells FMOD "change the value of the parameter with the name fade from this value to that value". Because you specified in FMOD Studio that changing the value of fade should correspond to a change in volume according to the curve, the FMOD audio engine carries out that change in volume.

Thus, the primary function of parameters is to provide an easy link between the game's code and FMOD Studio, so that effects like this volume change can be setup in FMOD Studio using its interface and tools rather than doing so via complicated code, and all the game code has to do is provide the name of a parameter and adjust its value on a certain condition (like entering a trigger).

Other common examples of these interactions include:

  • The Music Progress and Ambience Progress boxes in the Lönn Room Config tell FMOD to change the value of the parameter specifically named progress for the music or ambience currently present in that room to the specified value.

  • The Music Layer 1 box in the Lönn Room Config tells FMOD to change the value of the parameter specifically named layer1 for the music currently present in that room from 0 to 1 (same for Layer 2, Layer 3, etc).

  • If you go to the event music/menu/level_select in FMOD Studio, click on the moon tab and expand the main and moon audio tracks, you can see that their volume is automated to be the inverse of each other, meaning when one is active, the other is silent, and they will cross-fade into each other. In-game, when Farewell is selected and the overworld changes, the game code changes the value of the parameter named moon from 0 to 1, and thus the music changes. You can simulate this yourself in FMOD Studio by playing with the moon knob at the top.

The vanilla triggers and options built into Lönn have strict definitions for the parameter names that they are set to adjust, and do not take custom arguments. If you're looking to use custom parameters that don't fit these definitions, some community-made helpers provide more flexible triggers that allow you to input whatever parameter name you like, e.g. Shroom Helper's 🔗 Multilayer Music Fade Trigger and Communal Helper's 🔗 Music Param Trigger.


Ensuring priority of Music Events

Generally, FMOD plays sounds with so-called "instruments". Instruments can sometimes be stolen by other events of higher priority to save up on resources, and in the case of custom music events, this can lead to layers going out of sync. To avoid any issues caused by this behavior, we want to ensure that our music event has the highest level of priority.

To elevate the priority of a music event:

  1. Open your event in the editor, and make sure that the Master track is selected (it's always the track below everything).

  2. Look at the bottom-right of the window. You should see a couple of parameters dedicated to the event, including the Priority parameter.

  3. Click & hold the bar below "Priority", and drag your mouse to adjust the value to Highest. This makes other events unable to interfer with your music event, and fixes issues you might encounter with music layers, notably the out-of-sync issue.

  4. Save (either by using the menu bar, or by pressing Ctrl+S). This should be pretty much all, you only need to do it once per music event, and it takes little to no time at all.


Adding Layers to Music

Layers should be used when you have multiple audio tracks that all combine into one overall track, and you want to toggle the volume of these layers as you please. Layer toggling is pretty much instantaneous, so as soon as you enter a room with a new layer, it will increase to the volume you set it at.

A vanilla example of this is the Forsaken City music, where there are three layers (percussion, piano and synths) that get turned on and off as you move throughout the level. Teleport to room 10zb on the debug map and you’ll see how only the piano layer is playing, and then on entering the next room, the other two layers get turned back up and the track continues without a hitch.

A good event to reference to make sure you’re doing things correctly is music/lvl6/main, i.e. the track that plays during the first few checkpoints of Reflection before the Badeline fight.

To add layers to your custom music:

  1. Start by separating each of your audio files into Audio Tracks, with each Track containing all the audio files you want for a certain layer. Here, I have three audio files that I want to act as layers, so I’ve split them into Layer 1 - base, Layer 2 - percussion, and Layer 3 - peak.

  2. Create layer parameters:

    a. Open the Preset Browser by going to Window > Preset Browser, or pressing Ctrl+8.

    b. Select New Folder at the bottom of the window to create a new preset folder for your project. Use a unique name like yournickname_mapname.

    • You can also create subfolders in here if you would like to apply layers to separate pieces of custom music in your map and have them all housed under the one project folder.

    c. Select New Parameter at the bottom of the window to begin creating layerX parameters in the yournickname_mapname folder, where X is the layer number. Copy the values and syntax exactly as in the screenshot below. You need a layerX parameter for each Audio Track that you created previously, so repeat this process for as many as you need.

    Note: while you can re-use layer parameters from vanilla or from other projects/events, these layer parameters may apply slightly different effects to what you're looking for, so it is recommended to create a fresh set of layer parameters for each project and for each event in that project. If you'd like to use a vanilla set, I recommend using the ones in music > lvl6 > main > layer1/layer2/layer3.

  3. Add the layer parameters to your event by clicking the plus sign in the tabs at the top (next to Timeline) to open the parameter selection menu. Scroll to the preset folder you setup in the previous step, and add all of the layerX parameters you created.

  4. Add Volume Automation to the appropriate layer:

    a. Right click the volume knobs on each Audio Track and select Add Automation. Don’t mess with the volume just yet.

    b. Click on the layer1 tab, and click the small white triangle underneath the name of your first Audio Track. This should bring up the Volume tab and a straight, dotted red line.

    c. Click on this line to create a point, and drag that point all the way down to the bottom left corner at -∞ dB. Then, click on the line to create another point, and drag that point all the way to the top right corner at 0 dB.

    • You can leave the curve straight, or move the diamond in the middle to make the curve steeper/shallower, which will affect the rate at which the music increases in volume as the parameter value for this layer increases in-game. Nearly all vanilla tracks have a steeper curve, as it makes music changes a little bit smoother and less jarring.

    d. If you need to adjust the peak volume of the layer from 0 dB so that it mixes better and cannot do so with the source content outside of FMOD, go back to the Timeline, select the asset (the blue rectangle), and then adjust the volume using the knob that appears at the bottom left of the window:

    Now, when Layer 1 is called by the game (e.g. through the Lönn room config window, music layer triggers, etc) this Audio Track will increase from silent (-∞ dB) to the peak volume you specified, and will decrease back to silent in areas it is designated to be turned off.

  5. Repeat Step 4 for the other Audio Tracks to set them up as their own layers, i.e. in layer2, adjust the volume curve for your Layer 2 Audio Track, etc. Don’t touch the volume curve of an Audio Track outside of its layerX parameter, they should remain dotted (this just means that the volume is being controlled by something elsewhere).

And that should be it! An easy way to confirm that the layers are set up correctly without going in-game is by turning the layer1/layer2/etc knobs above the parameter list while the event is playing. Higher values should increase the volume of a particular layer and vice versa, while not affecting the volume of other layers. I strongly recommend that you read the next sub-section Adjusting Layer Seek Speed to properly polish off your audio, but it is optional.

Adjusting Layer Seek Speed

Seek speed is the speed at which the layer will automatically increase in volume when it is called by the game. You can see this in effect in the music/lvl6/main event - when you turn the layer1/layer2/layer3 knobs, the volume of that layer does not immediately increase, but instead a small orange dot indicates that FMOD is forcing the layer volume to be adjusted more gradually and smoothly. By default, your layers will instantly rise to the peak volume you specified and can thus be slightly jarring to listen to in-game, so if you're feeling confident enough, I'd highly recommend playing around with your seek speed values.

To implement this in your own layer parameters:

  1. Open the Preset Browser by going to Window > Preset Browser or pressing Ctrl+8, and find the layerX parameters in the project folder you setup previously.

  2. When you select one of your layerX parameters, some extra settings will appear at the bottom of the window. The dial labelled Seek Speed is what we're looking to adjust. The lower the value, the longer it takes for the layer volume to move along the volume curve you set out previously (both up and down the curve), and vice versa. Most vanilla layers have a seek speed of 0.25/s.

    Optional: you can set different values for seek speed up and down the volume curve by turning on Asymmetric, where Ascending affects the speed at which the volume increases, and Descending affects the speed at which the volume decreases. This may be useful if, for example, you would like a layer to swiftly rise in volume when triggered, but fade out at a much slower rate when turned off. An example of this can be found in layer3 of the vanilla event music/lvl4/main - turn the knob up on layer3 and you will see it takes around 6 seconds to increase to full volume, but when turning the knob back down, it takes well over 10 seconds to fully turn off. This layer3 parameter has an Ascending seek speed of 0.20/s and a Descending seek speed of 0.11/s.

One thing to note is that once you edit the seek speed of a particular layerX parameter, it will apply to all events that use that specific parameter, potentially creating unwanted effects in the audio for other projects. This is why the vanilla events have a specific set of layerX parameters for every individual event that uses them, and why it was recommended to create a preset folder/subfolder for each project/event that you would like to use layers in.


Adding Progression to Music

Progression is quite a versatile attribute in the Celeste FMOD project, and can be used in a few different ways. The sections below have generalised definitions of what each type of progression is used for (based on the vanilla Celeste implementation) in order to provide context for each, but put simply there is no easy answer for what type you use. How you go about implementing progression is going to depend directly on the audio you're working with or how you are composing, and it's not feasible to provide an exact template of which setup to use in any circumstance. Regardless, read the beginning of each section to see what's best suited to your desires, and if you're still unsure don't hesitate to ask around in the Celeste Discord for advice (please feel free to ping or DM @caeyo. (the author of this section) specifically if you're not getting suitable answers).

Progression using Transitions

Progression using transitions ideally should be used when you have a single piece of music with multiple sections that loop within themselves and will also seamlessly transition to the next section, and you’d like to make these transitions occur as the player moves through the map. Progression to the next section only occurs after the current section’s loop is finished, so if you increase the music progress to Section 2 in the current room, you will only start to hear that section’s music once Section 1 finishes its loop, and once the track has progressed to the next section, decreasing the progress value will not cause the track to move backwards.

A vanilla example of this is the music used in the Reconciliation checkpoint of Farewell, where there are 4 sections in total that seamlessly blend into each other as you progress through the level. This is also a good event to reference to make sure you’re doing things correctly, and can be found at new_content/music/lvl10/final_run. Ignore the toodamnfast parameter and the Intro/Transition Cymbal tracks, focus on the Main Loops.

To add progression using transitions to your custom music:

  1. Start with making the loop regions for each progression section of your track. Hopefully your music will loop nicely within each progression point as well as transition nicely into the next, as you need to be mindful of both scenarios when it comes for it to actually play in game. Here, I have seven audio files that make up the whole song, and I'd like to loop the files named 2, 4, 5, 6, and 7 while having 1 act as an intro and 3 act as a non-looping transition (I've staggered the loop regions in the Logic Track section for visual clarity, but this is not strictly necessary).

  2. Set down Destination Markers at the exact points that you want the playhead to move towards when the progression value is increased and the previous loop is finished. Right click the upper black region to add them. Call them whatever you want, but it's probably best to keep things simple and just refer to them as Section 1, 2, etc. I've created five sections - Section 1 contains the intro (1) and the first loop (2), Section 2 contains the non-looping transition (3) and the second loop (4), Section 3 contains the third loop (5) and so on.

  3. Once your Destination Markers are set, right click the upper black region once more, and use Add Transition To to add Transitions to each of those Destination Markers. The Transition to Section 1 should be placed right at the beginning of the event, with the other Transitions placed just after that (they can be in-line horizontally, but they all must be after the initial Transition). Do not use Transition Regions, they serve a different and more niche purpose.

  4. Create a progress parameter:

    a. Open the Preset Browser by going to Window > Preset Browser, or pressing Ctrl+8.

    b. Select New Folder at the bottom of the window to create a new preset folder for your project. Use a unique name like yournickname_mapname.

    • You can also create subfolders in here if you would like to apply progress to separate pieces of custom music in your map and have them all housed under the one project folder.

    c. Select New Parameter at the bottom of the window to create a progress parameter in the yournickname_mapname folder. You want the Maximum value to be 1 less than the number of Sections you set previously, so since I set 5 Sections in total, my maximum value is 4. Copy the rest of the values and syntax exactly as in the screenshot below. You only need one progress parameter for the whole Event.

    Note: while you can re-use progress parameters from vanilla or from other projects/events, these progress parameters may not have a sufficient maximum value for your needs and may also apply certain effects that you do not want, so it is recommended to create a fresh progress parameter for each project and for each event in that project.

  5. Add the progress parameter you just created to your Event by clicking the plus sign in the tabs at the top (next to Timeline) to open the parameter selection menu, scroll to the preset folder you set-up in the previous step, and select that progress parameter.

  6. Specify the progression value for each Transition:

    a. Go back to the Timeline, and select a Transition. The box at the bottom with Add trigger conditions will appear. Select Add Condition, Add Parameter Condition, and then select that progress parameter you just added to your Event.

    b. You can now set the progression value for this specific Section of music here by moving the slider. Section 1 should have a progression value of 0.00-0.05 because it comes first, Section 2 should have a progression value of 1.00-1.05 and so on. The Transition to your last Section should have a value of max-max, where max is the Maximum value you set when creating the progress parameter, e.g. in my Event the progression value for the Transition to Section 5 is 4.00-4.00.

    Note: while you can use values like 0.00-0.00 or 1.00-1.00, the extra .05 on the slider acts as a buffer in the case of occasional rounding errors. This buffer is not needed for the final Transition. _Note: make sure you don't accidentally double click on any Transition marker, which will make a º symbol appear after its name and can cause issues.

    c. Repeat the above steps for all Transitions.

  7. Similarly to Step 6, select a Loop Region and the same box at the bottom will appear. Follow the same process to add the progress parameter as a condition for the Loop Regions, however, the value you set must encompass the entire range of progress values for that particular Section. This means that for the Loop Region in Section 1, the value range should be set to 0.00-0.95, for Section 2 set it to 1.00-1.95, etc. The Loop Region in the last Section does not need to have the progress parameter applied to it as there are no further sections of the track to progress to, so you can leave that one as is.

And that should be it! Use those progression values in the Lönn room config window, and the music should now progress according to the logic you set out in FMOD. You can also confirm that the progression is set up correctly without going in-game by moving the progress dial above the parameter list while the event is playing to mimic how the progression value would increase in-game.

Progression using Volume Automation

The use of progression through volume automation is tricky to define, but the best way to understand its ideal use is to look at the vanilla event music/lvl7/main. This event contains multiple audio tracks that are essentially the same melody but with different instruments to represent each of the areas in Summit. Turning the progress knob at the top of the window while the event is playing will smoothly bring in the next audio track while fading out the previous one, and this is done through volume automation (the same concept used to add the fade parameter). You can see this by clicking on the progress tab and expanding each audio track (click the small white triangle underneath the track name), where a volume curve is setup to change in direct correlation with the value of progress along the top:

Frankly, this setup is very similar to the use of layers in other events, but it does allow for more precise control over the speed and volume of each audio track as they fade in and out, and the source audio is arranged differently to how layers are typically arranged. This approach is also one way to add more than four layers to your music to circumvent the limitation of only four layer options being provided in Lönn's Room Config window.

To add progression using volume automation to your custom music:

  1. Start by separating each of your audio files into Audio Tracks, with each Track containing all the audio files you want for a certain progression point. Here, I have three audio files that I want to progress between, so I’ve split them into Section 1, Section 2, and Section 3.

  2. Create a progress parameter:

    a. Open the Preset Browser by going to Window > Preset Browser, or pressing Ctrl+8.

    b. Select New Folder at the bottom of the window to create a new preset folder for your project. Use a unique name like yournickname_mapname.

    • You can also create subfolders in here if you would like to apply progress to separate pieces of custom music in your map and have them all housed under the one project folder.

    c. Select New Parameter at the bottom of the window to create a progress parameter in the yournickname_mapname folder. You want the Maximum value to be the same as the number of Sections you setup previously, so since I set 3 Sections in total, my maximum value is 3. Copy the rest of the values and syntax exactly as in the screenshot below. You only need one progress parameter for the whole Event.

    Note: while you can re-use progress parameters from vanilla or from other projects/events, these progress parameters may not have a sufficient maximum value for your needs and may also apply certain effects that you do not want, so it is recommended to create a fresh progress parameter for each project and for each event in that project.

  3. Add the progress parameter you just created to your Event by clicking the plus sign in the tabs at the top (next to Timeline) to open the parameter selection menu, scroll to the preset folder you set-up in the previous step, and select that progress parameter.

  4. Add Volume Automation to the appropriate section:

    a. Right click the volume knobs on each Audio Track and select Add Automation. Don’t mess with the volume just yet.

    b. Click on the progress tab, and click the small white triangle underneath the names of each Audio Track. This should bring up their Volume tabs and straight, dotted red lines.

    c. You can now match specific values of the progress parameter to certain volume points for each section by clicking on the dotted lines and dragging the points to align with the values at the top of the window, just below the Timeline/progress tabs. There are no specific rules to where you set these points, it's entirely up to you. Here I've decided that I want only Section 1 to be audible at progress = 0, to fade out Section 1 and fade in Section 2 as progress is increased to 1, to fade out Section 2 and fade in Section 3 as progress is increased to 2, and to fade out Section 3 but bring in both Section 1 and 2 as progress is increased to 3.

    • You can zoom in using the ] key to more accurately line a point up with the desired progress value. Zoom out using [.
    • You can leave the curves straight, or move the diamond in the middle to make the curve steeper/shallower, which will affect the rate at which the music increases in volume as the parameter value for progress increases in-game. Nearly all vanilla tracks have a steeper curve, as it makes music changes a little bit smoother and less jarring.

    d. If you need to adjust the peak volume of a particular section from 0 dB so that it mixes better and cannot do so with the source content outside of FMOD, go back to the Timeline, select the asset (the blue rectangle), and then adjust the volume using the knob that appears at the bottom left of the window:

And that should be it! Use those progression values in the Lönn room config window, and the various Sections should now fade in and out according to the volume automation curves you set out in FMOD. You can also confirm that the progression is set up correctly without going in-game by moving the progress dial above the parameter list while the event is playing - you should see the knobs on the left for each Audio Track be increased/decreased depending on your setup, and the changes in music will be reflected in real time. I strongly recommend that you read the next sub-section Adjusting Progression Seek Speed to properly polish off your audio, but it is optional.

Adjusting Progression Seek Speed

Seek speed is the speed at which your Sections will automatically increase/decrease in volume when progress is changed by the game. You can see this in effect in the music/lvl7/main event - when you turn the progress knob, the volume of each Section does not immediately change, but instead a small orange dot on the progress indicates that FMOD is forcing the value of progress to be adjusted more gradually and smoothly. By default, your music will instantly jump to the next Section when you increase progress in your map and can thus be slightly jarring to listen to in-game, so if you're feeling confident enough, I'd highly recommend playing around with the seek speed value.

To implement this in your own progress parameter:

  1. Open the Preset Browser by going to Window > Preset Browser or pressing Ctrl+8, and find the progress parameter in the project folder you setup previously.

  2. When you select your progress parameter, some extra settings will appear at the bottom of the window. The dial labelled Seek Speed is what we're looking to adjust. The lower the value, the longer it takes to progress along the volume curve you set out previously (both up and down the curve), and vice versa. The progress parameter in vanilla's Summit music has a seek speed value of 0.50/s, but play around with different values to see what suits your music best.

    Optional: you can set different values for seek speed up and down the volume curve by turning on Asymmetric, where Ascending affects the speed at which the volume increases, and Descending affects the speed at which the volume decreases. I don't personally see this being useful for progress, it's much more suitable for layers in my eyes, but if it suits your audio then go for it.

One thing to note is that once you edit the seek speed of a particular progress parameter, it will apply to all events that use that specific parameter, potentially creating unwanted effects in the audio for other projects. This is why the vanilla events have a specific set of progress parameters for every individual event that uses them, and why it was recommended to create a preset folder/subfolder for each project/event that you would like to use progress in.


Adding Cassette Music

Note

This guide was not intended to be used as a wiki tutorial and is thus less in-depth than the others on this page; a more rigorous guide is being worked on but is not yet complete (due to the monster that is cassette music). If you get stuck at any point, don't hesitate to ask for help in the Celeste Discord, and feel free to ping or DM @caeyo. if you aren't getting satisfactory answers.

A script that can be imported into FMOD Studio to automate some of this process is available here 🔗.

  1. Find the bpm of the song you will be using (vanilla songs are 90bpm)

  2. Convert that bpm to milliseconds and then take the ms value that corresponds with 1/16 to get your 16th note value (https://tuneform.com/tools/time-tempo-bpm-to-milliseconds-ms)

  3. Splice up the audio into (inset that amount of milliseconds) segments. You can do this in audacity, there are tutorials out there, but it's basically creating labels (Tools>Regular Interval Labels>Create labels based on Label Interval), and going to File>Export>Export Multiple.

  4. Save each one as an audio file of some sort, and then import them into your FMOD project.

  5. Now comes the "fun" part. Copy one of the in game cassette songs and in the 16th note tab on the top, delete all the notes.

  6. There should be a little box slider thing at the bottom. You can drag it to make it smaller and the timeline will get smaller as well. Do this until the numbers at the top go in sequential order.

  7. Drag each audio file you imported into the top track and make sure that a yellow line shows up to the left of the file before you place it. If you did everything correctly, they should line up with the numbers at the top.

ℹ️ If you press the play button, put your cursor on the first note, and then tap the right arrow key repetitively, it should play the song. If it skips a beat you will need to move the audio file it skipped so that the yellow line shows up.

  1. When routing the song, save into music/cassette instead of music/tunes. If you copied one of the existing cassette songs it should already be routed here.

  2. Use the FMOD banks tutorial on the Adding Custom Audio page to make a bank file and export your files as normal.

  3. In metadata in Lönn, set your cassette music like you would for normal music.

Adding tileset custom sounds

  1. In FMOD, make a copy of the following four events: footstep, grab, handhold and landing. You can find them in the char>madeline folder.
  1. Move the four events to your own folder, for example, TilesetTutorial. Do NOT rename the events.

  2. Add the audios you want in the four events. It will be easier if you reuse any unused surface_index IDs (like "26") (you can check them here 🔗). Just make sure that you use the same ID for the four events.

  1. Build your bank(s) and save them and the GUIDs as usual, put them in YourMod/Audio folder.

  2. Now open your ForegroundTiles.xml. When you define a tileset you can add the attribute soundPath to specify your own events. We put the four events in TilesetTutorial before, so if we see in our guids that the path of one of the events is event:/SomeMod/TilesetTutorial/footstep, we will write soundPath="event:/SomeMod/TilesetTutorial" sound="26" in our tileset definition, and Everest will automatically find the four events from TilesetTutorial.

Adding Effects

Effects have a lot of interesting applications. For example, lowering the Mid and High Frequencies of an Equalizer can simulate being underwater.

  1. Open any event in FMOD Studio.

  2. Create a new Parameter by opening a new tab. You can tweak it later if you want by going to Window>Preset Browser.

  1. In the bottom part of the window, click on the + Sign, and select any effects. For example, Delay.
  1. You can automate any parameters from your effect. For example, the Wet Level from the Delay controls how much of this effect is applied to the sound. So -∞dB means no Delay, and 0dB means that the Delay volume will be the default.

In the same way you can automate the level of a song in a layer, you can control the Wet Level through a parameter.

  1. Build your bank(s) and save them and the GUIDs as usual, put them in YourMod/Audio folder.

  2. In Lönn, you can control how these parameters that control your effects interact with the game. For example, while the player is inside this little cave, there will be a bit of reverberation.

Clone this wiki locally