Struct rytm_rs::object::pattern::track::Track

source ·
pub struct Track { /* private fields */ }
Expand description

Represents a single track in a pattern.

If the track index is 12 then this is the FX track.

Implementations§

source§

impl Track

source

pub fn trigs_mut(&mut self) -> &mut [Trig; 64]

Returns a mutable reference to the trigs in this track.

64 trigs in total.

source

pub fn set_default_trig_note( &mut self, default_trig_note: usize ) -> Result<(), RytmError>

Sets the default note for any trig in this track.

Range 0..=127

Follows the midi note convention. C-4 is 0x3C.

source

pub fn set_default_trig_velocity( &mut self, default_trig_velocity: usize ) -> Result<(), RytmError>

Sets the default velocity for any trig in this track.

Range 0..=127

source

pub fn set_default_trig_note_length(&mut self, default_trig_note_length: Length)

Sets the default note length for any trig in this track.

Range 0..=127

source

pub fn set_default_trig_flags<F: Into<TrigFlags>>( &mut self, default_trig_flags: F )

Sets the default trig flags for any trig in this track.

source

pub fn set_default_trig_probability( &mut self, default_trig_probability: usize ) -> Result<(), RytmError>

Sets the default trig probability for any trig in this track.

Range 0..=100

source

pub fn set_number_of_steps( &mut self, number_of_steps: usize ) -> Result<(), RytmError>

Sets the number of steps in this track.

Range 1..=64

source

pub fn set_quantize_amount( &mut self, quantize_amount: usize ) -> Result<(), RytmError>

Sets the quantize amount for this track.

Range 0..=127

source

pub fn set_sends_midi(&mut self, sends_midi: bool)

Sets whether this track sends MIDI.

source

pub fn set_speed(&mut self, speed: Speed)

Sets the speed for this track.

source

pub fn set_euclidean_mode(&mut self, euclidean_mode: bool)

Sets whether this track is in euclidean mode.

source

pub fn set_euclidean_pl1( &mut self, euclidean_pl1: usize ) -> Result<(), RytmError>

Sets the euclidean pulse length 1 for this track.

Number of pulses.

Range 0..=64

source

pub fn set_euclidean_pl2( &mut self, euclidean_pl2: usize ) -> Result<(), RytmError>

Sets the euclidean pulse length 2 for this track.

Number of pulses.

Range 0..=64

source

pub fn set_euclidean_ro1( &mut self, euclidean_ro1: usize ) -> Result<(), RytmError>

Sets the euclidean rotation 1 for this track.

Range 0..=126

Middle point 63

source

pub fn set_euclidean_ro2( &mut self, euclidean_ro2: usize ) -> Result<(), RytmError>

Sets the euclidean rotation 2 for this track.

Range 0..=126

Middle point 63

source

pub fn set_euclidean_tro( &mut self, euclidean_tro: usize ) -> Result<(), RytmError>

Sets the euclidean track rotation for this track.

Range 0..=126

Middle point 63

source

pub fn set_pad_scale(&mut self, pad_scale: PadScale)

Sets the pad scale for this track.

source

pub fn set_root_note(&mut self, root_note: RootNote)

Sets the root note for this track.

source

pub const fn trigs(&self) -> &[Trig; 64]

Returns a reference to the trigs in this track.

64 trigs in total.

source

pub const fn default_trig_note(&self) -> usize

Returns the default note for any trig in this track.

Range 0..=127

Follows the midi note convention. C-4 is 0x3C.

source

pub const fn default_trig_velocity(&self) -> usize

Returns the default velocity for any trig in this track.

Range 0..=127

source

pub const fn default_trig_note_length(&self) -> Length

Returns the default note length for any trig in this track.

source

pub const fn default_trig_flags(&self) -> TrigFlags

Returns the default trig flags for any trig in this track.

source

pub const fn default_trig_probability(&self) -> usize

Returns the default trig probability for any trig in this track.

Range 0..=100

source

pub const fn number_of_steps(&self) -> usize

Returns the number of steps in this track.

Range 1..=64

source

pub const fn quantize_amount(&self) -> usize

Returns the quantize amount for this track.

Range 0..=127

source

pub const fn sends_midi(&self) -> bool

Returns whether this track sends MIDI.

source

pub const fn speed(&self) -> Speed

Returns the speed for this track.

source

pub const fn euclidean_mode(&self) -> bool

Returns whether this track is in euclidean mode.

source

pub const fn euclidean_pl1(&self) -> usize

Returns the euclidean pulse length 1 for this track.

Number of pulses.

Range 0..=64

source

pub const fn euclidean_pl2(&self) -> usize

Returns the euclidean pulse length 2 for this track.

Number of pulses.

Range 0..=64

source

pub const fn euclidean_ro1(&self) -> usize

Returns the euclidean rotation 1 for this track.

Range 0..=126

Middle point 63

source

pub const fn euclidean_ro2(&self) -> usize

Returns the euclidean rotation 2 for this track.

Range 0..=126

Middle point 63

source

pub const fn euclidean_tro(&self) -> usize

Returns the euclidean track rotation for this track.

Range 0..=126

Middle point 63

source

pub const fn pad_scale(&self) -> PadScale

Returns the pad scale for this track.

source

pub const fn root_note(&self) -> RootNote

Returns the root note for this track.

source

pub fn clear_all_plocks(&self)

Clears all the parameter locks for this track.

source

pub const fn index(&self) -> usize

Returns the index of this track.

source

pub const fn owner_pattern_index(&self) -> usize

Returns the index of the pattern that owns this track.

Trait Implementations§

source§

impl Clone for Track

source§

fn clone(&self) -> Track

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Track

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<&Track> for ar_pattern_track_t

source§

fn from(track: &Track) -> Self

Converts to this type from the input type.
source§

impl Serialize for Track

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Track

§

impl Send for Track

§

impl Sync for Track

§

impl Unpin for Track

§

impl UnwindSafe for Track

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.