pub struct ChannelWriter<'a> { /* private fields */ }Expand description
Appends notes and rests to one channel of a Score.
Implementations§
Source§impl ChannelWriter<'_>
impl ChannelWriter<'_>
Sourcepub fn instrument(&mut self, index: usize) -> Result<&mut Self>
pub fn instrument(&mut self, index: usize) -> Result<&mut Self>
Selects the instrument for the following notes, by its index.
Sourcepub fn volume(&mut self, volume: u8) -> Result<&mut Self>
pub fn volume(&mut self, volume: u8) -> Result<&mut Self>
Channel volume for the following notes, 0 through 15. The default is 15.
Sourcepub fn gate(&mut self, eighths: u8) -> Result<&mut Self>
pub fn gate(&mut self, eighths: u8) -> Result<&mut Self>
The part of each following note, in eighths, played before its release. The default is 8.
pub fn note(&mut self, pitch: Pitch, length: Length) -> Result<&mut Self>
Sourcepub fn note_with_velocity(
&mut self,
pitch: Pitch,
length: Length,
velocity: u8,
) -> Result<&mut Self>
pub fn note_with_velocity( &mut self, pitch: Pitch, length: Length, velocity: u8, ) -> Result<&mut Self>
Appends a note with velocity 0..=127, independently of channel volume.
Sourcepub fn chord(&mut self, pitches: &[Pitch], length: Length) -> Result<&mut Self>
pub fn chord(&mut self, pitches: &[Pitch], length: Length) -> Result<&mut Self>
Appends 1..=16 distinct simultaneous pitches, advancing once. Requires a synthwave instrument and no more members than its configured voice limit.
pub fn chord_with_velocity( &mut self, pitches: &[Pitch], length: Length, velocity: u8, ) -> Result<&mut Self>
pub fn rest(&mut self, length: Length) -> Result<&mut Self>
Sourcepub fn tie(&mut self, length: Length) -> Result<&mut Self>
pub fn tie(&mut self, length: Length) -> Result<&mut Self>
Lengthens the previous note, or the previous rest, by length.
Sourcepub fn loop_point(&mut self) -> Result<&mut Self>
pub fn loop_point(&mut self) -> Result<&mut Self>
Marks the current position as the song’s loop point. All channels that mark one must mark the same tick.
Auto Trait Implementations§
impl<'a> !UnwindSafe for ChannelWriter<'a>
impl<'a> Freeze for ChannelWriter<'a>
impl<'a> RefUnwindSafe for ChannelWriter<'a>
impl<'a> Send for ChannelWriter<'a>
impl<'a> Sync for ChannelWriter<'a>
impl<'a> Unpin for ChannelWriter<'a>
impl<'a> UnsafeUnpin for ChannelWriter<'a>
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