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.
Range 0..=127
Sourcepub fn try_default_with_device_id(
index: usize,
device_id: u8,
) -> Result<Self, RytmError>
pub fn try_default_with_device_id( index: usize, device_id: u8, ) -> Result<Self, RytmError>
Makes a new pattern with the project defaults.
Pattern index range: 0..=127Device id range:
0..=127`
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 work_buffer_default_with_device_id(device_id: u8) -> Self
pub fn work_buffer_default_with_device_id(device_id: u8) -> 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 fn tracks(&self) -> &[Track]
pub 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.