Struct instrument::Voice [] [src]

pub struct Voice<NF> {
    pub note: Option<Note<NF>>,
    pub playhead: Playhead,
}

A single Voice. A Synth may consist of any number of Voices.

Fields

Data for a note, if there is one currently being played.

Playhead represents the number of frames played since note became Some.

Number of frames played since the beginning of the note.

Methods

impl<NF> Voice<NF>
[src]

Constructor for a Voice.

Reset the voice's playheads.

Trigger playback with the given note, resetting all playheads.

Release playback of the current not eif there is one.

Stop playback of the current note if there is one and reset the playheads.

The velocity and frequency of the voice for the next frame.

Trait Implementations

impl<NF: Clone> Clone for Voice<NF>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<NF: Debug> Debug for Voice<NF>
[src]

Formats the value using the given formatter.

impl<NF: PartialEq> PartialEq for Voice<NF>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.