Skip to main content

CenterPanel

Struct CenterPanel 

Source
pub struct CenterPanel {
Show 19 fields pub lower_part: Instrument, pub upper_part: Instrument, pub lower_octave_shift: OctaveShift, pub upper_octave_shift: OctaveShift, pub lower_sustain: bool, pub upper_sustain: bool, pub lower_control: bool, pub upper_control: bool, pub unknown_boolean1: bool, pub split: bool, pub split_point: SplitPoint, pub transpose_enabled: bool, pub transpose: Transpose, pub part_mix: PartMix, pub gain: Level, pub organ_type: OrganType, pub lower_enabled: bool, pub upper_enabled: bool, pub drawbar_live: bool, /* private fields */
}
Expand description

The center panel: part selection, split, transpose, gain, and the organ selector.

Unclaimed bits, kept verbatim through a re-encode: 48..=55.

The body’s map, in offset order:

bytesbitsfieldtype
0x00 bits 7..50..=2lower_partInstrument
0x00 bits 4..23..=5upper_partInstrument
0x00 bits 1..0; 0x01 bits 7..66..=9lower_octave_shiftOctaveShift
0x01 bits 5..210..=13upper_octave_shiftOctaveShift
0x01 bit 114..=14lower_sustainbool
0x01 bit 015..=15upper_sustainbool
0x02 bit 716..=16lower_controlbool
0x02 bit 617..=17upper_controlbool
0x02 bit 518..=18unknown_boolean1bool
0x02 bit 419..=19splitbool
0x02 bits 3..120..=22split_pointSplitPoint
0x02 bit 023..=23transpose_enabledbool
0x03 bits 7..424..=27transposeTranspose
0x03 bits 3..0; 0x04 bits 7..528..=34part_mixPartMix
0x04 bits 4..0; 0x05 bits 7..635..=41gainLevel
0x05 bits 5..342..=44organ_typeOrganType
0x05 bit 245..=45lower_enabledbool
0x05 bit 146..=46upper_enabledbool
0x05 bit 047..=47drawbar_livebool
0x0648..=55unclaimed

Fields§

§lower_part: Instrument

Bits 0..=2 (byte 0x00, bits 7..5).

§upper_part: Instrument

Bits 3..=5 (byte 0x00, bits 4..2).

§lower_octave_shift: OctaveShift

Bits 6..=9 (byte 0x00, bits 1..0; byte 0x01, bits 7..6).

§upper_octave_shift: OctaveShift

Bits 10..=13 (byte 0x01, bits 5..2).

§lower_sustain: bool

Bits 14..=14 (byte 0x01, bit 1).

§upper_sustain: bool

Bits 15..=15 (byte 0x01, bit 0).

§lower_control: bool

Bits 16..=16 (byte 0x02, bit 7).

§upper_control: bool

Bits 17..=17 (byte 0x02, bit 6).

§unknown_boolean1: bool

Zero in every specimen. Inferred from specimens; not confirmed on hardware.

Bits 18..=18 (byte 0x02, bit 5).

§split: bool

Bits 19..=19 (byte 0x02, bit 4).

§split_point: SplitPoint

Bits 20..=22 (byte 0x02, bits 3..1).

§transpose_enabled: bool

Sticky: the instrument sets this the first time transposition is changed and never clears it again, so it stays true after the value is put back to 0. It marks that transposition has been touched, not that the program is transposed.

The transpose light is on for transpose_enabled && transpose != 0. Neither field answers on its own — a caller reporting or editing transposition must read both. Confirmed on hardware.

Bits 23..=23 (byte 0x02, bit 0).

§transpose: Transpose

Half-step transposition, -6..=6, stored biased by 6.

Carries no meaning while transpose_enabled is clear: an untouched program stores +1 there rather than 0. Inferred from specimens; not confirmed on hardware. Every specimen with the enable clear holds +1.

Bits 24..=27 (byte 0x03, bits 7..4).

§part_mix: PartMix

Bits 28..=34 (byte 0x03, bits 3..0; byte 0x04, bits 7..5).

§gain: Level

Bits 35..=41 (byte 0x04, bits 4..0; byte 0x05, bits 7..6).

§organ_type: OrganType

Bits 42..=44 (byte 0x05, bits 5..3).

§lower_enabled: bool

Bits 45..=45 (byte 0x05, bit 2).

§upper_enabled: bool

Bits 46..=46 (byte 0x05, bit 1).

§drawbar_live: bool

Bits 47..=47 (byte 0x05, bit 0).

Implementations§

Source§

impl CenterPanel

Source

pub fn field_values(&self) -> Vec<FieldValue>

Every registered field’s current value, under its full path, in declaration order — nested bodies inline where their field sits. Describes the same fields as Self::field_specs, so callers may zip the two positionally.

Source

pub fn field_specs() -> Vec<FieldSpec>

Source

pub fn fields(&self) -> Vec<Field>

Every settable field, described under its full path.

Source

pub fn set_field(&mut self, path: &str, value: &str) -> Result<(), FieldError>

Set one field by its full path.

Trait Implementations§

Source§

impl Body for CenterPanel

Source§

const LEN: Option<u64>

Fixed body length, when the format has one; checked on read and write.
Source§

fn read<R: Read + Seek>( r: &mut BodyReader<'_, R>, _: &Header, ) -> Result<Self, Error>

Decode from r, which is scoped to the body: position 0 is the first body byte and BodyReader::len is known. header is for version gating and location/aux interpretation, not for layout — the container already consumed the header bytes.
Source§

fn write<W: Write + Seek>(&self, w: &mut BodyWriter<'_, W>) -> Result<(), Error>

Encode to w in one forward pass.
Source§

impl BodyLayout for CenterPanel

Source§

fn layout() -> &'static [LayoutField]

Every placed field, in declaration order. Bits no field claims are preserved by the codec but have no entry here — there is no name to report them under.
Source§

impl Debug for CenterPanel

The decoded values; the backing bytes are not printed.

Source§

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

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

impl Default for CenterPanel

Source§

fn default() -> CenterPanel

Returns the “default value” for a type. Read more
Source§

impl From<&CenterPanel> for [u8; 7]

Source§

fn from(p: &CenterPanel) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<[u8; 7]> for CenterPanel

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(raw: [u8; 7]) -> Result<Self, Self::Error>

Performs the conversion.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.