Skip to main content

Program

Struct Program 

Source
pub struct Program {
Show 29 fields pub panel_b_selected: bool, pub panel_enable: PanelEnable, pub split_enabled: bool, pub split_low_enabled: bool, pub split_mid_enabled: bool, pub split_high_enabled: bool, pub split_low_note: SplitNote, pub split_mid_note: SplitNote, pub split_high_note: SplitNote, pub split_low_width: SplitWidth, pub split_mid_width: SplitWidth, pub split_high_width: SplitWidth, pub piano_layer_detune: PianoLayerDetune, pub organ_pitch_stick: bool, pub organ_vibrato_mode: OrganVibratoMode, pub rotary_speaker_speed: RotorSpeed, pub rotary_speaker_stop_mode: bool, pub rotary_speaker_speed_wheel: SwitchMorph, pub rotary_speaker_speed_aftertouch: SwitchMorph, pub rotary_speaker_speed_ctrl_pedal: SwitchMorph, pub transpose_enabled: bool, pub transpose: StageTranspose, pub master_clock: MasterTempo, pub rotary_speaker_drive: Level, pub dual_keyboard: bool, pub dual_keyboard_style: DualKeyboardStyle, pub synth_pitch_stick_range: Selector<4>, pub panel_a: Panel, pub panel_b: Panel, /* private fields */
}
Expand description

The program-wide globals at the head of the body. Bits are MSB-first from body byte 0 (0x2c in a type-1 file), so byte 0x05 bit 7 is bit 40.

Reads and writes byte-exactly. A read verifies the container checksum, gates on KNOWN_VERSIONS, and range-checks every field; unclaimed bits survive a re-encode verbatim. Placements from the community byte maps; values raw except where those maps enumerate them. Inferred from specimens; not confirmed on hardware.

⚠️ The three split notes can be stored out of order — the panel reorders them on display (documented with specimens in the ns3-program-viewer sources). The decode reports what is stored.

Unclaimed bits, kept verbatim through a re-encode: 0..=39, 82..=95, 117, 124..=175.

The body’s map, in offset order:

bytesbitsfieldtype
0x00..0x050..=39unclaimed
0x05 bit 740..=40panel_b_selectedbool
0x05 bits 6..541..=42panel_enablePanelEnable
0x05 bit 443..=43split_enabledbool
0x05 bit 344..=44split_low_enabledbool
0x05 bit 245..=45split_mid_enabledbool
0x05 bit 146..=46split_high_enabledbool
0x05 bit 0; 0x06 bits 7..547..=50split_low_noteSplitNote
0x06 bits 4..151..=54split_mid_noteSplitNote
0x06 bit 0; 0x07 bits 7..555..=58split_high_noteSplitNote
0x07 bits 4..359..=60split_low_widthSplitWidth
0x07 bits 2..161..=62split_mid_widthSplitWidth
0x07 bit 0; 0x08 bit 763..=64split_high_widthSplitWidth
0x08 bits 6..565..=66piano_layer_detunePianoLayerDetune
0x08 bit 467..=67organ_pitch_stickbool
0x08 bits 3..168..=70organ_vibrato_modeOrganVibratoMode
0x08 bit 071..=71rotary_speaker_speedRotorSpeed
0x09 bit 772..=72rotary_speaker_stop_modebool
0x09 bits 6..473..=75rotary_speaker_speed_wheelSwitchMorph
0x09 bits 3..176..=78rotary_speaker_speed_aftertouchSwitchMorph
0x09 bit 0; 0x0a bits 7..679..=81rotary_speaker_speed_ctrl_pedalSwitchMorph
0x0a bits 5..0; 0x0b bits 7..082..=95unclaimed
0x0c bit 796..=96transpose_enabledbool
0x0c bits 6..397..=100transposeStageTranspose
0x0c bits 2..0; 0x0d bits 7..3101..=108master_clockMasterTempo
0x0d bits 2..0; 0x0e bits 7..4109..=115rotary_speaker_driveLevel
0x0e bit 3116..=116dual_keyboardbool
0x0e bit 2117..=117unclaimed
0x0e bits 1..0118..=119dual_keyboard_styleDualKeyboardStyle
0x0f bits 7..4120..=123synth_pitch_stick_rangeSelector<4>
0x0f bits 3..0; 0x10 bits 7..0; 0x11 bits 7..0; 0x12 bits 7..0; 0x13 bits 7..0; 0x14 bits 7..0; 0x15 bits 7..0124..=175unclaimed
0x16..0x11d176..=2279panel_aPanel
0x11d..0x2242280..=4383panel_bPanel

Fields§

§panel_b_selected: bool

Bits 40..=40 (byte 0x05, bit 7).

§panel_enable: PanelEnable

Bits 41..=42 (byte 0x05, bits 6..5).

§split_enabled: bool

Bits 43..=43 (byte 0x05, bit 4).

§split_low_enabled: bool

Bits 44..=44 (byte 0x05, bit 3).

§split_mid_enabled: bool

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

§split_high_enabled: bool

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

§split_low_note: SplitNote

Bits 47..=50 (byte 0x05, bit 0; byte 0x06, bits 7..5).

§split_mid_note: SplitNote

Bits 51..=54 (byte 0x06, bits 4..1).

§split_high_note: SplitNote

Bits 55..=58 (byte 0x06, bit 0; byte 0x07, bits 7..5).

§split_low_width: SplitWidth

Bits 59..=60 (byte 0x07, bits 4..3).

§split_mid_width: SplitWidth

Bits 61..=62 (byte 0x07, bits 2..1).

§split_high_width: SplitWidth

Bits 63..=64 (byte 0x07, bit 0; byte 0x08, bit 7).

§piano_layer_detune: PianoLayerDetune

Bits 65..=66 (byte 0x08, bits 6..5).

§organ_pitch_stick: bool

Bits 67..=67 (byte 0x08, bit 4).

§organ_vibrato_mode: OrganVibratoMode

Bits 68..=70 (byte 0x08, bits 3..1).

§rotary_speaker_speed: RotorSpeed

Bits 71..=71 (byte 0x08, bit 0).

§rotary_speaker_stop_mode: bool

Bits 72..=72 (byte 0x09, bit 7).

§rotary_speaker_speed_wheel: SwitchMorph

Bits 73..=75 (byte 0x09, bits 6..4).

§rotary_speaker_speed_aftertouch: SwitchMorph

Bits 76..=78 (byte 0x09, bits 3..1).

§rotary_speaker_speed_ctrl_pedal: SwitchMorph

Bits 79..=81 (byte 0x09, bit 0; byte 0x0a, bits 7..6).

§transpose_enabled: bool

Bits 96..=96 (byte 0x0c, bit 7).

§transpose: StageTranspose

Bits 97..=100 (byte 0x0c, bits 6..3).

§master_clock: MasterTempo

Bits 101..=108 (byte 0x0c, bits 2..0; byte 0x0d, bits 7..3).

§rotary_speaker_drive: Level

Bits 109..=115 (byte 0x0d, bits 2..0; byte 0x0e, bits 7..4).

§dual_keyboard: bool

Bits 116..=116 (byte 0x0e, bit 3).

§dual_keyboard_style: DualKeyboardStyle

Bits 118..=119 (byte 0x0e, bits 1..0).

§synth_pitch_stick_range: Selector<4>

Bits 120..=123 (byte 0x0f, bits 7..4).

§panel_a: Panel

Panel A — the first of the program’s two complete setups.

Bytes 0x16..0x11d.

§panel_b: Panel

Panel B. Same type: the two are the same layout, and neither is a copy of the other — panel_enable says which sound.

Bytes 0x11d..0x224.

Implementations§

Source§

impl Program

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 Program

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 Program

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 Program

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 From<&Program> for [u8; 548]

Source§

fn from(p: &Program) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<[u8; 548]> for Program

Source§

type Error = ParseError

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

fn try_from(raw: [u8; 548]) -> 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.