Instrument

Struct Instrument 

Source
pub struct Instrument {
Show 24 fields pub name: Name, pub filename: DosFilename, pub flags: InstrumentFlags, pub new_note_action: u8, pub duplicate_check_type: u8, pub duplicate_check_action: u8, pub instrument_fadeout: u8, pub pitch_pan_separation: i8, pub pitch_pan_centre: u8, pub global_volume: u8, pub default_panning: RangedU8<0, 128>, pub random_volume_variation: RangedU8<0, 100>, pub random_panning_variation: RangedU8<0, 64>, pub trkver: u16, pub number_of_samples: u8, pub initial_filter_cutoff: RangedU8<0, 128>, pub initial_filter_resonance: RangedU8<0, 128>, pub mch: u8, pub mpr: u8, pub mbank: [u8; 2], pub sample_map: SampleMap, pub volume_envelope: Envelope, pub panning_envelope: Envelope, pub pitch_filter_envelope: Envelope,
}

Fields§

§name: Name

Instrument Name, null-terminated (but may also contain nulls)

§filename: DosFilename

DOS Filename, null-terminated

§flags: InstrumentFlags§new_note_action: u8

New Note Action

§duplicate_check_type: u8

Duplicate Note Check Type

§duplicate_check_action: u8

Duplicate Note Check Action

§instrument_fadeout: u8

Instrument Fadeout

0..=256, although values up to 1024 would be sensible. Up to IT2.07, the limit was 0..=128.

OpenMPT uses u16 but we replaced it with u8 to limit the range.

§pitch_pan_separation: i8

Pitch/Pan Separatation

§pitch_pan_centre: u8

Pitch/Pan Centre

§global_volume: u8

Global Volume

§default_panning: RangedU8<0, 128>

Panning

§random_volume_variation: RangedU8<0, 100>

Random volume variation (percentage)

§random_panning_variation: RangedU8<0, 64>

Pan Swing

§trkver: u16

Tracker ID

§number_of_samples: u8

Number of embedded samples

§initial_filter_cutoff: RangedU8<0, 128>

Filter Cutoff

§initial_filter_resonance: RangedU8<0, 128>

Filter Resonance

§mch: u8

MIDI Channel

§mpr: u8

MIDI Program

§mbank: [u8; 2]

MIDI Bank

§sample_map: SampleMap

Sample / Transpose map

§volume_envelope: Envelope

Volume Envelope

§panning_envelope: Envelope

Pan Envelope

§pitch_filter_envelope: Envelope

Pitch / Filter Envelope

Trait Implementations§

Source§

impl Clone for Instrument

Source§

fn clone(&self) -> Instrument

Returns a duplicate 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 Instrument

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<I, C> Get<&I> for C
where C: Get<I>, I: Copy,

Source§

type Output = <C as Get<I>>::Output

Source§

fn get(&self, index: &I) -> Option<&<C as Get<&I>>::Output>

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,

Source§

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

Source§

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

Source§

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.