Last update: 2025-08-03
201: Interactive Music
Lesson 5: Interactive Re-orchestration
In this lesson we're going to use a different guitar track depending on the player health.
- Select and delete the current guitar track (Audio 3 in this example).
- Add 3 new audio tracks add the bottom.
- Import the Combat-A tracks again dragging them one by one into the tracks.
- Same for guitar-B tracks.
- Finally add the bridge tracks. They should overlap 1 beat as we did in the previous lesson to respect their pre-entry time. Undo the automatic crossfades.
- We'll use an Automation to react to the player health state. Right-click the track volume knob and select Add Automation.
- Now we'll create the parameter we want to connect. Go to the menu and select Create > Add Parameter... or press Ctrl+P
- The parameter name must be PlayerHealth, which is the name given in the code. The range goes from 0 to 100 and the Parameter scope is Global.
- Now we'll create a curve for the volume automation. In the Automation: Volume panel, click Add Curve and choose PlayerHealth.
- Now you'll see the curve editor. You can create nodes by clicking over the line and drag them wherever you want. We'll adjust the values so that volume for this track is up between 50 and 80 PlayerHealth units and is -oo for the rest of the range.
- On the right panel you'll see the game parameter. This will allow you to change it and preview the sound for any possible value. At the same time, you'll now find a foldable subtrack below this guitar tracks that shows the track volume according to the PlayerHealth value.
- Repeat the previous steps for the other 2 guitar tracks. Track 2 will have full volume for values between 20 and 50 in this case.
- Track 3 will have full volume for values below 20.
- Now you should be able to play the event and use PlayerHealth to listen how tracks changes for the different PlayerHealth ranges. The change is immediate in this case.
You can test it into the game by rebuilding the bank and letting hoverbots fire you until your health decreases. Can you notice the increasing tension as you health goes down?