pub struct MusicLayerStack {
pub layers: [MusicLayer; 4],
pub current_vibe: GameVibe,
pub current_scale: Scale,
pub beats_per_second: f32,
}Expand description
Four cross-fadable music layers driven by the current GameVibe.
- Layer 0 (always): bass drone tuned to floor depth
- Layer 1 (exploration): procedural melody pattern
- Layer 2 (combat): percussion + rhythm pattern
- Layer 3 (boss): full arrangement
Fields§
§layers: [MusicLayer; 4]§current_vibe: GameVibe§current_scale: Scale§beats_per_second: f32Implementations§
Source§impl MusicLayerStack
impl MusicLayerStack
pub fn new() -> Self
Sourcepub fn transition_to(&mut self, vibe: GameVibe, crossfade_secs: f32)
pub fn transition_to(&mut self, vibe: GameVibe, crossfade_secs: f32)
Transition to a new vibe, cross-fading layers over crossfade_secs.
Sourcepub fn set_floor_depth(&mut self, floor: u32)
pub fn set_floor_depth(&mut self, floor: u32)
Adjust bass drone frequency based on floor depth. Floor 1 => C2 (65.41 Hz), floor 100 => C0 (16.35 Hz).
Trait Implementations§
Source§impl Clone for MusicLayerStack
impl Clone for MusicLayerStack
Source§fn clone(&self) -> MusicLayerStack
fn clone(&self) -> MusicLayerStack
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MusicLayerStack
impl Debug for MusicLayerStack
Auto Trait Implementations§
impl Freeze for MusicLayerStack
impl RefUnwindSafe for MusicLayerStack
impl Send for MusicLayerStack
impl Sync for MusicLayerStack
impl Unpin for MusicLayerStack
impl UnsafeUnpin for MusicLayerStack
impl UnwindSafe for MusicLayerStack
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.