summaryrefslogtreecommitdiff
path: root/src/audio/tracker.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-08 07:40:29 +0100
committerskal <pascal.massimino@gmail.com>2026-02-08 07:40:29 +0100
commitc9195f997f3e797f03ab90464e4158717198a167 (patch)
tree331304f42870246efdc64cc97ad42de59444ef3a /src/audio/tracker.cc
parentb8e6929cafa41681f0b27ac104c9cf1d4e510837 (diff)
style: Apply clang-format to all source files
Diffstat (limited to 'src/audio/tracker.cc')
-rw-r--r--src/audio/tracker.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/audio/tracker.cc b/src/audio/tracker.cc
index fd25e84..2bb4159 100644
--- a/src/audio/tracker.cc
+++ b/src/audio/tracker.cc
@@ -172,8 +172,10 @@ static int get_free_pattern_slot() {
}
// Helper to trigger a single note event (OPTIMIZED with caching)
-// start_offset_samples: How many samples into the future to trigger (for sample-accurate timing)
-static void trigger_note_event(const TrackerEvent& event, int start_offset_samples) {
+// start_offset_samples: How many samples into the future to trigger (for
+// sample-accurate timing)
+static void trigger_note_event(const TrackerEvent& event,
+ int start_offset_samples) {
#if defined(DEBUG_LOG_TRACKER)
// VALIDATION: Check sample_id bounds
if (event.sample_id >= g_tracker_samples_count) {
@@ -209,13 +211,15 @@ static void trigger_note_event(const TrackerEvent& event, int start_offset_sampl
}
// Trigger voice with sample-accurate offset
- synth_trigger_voice(cached_synth_id, event.volume, event.pan, start_offset_samples);
+ synth_trigger_voice(cached_synth_id, event.volume, event.pan,
+ start_offset_samples);
}
void tracker_update(float music_time_sec) {
// Unit-less timing: 1 unit = 4 beats (by convention)
const float BEATS_PER_UNIT = 4.0f;
- const float unit_duration_sec = (BEATS_PER_UNIT / g_tracker_score.bpm) * 60.0f;
+ const float unit_duration_sec =
+ (BEATS_PER_UNIT / g_tracker_score.bpm) * 60.0f;
// Step 1: Process new pattern triggers
while (g_last_trigger_idx < g_tracker_score.num_triggers) {
@@ -239,9 +243,9 @@ void tracker_update(float music_time_sec) {
}
// Step 2: Update all active patterns and trigger individual events
- // NOTE: We trigger events immediately when their time passes (no sample offsets)
- // This gives ~16ms quantization (60fps) which is acceptable
- // Sample offsets don't work with tempo scaling because music_time and render_time
+ // NOTE: We trigger events immediately when their time passes (no sample
+ // offsets) This gives ~16ms quantization (60fps) which is acceptable Sample
+ // offsets don't work with tempo scaling because music_time and render_time
// are in different time domains (tempo-scaled vs physical)
for (int i = 0; i < MAX_SPECTROGRAMS; ++i) {