A prefab for scheduling audio that musically switches between sections/loops/bars (in VRChat!)
This allows you to create dynamic soundtracks directed by player action/gameplay or even build dynamic "music video" experiences
This system is built around the idea of "audio scenes" in which each scene is a new cue for the music. It uses dspTime (recently exposed in Udon) for precise scheduling! It handles moving between loops/bars, playing one-time transition sections into loops, instant stab/stinger transitions, and can fire off external game events at the end of cues if desired.
Uses Graphs (Sorry! It's only one behaviour, though!)
I plan to make a U# version when I have more time so it can have a better inspector!
- Download + import the latest version of SDK3 - Worlds from VRChat
- Download + import the latest version of Dynamic Soundtrack Controller into your project
- Drag-and-drop the newly imported Dynamic Soundtrack Controller prefab into your scene
- Drag over + populate the
audioCues
array with your audio clips/loops - Change the
audioScene
value at runtime + it will schedule/play through your loops automatically!
- Add
_transition
to the end of the audio clip you want this to happen on.
You're done! That's it! 👍
Docs further explain the benefits of scheduling, various start behaviours, covers invoking custom (game) events off audio cue end/start, syncing, interrupt/instant transitions, common errors/troubleshooting, best practices, etc.
Will try to get some form of demo/tutorial video out before the end of the year for this (and some other stuff!)
Required:
- Unity 2019.4.31f1 + The Patience To Use It
- VRCSDK3-WORLD-2021.11.08.14.28 or higher (when they exposed dspTime)
Have fun + show me if you make anything cool w it! ✨