pub enum Instrument {
WavSynth(WavSynth),
MacroSynth(MacroSynth),
Sampler(Sampler),
MIDIOut(MIDIOut),
FMSynth(FMSynth),
HyperSynth(HyperSynth),
External(ExternalInst),
None,
}
Variants§
WavSynth(WavSynth)
MacroSynth(MacroSynth)
Sampler(Sampler)
MIDIOut(MIDIOut)
FMSynth(FMSynth)
HyperSynth(HyperSynth)
External(ExternalInst)
None
Implementations§
Source§impl Instrument
impl Instrument
pub const INSTRUMENT_MEMORY_SIZE: usize = 215usize
pub const V4_SIZE: usize = 215usize
pub fn is_empty(&self) -> bool
pub fn instr_command_text(&self, ver: Version) -> CommandPack
pub fn write(&self, ver: Version, w: &mut Writer)
pub fn name(&self) -> Option<&str>
pub fn set_name(&mut self, name: String)
pub fn equ(&self) -> Option<u8>
pub fn set_eq(&mut self, eq_ix: u8)
Sourcepub fn read_from_reader(reader: &mut Reader) -> M8Result<InstrumentWithEq>
pub fn read_from_reader(reader: &mut Reader) -> M8Result<InstrumentWithEq>
Read an in-memory instrument file along with its optional eq
Sourcepub fn read(reader: &mut impl Read) -> M8Result<InstrumentWithEq>
pub fn read(reader: &mut impl Read) -> M8Result<InstrumentWithEq>
Read a M8 instrument file along with its optional Eq definition.
Examples found in repository?
examples/read_instrument.rs (line 18)
14fn run() -> Result<(), Box<dyn Error>> {
15 let args: Vec<String> = env::args().collect();
16
17 let mut f = File::open(&args[1])?;
18 let instr = Instrument::read(&mut f)?;
19
20 dbg!(&instr.instrument);
21
22 match &instr.eq {
23 None => {}
24 Some(eq) => {
25 dbg!(eq);
26 }
27 };
28
29 Ok(())
30}
pub fn from_reader( reader: &mut Reader, number: u8, version: Version, ) -> M8Result<Self>
Trait Implementations§
Source§impl Clone for Instrument
impl Clone for Instrument
Source§fn clone(&self) -> Instrument
fn clone(&self) -> Instrument
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Instrument
impl Debug for Instrument
Source§impl Default for Instrument
impl Default for Instrument
Source§fn default() -> Instrument
fn default() -> Instrument
Returns the “default value” for a type. Read more
Source§impl Describable for Instrument
impl Describable for Instrument
Source§fn describe<PG: ParameterGatherer>(&self, pg: PG, ver: Version) -> PG
fn describe<PG: ParameterGatherer>(&self, pg: PG, ver: Version) -> PG
Method called to describte the content of the structure in any gatherer.
Source§impl PartialEq for Instrument
impl PartialEq for Instrument
impl StructuralPartialEq for Instrument
Auto Trait Implementations§
impl Freeze for Instrument
impl RefUnwindSafe for Instrument
impl Send for Instrument
impl Sync for Instrument
impl Unpin for Instrument
impl UnwindSafe for Instrument
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