pub struct Note { /* private fields */ }
Expand description
A note type.
This is a named pitch with an octave. This type allows for correctly attributing octave changes
across an interval from one Note
to another.
Implementations§
source§impl Note
impl Note
sourcepub fn new(pitch: NamedPitch, octave: Octave) -> Self
pub fn new(pitch: NamedPitch, octave: Octave) -> Self
Creates a new Note
from the given NamedPitch
and Octave
.
source§impl Note
impl Note
sourcepub async fn try_from_mic(length_in_seconds: u8) -> Res<Vec<Note>>
pub async fn try_from_mic(length_in_seconds: u8) -> Res<Vec<Note>>
Attempts to use the default microphone to listen to audio for the specified time to identify the notes in the recorded audio.
Currently, this does not work with WASM.
sourcepub fn try_from_audio(data: &[f32], length_in_seconds: u8) -> Res<Vec<Note>>
pub fn try_from_audio(data: &[f32], length_in_seconds: u8) -> Res<Vec<Note>>
Attempts to use the provided to identify the notes in the audio data.
sourcepub async fn try_from_mic_ml(length_in_seconds: u8) -> Res<Vec<Self>>
pub async fn try_from_mic_ml(length_in_seconds: u8) -> Res<Vec<Self>>
Attempts to use the default microphone to listen to audio for the specified time to identify the notes in the recorded audio using ML.
Currently, this does not work with WASM.
Trait Implementations§
source§impl AddAssign<Interval> for Note
impl AddAssign<Interval> for Note
source§fn add_assign(&mut self, rhs: Interval)
fn add_assign(&mut self, rhs: Interval)
Performs the
+=
operation. Read moresource§impl<'de> Deserialize<'de> for Note
impl<'de> Deserialize<'de> for Note
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl HasFrequency for Note
impl HasFrequency for Note
source§fn frequency_range(&self) -> (f32, f32)
fn frequency_range(&self) -> (f32, f32)
Returns the frequency range of the type (usually a [
Note
]).
Essentially, mid way between the frequency and the next frequency on either side.source§fn tight_frequency_range(&self) -> (f32, f32)
fn tight_frequency_range(&self) -> (f32, f32)
Returns the tight frequency range of the type (usually a [
Note
]).
Essentially, 1/8 the way between the frequency and the next frequency on either side.source§impl HasNamedPitch for Note
impl HasNamedPitch for Note
source§fn named_pitch(&self) -> NamedPitch
fn named_pitch(&self) -> NamedPitch
Returns the named pitch of the type.
source§impl HasPrimaryHarmonicSeries for Note
impl HasPrimaryHarmonicSeries for Note
source§fn primary_harmonic_series(self) -> Vec<Self>
fn primary_harmonic_series(self) -> Vec<Self>
Returns the primary harmonic series of the note.
source§impl HasStaticName for Note
impl HasStaticName for Note
source§fn static_name(&self) -> &'static str
fn static_name(&self) -> &'static str
Returns the static name of the type.
source§impl NoteRecreator for Note
impl NoteRecreator for Note
source§fn with_named_pitch(self, named_pitch: NamedPitch) -> Self
fn with_named_pitch(self, named_pitch: NamedPitch) -> Self
Recreates this
Note
with the given NamedPitch
.source§impl Ord for Note
impl Ord for Note
source§impl PartialEq for Note
impl PartialEq for Note
source§impl PartialOrd for Note
impl PartialOrd for Note
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl ToUniversal for Note
impl ToUniversal for Note
source§fn to_universal(self) -> Note
fn to_universal(self) -> Note
Converts this note to a universal pitch.
impl Copy for Note
impl Eq for Note
impl StructuralEq for Note
impl StructuralPartialEq for Note
Auto Trait Implementations§
impl RefUnwindSafe for Note
impl Send for Note
impl Sync for Note
impl Unpin for Note
impl UnwindSafe for Note
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more