rytm_rs::object::pattern::track

Struct 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 Freeze for Track

§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

Source§

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>,

Source§

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>,

Source§

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.