pub struct Preset {
pub index: u8,
pub modules: [ModuleState; 8],
pub volume: u8,
pub chain: [u8; 7],
pub name: String,
pub raw: [u8; 110],
}Expand description
A preset (SysEx 0x0B / 0x0C), kept with its raw record so unknown bytes survive a round trip.
Fields§
§index: u8§modules: [ModuleState; 8]Indexed by Module as usize for the eight effect modules.
volume: u8§chain: [u8; 7]Chain order of the seven non-gate modules (module indices).
name: String§raw: [u8; 110]Implementations§
Source§impl Preset
impl Preset
Sourcepub fn from_packed(midi: &[u8]) -> Option<Preset>
pub fn from_packed(midi: &[u8]) -> Option<Preset>
From the packed SysEx body (after <dir>).
pub fn from_raw(b: &[u8]) -> Option<Preset>
Sourcepub fn to_raw(&self) -> [u8; 110]
pub fn to_raw(&self) -> [u8; 110]
The 110-byte record: the original raw bytes with every decoded field written back. Param-count bytes are only recomputed for modules whose model changed.
pub fn module(&self, m: Module) -> Option<&ModuleState>
pub fn module_mut(&mut self, m: Module) -> Option<&mut ModuleState>
Sourcepub fn same_sound(&self, other: &Preset) -> bool
pub fn same_sound(&self, other: &Preset) -> bool
Whether the decoded sound (modules, volume, chain) is the same, ignoring unused params.
Trait Implementations§
impl Eq for Preset
impl StructuralPartialEq for Preset
Auto Trait Implementations§
impl Freeze for Preset
impl RefUnwindSafe for Preset
impl Send for Preset
impl Sync for Preset
impl Unpin for Preset
impl UnsafeUnpin for Preset
impl UnwindSafe for Preset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more