Struct rytm_rs::object::pattern::Pattern

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

Represents a pattern in the analog rytm.

It does not map identically to the structure in the firmware.

Implementations§

source§

impl Pattern

source

pub fn try_default(index: usize) -> Result<Self, RytmError>

Makes a new pattern with the project defaults.

source

pub fn work_buffer_default() -> Self

Makes a new pattern with the project defaults as if it is in the work buffer..

source

pub fn tracks_mut(&mut self) -> &mut [Track]

Returns a mutable reference to the tracks which this pattern contains.

13th element is the FX track.

source

pub fn set_master_length( &mut self, master_length: usize ) -> Result<(), RytmError>

Sets master length for the pattern.

Range 1..=1024

  • 1 = Infinite
  • 2 = 2

and onwards.

source

pub fn set_swing_amount(&mut self, swing_amount: usize) -> Result<(), RytmError>

Sets swing amount for the pattern.

Range 50..=80

Range denotes percentage.

source

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

Sets the speed for the pattern.

Check Speed for options.

source

pub fn set_global_quantize( &mut self, global_quantize: usize ) -> Result<(), RytmError>

Sets the global quantize for the pattern.

Range 0..=127

source

pub fn set_kit_number(&mut self, kit_number: usize) -> Result<(), RytmError>

Sets the kit number for the pattern.

Range 0..=127

source

pub fn set_time_mode(&mut self, time_mode: TimeMode)

Sets the time mode for the pattern.

Check TimeMode for options.

source

pub fn set_master_change( &mut self, master_change: usize ) -> Result<(), RytmError>

Sets the master change for the pattern.

Range 1..=1024

  • 1 = OFF
  • 2 = 2

and onwards.

source

pub fn set_bpm(&mut self, bpm: f32) -> Result<(), RytmError>

Sets the BPM for the pattern.

Range 30.0..=300.0

This is only effective when pattern level bpm is enabled.

source

pub const fn tracks(&self) -> &[Track]

Returns a reference to the tracks which this pattern contains.

13th element is the FX track.

source

pub const fn master_length(&self) -> usize

Returns the master length for the pattern.

Range 1..=1024

  • 1 = Infinite
  • 2 = 2

and onwards.

source

pub const fn swing_amount(&self) -> usize

Returns the swing amount for the pattern.

Range 50..=80

Range denotes percentage.

source

pub const fn speed(&self) -> Speed

Returns the speed for the pattern.

Check Speed for options.

source

pub const fn global_quantize(&self) -> usize

Returns the global quantize for the pattern.

Range 0..=127

source

pub const fn kit_number(&self) -> usize

Returns the kit number for the pattern.

Range 0..=127

source

pub const fn time_mode(&self) -> TimeMode

Returns the time mode for the pattern.

Check TimeMode for options.

source

pub const fn master_change(&self) -> usize

Returns the master change for the pattern.

Range 1..=1024

  • 1 = OFF
  • 2 = 2

and onwards.

source

pub const fn bpm(&self) -> f32

Returns the BPM for the pattern.

Range 30.0..=300.0

This is only effective when pattern level bpm is enabled.

source

pub const fn index(&self) -> usize

Returns the index of the pattern.

source

pub const fn is_work_buffer_pattern(&self) -> bool

Checks if this pattern is the pattern at work buffer.

source

pub const fn structure_version(&self) -> u32

Returns the version of the pattern structure.

source

pub fn clear_all_plocks(&mut self)

Clears all the parameter locks for this pattern.

source

pub fn clear_all_plocks_for_track( &mut self, track_index: u8 ) -> Result<(), RytmError>

Clears all the parameter locks for the given track in this pattern.

Range 0..=12

Trait Implementations§

source§

impl Clone for Pattern

source§

fn clone(&self) -> Pattern

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 Pattern

source§

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

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

impl<'de> Deserialize<'de> for Pattern

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&Pattern> for ar_pattern_t

source§

fn from(pattern: &Pattern) -> Self

Converts to this type from the input type.
source§

impl Serialize for Pattern

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
source§

impl SysexCompatible for Pattern

source§

fn as_sysex(&self) -> Result<Vec<u8>, RytmError>

Serializes the object to a sysex message. Read more
source§

fn sysex_type(&self) -> AnySysexType

Returns the sysex type of the object.

Auto Trait Implementations§

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,