Fix: lots of various fixes
All checks were successful
Deploy Website / deploy (push) Has been skipped

This commit is contained in:
2026-03-06 20:48:50 +01:00
parent bc1396d61d
commit 09cfa82809
13 changed files with 57 additions and 28 deletions

View File

@@ -1007,6 +1007,7 @@ impl SequencerState {
speed: speed_mult,
fill,
nudge_secs,
sr,
cc_access: self.cc_access.as_deref(),
speed_key,
mouse_x,
@@ -1128,6 +1129,7 @@ impl SequencerState {
speed: speed_mult,
fill,
nudge_secs,
sr,
cc_access: self.cc_access.as_deref(),
speed_key: "",
mouse_x,
@@ -1266,13 +1268,16 @@ fn sequencer_loop(
) {
use std::sync::atomic::Ordering;
set_realtime_priority();
let has_rt = set_realtime_priority();
if !has_rt {
super::realtime::warn_no_rt("sequencer");
}
let rng: Rng = Arc::new(Mutex::new(StdRng::seed_from_u64(0)));
let mut seq_state = SequencerState::new(variables, dict, rng, cc_access);
// Lookahead window: ~20ms expressed in beats, recomputed each tick
const LOOKAHEAD_SECS: f64 = 0.02;
// Lookahead window: 20ms normally, 40ms on Linux without RT to compensate for jitter
let lookahead_secs: f64 = if cfg!(target_os = "linux") && !has_rt { 0.04 } else { 0.02 };
// Wake cadence: how long to sleep between scheduling passes
const WAKE_INTERVAL: std::time::Duration = std::time::Duration::from_millis(3);
@@ -1302,7 +1307,7 @@ fn sequencer_loop(
let tempo = state.tempo();
let lookahead_beats = if tempo > 0.0 {
LOOKAHEAD_SECS * tempo / 60.0
lookahead_secs * tempo / 60.0
} else {
0.0
};