pub struct AudioEventList {
pub events: Vec<AudioEvent>,
pub logs: Vec<(f32, String)>,
pub synths: HashMap<String, SynthDefinition>,
}Expand description
Audio events collector
Fields§
§events: Vec<AudioEvent>§logs: Vec<(f32, String)>Print/log messages recorded during interpretation. These are not audio events and should not affect loop termination logic.
synths: HashMap<String, SynthDefinition>Implementations§
Source§impl AudioEventList
impl AudioEventList
pub fn new() -> Self
pub fn add_synth(&mut self, name: String, definition: SynthDefinition)
pub fn add_note_event( &mut self, synth_id: &str, midi: u8, start_time: f32, duration: f32, velocity: f32, pan: f32, detune: f32, gain: f32, attack: Option<f32>, release: Option<f32>, delay_time: Option<f32>, delay_feedback: Option<f32>, delay_mix: Option<f32>, reverb_amount: Option<f32>, drive_amount: Option<f32>, drive_color: Option<f32>, )
pub fn add_chord_event( &mut self, synth_id: &str, midis: Vec<u8>, start_time: f32, duration: f32, velocity: f32, pan: f32, detune: f32, spread: f32, gain: f32, attack: Option<f32>, release: Option<f32>, delay_time: Option<f32>, delay_feedback: Option<f32>, delay_mix: Option<f32>, reverb_amount: Option<f32>, drive_amount: Option<f32>, drive_color: Option<f32>, )
pub fn add_sample_event(&mut self, uri: &str, start_time: f32, velocity: f32)
Sourcepub fn add_sample_event_with_effects(
&mut self,
uri: &str,
start_time: f32,
velocity: f32,
effects: Option<Value>,
)
pub fn add_sample_event_with_effects( &mut self, uri: &str, start_time: f32, velocity: f32, effects: Option<Value>, )
Add a sample event with an attached effects map (owned)
Sourcepub fn add_log_event(&mut self, message: String, time: f32)
pub fn add_log_event(&mut self, message: String, time: f32)
Add a log message (created by print statements). Time is in seconds from start.
Logs are stored separately from audio events so they don’t affect rendering/loop logic.
pub fn get_synth(&self, name: &str) -> Option<&SynthDefinition>
pub fn total_duration(&self) -> f32
Sourcepub fn merge(&mut self, other: AudioEventList)
pub fn merge(&mut self, other: AudioEventList)
Merge another AudioEventList into this one This is used for parallel spawn execution
Trait Implementations§
Source§impl Debug for AudioEventList
impl Debug for AudioEventList
Source§impl Default for AudioEventList
impl Default for AudioEventList
Source§fn default() -> AudioEventList
fn default() -> AudioEventList
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AudioEventList
impl RefUnwindSafe for AudioEventList
impl Send for AudioEventList
impl Sync for AudioEventList
impl Unpin for AudioEventList
impl UnwindSafe for AudioEventList
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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