1. Future Vibe Check
  2. News
  3. Dev Log #2: Deep Dive on Procedural-music (Timing)

Dev Log #2: Deep Dive on Procedural-music (Timing)

[p]Hey DJs,

I hope you have been enjoying the Future Vibe Check demo! There have already been amazing creations made by the community! Make sure to make your own vibe in the demo if you haven't had a chance yet. [/p][p][/p][p]Last month, we explained why we junked conveyor-belt sequencing for node networks. Today, we’re zooming in on our Dynamic Measure System—the bit of code that maintains timing across the player’s factory to ensure everything is synced to play at the right time. In one sentence: the Dynamic Measure System is the metronome that everything in FVC marches to—music, machines, and VFX. In one sentence: the Dynamic Measure System is the metronome that everything in FVC marches to—music, machines, and VFX.[/p][h2]What’s a “Dynamic Measure” anyway?[/h2][p]Most games treat music like a playlist: fire a clip, wait, fire the next. In FVC every bar of music is generated in real-time from tiny sixteenth-note steps. A Dynamic Measure is the conductor that:[/p]
  • [p]Maintains the global clock of the music system[/p]
  • [p]Counts sixteenth note steps to support musical progression changes[/p]
  • [p]Broadcasts events so factories and logistics stay in sync[/p]
  • [p]Adapts its own length if you speed-up or slow-down the tempo mid-gameplay.[/p]
[p]Put simply: it’s the glue between design-time music theory and run-time chaos.[/p][h2] Time signature → measure → sixteenth steps – the building blocks[/h2]
[p]Musical term[/p]
[p]Definition[/p]
[p]How FVC uses it[/p]
[p]Time signature[/p]
[p]how many beats fit in one bar and what length a beat is. 4/4 (the pop standard) = “four quarter-note beats per bar.”[/p]
[p]Stored in a TimeSignature class where we manage how many ‘steps per measure’ are in the time signatures we support. All timing maths starts here.[/p]
[p]Measure / bar[/p]
[p]A single “box” of music drawn on staff paper—four beats long in 4/4.[/p]
[p]Our Dynamic Measure treats one bar as a unit of gameplay time. Most musical changes happen at bar boundaries.[/p]
[p]Sixteenth step[/p]
[p]A bar chopped into 16 equal slices (think “rapid metronome clicks”). In 4/4 time, 4 sixteenth notes in 1 beat and 16 in one measure. [/p]
[p]The smallest pulse we schedule. 1 sixteenth = 0.25 beats in 4/4. All factory events snap to these slices. The duration of it is based on the tempo or how many beats per minute. [/p]
[p]
[/p][h2]Sixteenth-Step Timer / OnStepInMeasurePlayed – The Game’s Metronome[/h2][p]Every frame we:[/p]
  1. [p]Subtract deltaTime from SixteenthStepTimer. Unity can’t guarantee sub-ms timing, so we re-add the lost microseconds into the next step. This keeps long play-sessions phase-locked—crucial when there are many instruments and half your factory machines triggering off the same clock.[/p]
  2. [p]When the timer hits zero, we fire the current sixteenth step and immediately re-arm the timer to BeatLength / 4 (a sixteenth note).[/p]
  3. [p]If we miss by a hair (because frame-rate isn’t sample-accurate) we carry that drift forward so long-sessions never de-sync.[/p]
[p]Result: Because everyone listens to the same event, animations, craft timings, and logistic movement are connected to the musical timing. Also, whether you’re locked at 240 FPS or dipping to 50 FPS, the timing is maintained. [/p][h2]Measure Bar Boundaries[/h2][p]When SixteenthStepsTaken == StepsPerMeasure we’ve reached the bar-line:[/p]
  • [p]GenerateNewProgression() rolls fresh chord progressions based on more user modifiable variables so the soundtrack evolves. We will take a deep dive on how progressions are made in a future post. [/p]
  • [p]ResetMeasure() zeros all counters while keeping that new progression in mind. [/p]
[p]Why only on the bar line? Musically, key or chord shifts feel natural at the start of a phrase. [/p]
[p]Key Parts[/p]
[p]What it does[/p]
[p]Gameplay impact[/p]
[p]Measure boundary[/p]
[p]Generates a fresh chord progression and zeroes the counters.[/p]
[p]Let the soundtrack evolve based on global settings you can manage on different measure boundaries. Your factories produce music that is temporally appropriate. [/p]
[p]Sixteenth Step playback[/p]
[p]Fires events & visual callbacks every sixteenth step.[/p]
[p]Drives movement, craft timings, and determines time of playback that is synced to the global timer. [/p]
[h2]Putting it all together – the timing chain[/h2][p]Time signature (e.g., 4/4) ➜ defines Beats Per Bar/Measure[/p][p]            ↓[/p][p]Measure = one bar (4 beats)[/p][p]            ↓[/p][p]Measure split into 16 sixteenth steps[/p][p]            ↓[/p][p]BeatLength (tempo) / 4 = real-time seconds per sixteenth step timer[/p][p]            ↓[/p][p]Dynamic Measure counts steps → fires OnStepInMeasurePlayed[/p][p]            ↓[/p][p]At step 16 or when we reach total steps in measure: GenerateNewProgression + ResetMeasure
[/p][p]6. What’s next?[/p][p]Next month we’ll expose more of how the generator determines what to play based on generated chord progressions. Until then, keep the vibes checked ✌️[/p][p][/p][p]Check out the Future Vibe Check demo on Steam and if you enjoy it, consider giving us a wishlist and leaving a review! If you would like to learn more about the game, then join the Future Vibe Check Discord![/p]