pub struct ScoreEvent {
pub voice: String,
pub at: Option<TimePoint>,
pub every: Option<TimePoint>,
pub from: Option<TimePoint>,
pub to: Option<TimePoint>,
pub offset: Option<TimePoint>,
pub gain: Option<f32>,
}Expand description
One entry of score: trigger voice once at at, or repeatedly every
every between from (default: the scenario’s start) and to
(default: the scenario’s end), phase-shifted by offset. Exactly one
of at/every must be given — Score::resolve_hits rejects an
event with neither.
at/from/to are instants: resolved with the scenario’s real
bpm/beat_offset, exactly like crate::schema::Scene::at. every/
offset are durations: also TimePoints, resolved through the
same TimeCtx machinery (the frozen contract — nothing here reshapes
TimePoint/TimeCtx), but against a context whose beat_offset is
forced to zero first (see [resolve_duration]’s doc) — beat_offset is
a phase, and must not multiply into how long one beat lasts.
Fields§
§voice: StringKey into Score::voices.
at: Option<TimePoint>§every: Option<TimePoint>§from: Option<TimePoint>§to: Option<TimePoint>§offset: Option<TimePoint>§gain: Option<f32>Per-event gain override, applied on top of the voice’s own gain.
Linear, not dB (unlike CompressorConfig::threshold and
MasterBus::gain) — matching Voice::gain, which this
multiplies against.
Trait Implementations§
Source§impl Clone for ScoreEvent
impl Clone for ScoreEvent
Source§impl Debug for ScoreEvent
impl Debug for ScoreEvent
Source§impl<'de> Deserialize<'de> for ScoreEvent
impl<'de> Deserialize<'de> for ScoreEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ScoreEvent
impl JsonSchema for ScoreEvent
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for ScoreEvent
impl RefUnwindSafe for ScoreEvent
impl Send for ScoreEvent
impl Sync for ScoreEvent
impl Unpin for ScoreEvent
impl UnsafeUnpin for ScoreEvent
impl UnwindSafe for ScoreEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more