pub struct Counterpoint {
pub voices: Vec<Melody>,
pub voice_names: Vec<String>,
}Expand description
Several independent melodic lines sounding together with labels.
Fields§
§voices: Vec<Melody>The independent melodic voices.
voice_names: Vec<String>Display names for each voice, parallel to voices.
Implementations§
Source§impl Counterpoint
impl Counterpoint
Sourcepub fn new(
voices: Vec<Melody>,
voice_names: Vec<String>,
) -> Result<Self, MusicError>
pub fn new( voices: Vec<Melody>, voice_names: Vec<String>, ) -> Result<Self, MusicError>
Builds counterpoint, supplying default voice names when the counts mismatch.
Sourcepub fn normalized_voice_names(&self) -> Vec<String>
pub fn normalized_voice_names(&self) -> Vec<String>
Returns voice names, filling in defaults when the stored list is wrong-length.
Trait Implementations§
Source§impl Clone for Counterpoint
impl Clone for Counterpoint
Source§fn clone(&self) -> Counterpoint
fn clone(&self) -> Counterpoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Counterpoint
impl Debug for Counterpoint
impl Eq for Counterpoint
Source§impl MusicObject for Counterpoint
impl MusicObject for Counterpoint
Source§impl PartialEq for Counterpoint
impl PartialEq for Counterpoint
impl StructuralPartialEq for Counterpoint
Auto Trait Implementations§
impl Freeze for Counterpoint
impl RefUnwindSafe for Counterpoint
impl Send for Counterpoint
impl Sync for Counterpoint
impl Unpin for Counterpoint
impl UnsafeUnpin for Counterpoint
impl UnwindSafe for Counterpoint
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