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
impl Pattern
sourcepub fn try_default(index: usize) -> Result<Self, RytmError>
pub fn try_default(index: usize) -> Result<Self, RytmError>
Makes a new pattern with the project defaults.
sourcepub fn work_buffer_default() -> Self
pub fn work_buffer_default() -> Self
Makes a new pattern with the project defaults as if it is in the work buffer..
sourcepub fn tracks_mut(&mut self) -> &mut [Track]
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.
sourcepub fn set_master_length(
&mut self,
master_length: usize
) -> Result<(), RytmError>
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.
sourcepub fn set_swing_amount(&mut self, swing_amount: usize) -> Result<(), RytmError>
pub fn set_swing_amount(&mut self, swing_amount: usize) -> Result<(), RytmError>
Sets swing amount for the pattern.
Range 50..=80
Range denotes percentage.
sourcepub fn set_speed(&mut self, speed: Speed)
pub fn set_speed(&mut self, speed: Speed)
Sets the speed for the pattern.
Check Speed
for options.
sourcepub fn set_global_quantize(
&mut self,
global_quantize: usize
) -> Result<(), RytmError>
pub fn set_global_quantize( &mut self, global_quantize: usize ) -> Result<(), RytmError>
Sets the global quantize for the pattern.
Range 0..=127
sourcepub fn set_kit_number(&mut self, kit_number: usize) -> Result<(), RytmError>
pub fn set_kit_number(&mut self, kit_number: usize) -> Result<(), RytmError>
Sets the kit number for the pattern.
Range 0..=127
sourcepub fn set_time_mode(&mut self, time_mode: TimeMode)
pub fn set_time_mode(&mut self, time_mode: TimeMode)
Sets the time mode for the pattern.
Check TimeMode
for options.
sourcepub fn set_master_change(
&mut self,
master_change: usize
) -> Result<(), RytmError>
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.
sourcepub fn set_bpm(&mut self, bpm: f32) -> Result<(), RytmError>
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.
sourcepub const fn tracks(&self) -> &[Track]
pub const fn tracks(&self) -> &[Track]
Returns a reference to the tracks which this pattern contains.
13th element is the FX track.
sourcepub const fn master_length(&self) -> usize
pub const fn master_length(&self) -> usize
Returns the master length for the pattern.
Range 1..=1024
1
=Infinite
2
=2
and onwards.
sourcepub const fn swing_amount(&self) -> usize
pub const fn swing_amount(&self) -> usize
Returns the swing amount for the pattern.
Range 50..=80
Range denotes percentage.
sourcepub const fn global_quantize(&self) -> usize
pub const fn global_quantize(&self) -> usize
Returns the global quantize for the pattern.
Range 0..=127
sourcepub const fn kit_number(&self) -> usize
pub const fn kit_number(&self) -> usize
Returns the kit number for the pattern.
Range 0..=127
sourcepub const fn time_mode(&self) -> TimeMode
pub const fn time_mode(&self) -> TimeMode
Returns the time mode for the pattern.
Check TimeMode
for options.
sourcepub const fn master_change(&self) -> usize
pub const fn master_change(&self) -> usize
Returns the master change for the pattern.
Range 1..=1024
1
=OFF
2
=2
and onwards.
sourcepub const fn bpm(&self) -> f32
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.
sourcepub const fn is_work_buffer_pattern(&self) -> bool
pub const fn is_work_buffer_pattern(&self) -> bool
Checks if this pattern is the pattern at work buffer.
sourcepub const fn structure_version(&self) -> u32
pub const fn structure_version(&self) -> u32
Returns the version of the pattern structure.
sourcepub fn clear_all_plocks(&mut self)
pub fn clear_all_plocks(&mut self)
Clears all the parameter locks for this pattern.