Struct rytm_rs::object::kit::Kit

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

Represents a kit in the analog rytm.

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

Implementations§

source§

impl Kit

source

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

Makes a new kit with the given index complying to project defaults.

Range: 0..=127

source

pub fn work_buffer_default() -> Self

Makes a new kit in the work buffer complying to project defaults as if it comes from the work buffer.

source

pub fn set_name(&mut self, name: &str) -> Result<(), RytmError>

Sets the name of the kit.

Errors

The name must be ASCII and have a length of 15 characters or less. Other cases will result in an error.

source

pub fn name(&self) -> &str

Returns the name of the kit.

source

pub const fn sounds(&self) -> &[Sound; 12]

Returns the sounds assigned to the kit in the order of the tracks.

source

pub fn sounds_mut(&mut self) -> &mut [Sound; 12]

Returns the sounds assigned to the kit in the order of the tracks mutably.

source

pub fn set_track_level( &mut self, track_index: usize, level: usize ) -> Result<(), RytmError>

Sets the level of a track.

Range 0..=12

12th track is the fx track.

source

pub fn set_all_track_levels(&mut self, level: usize) -> Result<(), RytmError>

Sets the level of all tracks including the Fx track.

Range 0..=127

source

pub fn set_a_range_of_track_levels( &mut self, range: Range<usize>, level: usize ) -> Result<(), RytmError>

Sets the level of a range of tracks.

12th track is the fx track.

Maximum range 0..=12

Level range 0..=127

source

pub fn track_level(&self, track_index: usize) -> Result<usize, RytmError>

Gets the level of a track.

Range 0..=12

source

pub fn track_levels(&self) -> Vec<usize>

Gets the level of all tracks including the Fx track.

Range 0..=127

source

pub fn range_of_track_levels( &self, range: Range<usize> ) -> Result<Vec<usize>, RytmError>

Gets the level of a range of tracks.

12th track is the fx track.

Maximum range 0..=12

Level range 0..=127

Errors

Returns an error if the range is out of bounds.

source

pub const fn structure_version(&self) -> u32

Returns the version of the kit structure.

source

pub fn track_retrig_settings( &self, track_index: usize ) -> Result<&TrackRetrigMenu, RytmError>

Gets the retrig menu of a track

12th track is the fx track.

Range 0..=12

source

pub fn track_retrig_settings_mut( &mut self, track_index: usize ) -> Result<&mut TrackRetrigMenu, RytmError>

Gets the retrig menu of a track mutably

12th track is the fx track.

Range 0..=12

source

pub const fn fx_delay(&self) -> &FxDelay

Gets the fx delay parameters.

source

pub fn fx_delay_mut(&mut self) -> &mut FxDelay

Gets the fx delay parameters mutably.

source

pub const fn fx_distortion(&self) -> &FxDistortion

Gets the fx distortion parameters.

source

pub fn fx_distortion_mut(&mut self) -> &mut FxDistortion

Gets the fx distortion parameters mutably.

source

pub const fn fx_reverb(&self) -> &FxReverb

Gets the fx reverb parameters.

source

pub fn fx_reverb_mut(&mut self) -> &mut FxReverb

Gets the fx reverb parameters mutably.

source

pub const fn fx_compressor(&self) -> &FxCompressor

Gets the fx compressor parameters.

source

pub fn fx_compressor_mut(&mut self) -> &mut FxCompressor

Gets the fx compressor parameters mutably.

source

pub const fn fx_lfo(&self) -> &FxLfo

Gets the fx lfo parameters.

source

pub fn fx_lfo_mut(&mut self) -> &mut FxLfo

Gets the fx lfo parameters mutably.

source

pub const fn index(&self) -> usize

Returns the index of the kit.

source

pub fn set_control_in_1_mod_target_1( &mut self, control_in_1_mod_target_1: ControlInModTarget )

Sets the control in 1 mod target 1

source

pub fn set_control_in_1_mod_target_2( &mut self, control_in_1_mod_target_2: ControlInModTarget )

Sets the control in 1 mod target 2

source

pub fn set_control_in_1_mod_target_3( &mut self, control_in_1_mod_target_3: ControlInModTarget )

Sets the control in 1 mod target 3

source

pub fn set_control_in_1_mod_target_4( &mut self, control_in_1_mod_target_4: ControlInModTarget )

Sets the control in 1 mod target 4

source

pub fn set_control_in_2_mod_target_1( &mut self, control_in_2_mod_target_1: ControlInModTarget )

Sets the control in 2 mod target 1

source

pub fn set_control_in_2_mod_target_2( &mut self, control_in_2_mod_target_2: ControlInModTarget )

Sets the control in 2 mod target 2

source

pub fn set_control_in_2_mod_target_3( &mut self, control_in_2_mod_target_3: ControlInModTarget )

Sets the control in 2 mod target 3

source

pub fn set_control_in_2_mod_target_4( &mut self, control_in_2_mod_target_4: ControlInModTarget )

Sets the control in 2 mod target 4

source

pub fn set_control_in_1_mod_amt_1( &mut self, control_in_1_mod_amt_1: isize ) -> Result<(), RytmError>

Sets the control in 1 mod amt 1

Range: -128..=127

source

pub fn set_control_in_1_mod_amt_2( &mut self, control_in_1_mod_amt_2: isize ) -> Result<(), RytmError>

Sets the control in 1 mod amt 2

Range: -128..=127

source

pub fn set_control_in_1_mod_amt_3( &mut self, control_in_1_mod_amt_3: isize ) -> Result<(), RytmError>

Sets the control in 1 mod amt 3

Range: -128..=127

source

pub fn set_control_in_1_mod_amt_4( &mut self, control_in_1_mod_amt_4: isize ) -> Result<(), RytmError>

Sets the control in 1 mod amt 4

Range: -128..=127

source

pub fn set_control_in_2_mod_amt_1( &mut self, control_in_2_mod_amt_1: isize ) -> Result<(), RytmError>

Sets the control in 2 mod amt 1

Range: -128..=127

source

pub fn set_control_in_2_mod_amt_2( &mut self, control_in_2_mod_amt_2: isize ) -> Result<(), RytmError>

Sets the control in 2 mod amt 2

Range: -128..=127

source

pub fn set_control_in_2_mod_amt_3( &mut self, control_in_2_mod_amt_3: isize ) -> Result<(), RytmError>

Sets the control in 2 mod amt 3

Range: -128..=127

source

pub fn set_control_in_2_mod_amt_4( &mut self, control_in_2_mod_amt_4: isize ) -> Result<(), RytmError>

Sets the control in 2 mod amt 4

Range: -128..=127

source

pub const fn control_in_1_mod_target_1(&self) -> ControlInModTarget

Gets the control in 1 mod target 1

source

pub const fn control_in_1_mod_target_2(&self) -> ControlInModTarget

Gets the control in 1 mod target 2

source

pub const fn control_in_1_mod_target_3(&self) -> ControlInModTarget

Gets the control in 1 mod target 3

source

pub const fn control_in_1_mod_target_4(&self) -> ControlInModTarget

Gets the control in 1 mod target 4

source

pub const fn control_in_2_mod_target_1(&self) -> ControlInModTarget

Gets the control in 2 mod target 1

source

pub const fn control_in_2_mod_target_2(&self) -> ControlInModTarget

Gets the control in 2 mod target 2

source

pub const fn control_in_2_mod_target_3(&self) -> ControlInModTarget

Gets the control in 2 mod target 3

source

pub const fn control_in_2_mod_target_4(&self) -> ControlInModTarget

Gets the control in 2 mod target 4

source

pub const fn control_in_1_mod_amt_1(&self) -> isize

Gets the control in 1 mod amt 1

Range: -128..=127

source

pub const fn control_in_1_mod_amt_2(&self) -> isize

Gets the control in 1 mod amt 2

Range: -128..=127

source

pub const fn control_in_1_mod_amt_3(&self) -> isize

Gets the control in 1 mod amt 3

Range: -128..=127

source

pub const fn control_in_1_mod_amt_4(&self) -> isize

Gets the control in 1 mod amt 4

Range: -128..=127

source

pub const fn control_in_2_mod_amt_1(&self) -> isize

Gets the control in 2 mod amt 1

Range: -128..=127

source

pub const fn control_in_2_mod_amt_2(&self) -> isize

Gets the control in 2 mod amt 2

Range: -128..=127

source

pub const fn control_in_2_mod_amt_3(&self) -> isize

Gets the control in 2 mod amt 3

Range: -128..=127

source

pub const fn control_in_2_mod_amt_4(&self) -> isize

Gets the control in 2 mod amt 4

Range: -128..=127

Trait Implementations§

source§

impl Clone for Kit

source§

fn clone(&self) -> Kit

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 Kit

source§

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

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

impl<'de> Deserialize<'de> for Kit

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<&Kit> for ar_kit_t

source§

fn from(kit: &Kit) -> Self

Converts to this type from the input type.
source§

impl Serialize for Kit

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 Kit

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§

§

impl RefUnwindSafe for Kit

§

impl Send for Kit

§

impl Sync for Kit

§

impl Unpin for Kit

§

impl UnwindSafe for Kit

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