Fix: lots of various fixes
All checks were successful
Deploy Website / deploy (push) Has been skipped
All checks were successful
Deploy Website / deploy (push) Has been skipped
This commit is contained in:
@@ -63,6 +63,7 @@ pub struct StepContext<'a> {
|
||||
pub speed: f64,
|
||||
pub fill: bool,
|
||||
pub nudge_secs: f64,
|
||||
pub sr: f64,
|
||||
pub cc_access: Option<&'a dyn CcAccess>,
|
||||
pub speed_key: &'a str,
|
||||
pub mouse_x: f64,
|
||||
|
||||
@@ -302,6 +302,7 @@ impl Forth {
|
||||
&resolved_params,
|
||||
ctx.step_duration(),
|
||||
delta_secs,
|
||||
ctx.sr,
|
||||
outputs,
|
||||
);
|
||||
Ok(resolved_sound_val.map(|v| v.into_owned()))
|
||||
@@ -1542,7 +1543,7 @@ impl Forth {
|
||||
.unwrap_or(0);
|
||||
let dev =
|
||||
get_int("dev").map(|d| d.clamp(0, 3) as u8).unwrap_or(0);
|
||||
let delta_suffix = if delta_secs > 0.0 {
|
||||
let delta_suffix = if delta_secs.abs() > 1e-9 {
|
||||
format!("/delta/{delta_secs}")
|
||||
} else {
|
||||
String::new()
|
||||
@@ -1741,6 +1742,7 @@ fn emit_output(
|
||||
params: &[(&str, String)],
|
||||
step_duration: f64,
|
||||
nudge_secs: f64,
|
||||
sr: f64,
|
||||
outputs: &mut Vec<String>,
|
||||
) {
|
||||
use std::fmt::Write;
|
||||
@@ -1772,11 +1774,12 @@ fn emit_output(
|
||||
}
|
||||
}
|
||||
|
||||
if nudge_secs > 0.0 {
|
||||
if nudge_secs.abs() > 1e-9 {
|
||||
if !out.ends_with('/') {
|
||||
out.push('/');
|
||||
}
|
||||
let _ = write!(&mut out, "delta/{nudge_secs}");
|
||||
let delta_ticks = (nudge_secs * sr).round() as i64;
|
||||
let _ = write!(&mut out, "delta/{delta_ticks}");
|
||||
}
|
||||
|
||||
if !has_dur {
|
||||
|
||||
Reference in New Issue
Block a user