Creating Music: Difference between revisions
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 86: | Line 86: | ||
|} | |} | ||
When you've specified all 3 URLs, a widget shows up that shows you markers, and lets you playback your track. | When you've specified all 3 URLs, a widget shows up that shows you markers, and lets you playback your track. | ||
Example: | |||
[[File:FQ Music Editor.png|none|thumb|Example of a music asset setup.]] | |||
== Caveats == | == Caveats == | ||
Line 91: | Line 93: | ||
* Your loop must be longer than your intro and outro combined. | * Your loop must be longer than your intro and outro combined. | ||
* Absolute maximum BPM is 300. | * Absolute maximum BPM is 300. | ||
* Try not to switch music too often in your mod or it may cause issues. I recommend only using RP music if your RP can't be re-opened via a button. | |||
== Debugging == | |||
The easiest way to try music transitions is to open a console on either the devtool or game and type testAudio("label"), ex testAudio("forest"), then testAudio("forest_combat") to try the transition. Use testMusic.stopMusic() to try turning it off. | |||
[[Category:Modding]] |
Latest revision as of 22:50, 24 October 2023
Music in FQ is a bit complicated since it tries to do smart transitions. What you'll need is:
- An intro bit
- A loop
- An outro bit
Let's take a simple piece as an example:

It's a full piece with an intro, loop, and outro.
First off, let's render the loop as an ogg. I'll call it looptest_loop.ogg
- You don't NEED to include the silence at the start, but it makes it easier for you to setup later.
- Make sure the export doesn't offset the time. I know FL MP3 exports adds silence at the start, which offsets your whole file. But going FL->OGG doesn't have that issue.
- Consider a fairly low bitrate since it's web audio. It comes down to how long your track is really.
- Make sure to include reverbs etc after the track end. In FL you select "leave remainder" on export.

Next we'll render only the intro bits. I'll call it looptest_intro.ogg

Finally we'll render only the outro bits. I'll call it looptest_outro.ogg

You'll need to make a note of when the "hit" occurs based on when you start the render. Here I start from bar 5 and the hit occurs on the second bar (relative to 5). So we'll need to make a mental note that the hit occurs at bar #2. This is a bit confusing since bars start counting at 1, whereas you'd normally start from 0.
Anyhow, we can now plug our stuff into the audio asset in the modtools.
I'll do the following settings:
Setting | Value | Explanation |
---|---|---|
Label | loopTest | A unique identifier for the music asset. Note that you should NOT change this after setting it. |
Track Name | Loop Test | A name for your track. Helps users find your music. |
Author | JasX | Author of the music. |
Volume | 0.5 | You can leave at the default 0.5, but if you're making an epic end boss battle you can go a bit higher. |
BPM | 130 | Beats per minute. MUST match your track. Important! |
Loop URL | media/audio/music/looptest_loop.ogg | URL to your music track. Your will probably start with https://... but I'm hosting it on the FQ server so a relative path is enough.
Note that after adding the URL, a timeline should be populated in the editor. |
In | 2 | The bar number where it starts playing. |
Out | 6 | The bar number where it should loop around. |
Transition Points | 2, 4, 6 | Good places to transition to another track when crossfading. |
Intro URL | media/audio/music/looptest_intro.ogg | Path to the intro file. |
Intro in | 2 | When the intro "hits". If you export the loop from the very beginning, then this is the same as the loop In. |
Outro URL | media/audio/music/looptest_outro.ogg | Path to the outro file. |
Outro Out | 2 | It's what we discussed above. Assuming bar 1 is at the very start of the outro, our outro "hits" on bar 2. |
When you've specified all 3 URLs, a widget shows up that shows you markers, and lets you playback your track. Example:

Caveats
- Your intro must not start after your loop.
- Your loop must be longer than your intro and outro combined.
- Absolute maximum BPM is 300.
- Try not to switch music too often in your mod or it may cause issues. I recommend only using RP music if your RP can't be re-opened via a button.
Debugging
The easiest way to try music transitions is to open a console on either the devtool or game and type testAudio("label"), ex testAudio("forest"), then testAudio("forest_combat") to try the transition. Use testMusic.stopMusic() to try turning it off.