Skip to main content

Program

Struct Program 

Source
pub struct Program {
Show 35 fields pub slot_selection: Selector<2>, pub dual_keyboard: bool, pub split_low_note: SplitNote, pub split_high_note: SplitNote, pub split_three_zones: bool, pub split_two_zones: bool, pub organ_pitch_stick: bool, pub transpose_enabled: bool, pub transpose: StageTranspose, pub master_clock: MasterTempo, pub organ_model: Selector<2>, pub organ_b3_vibrato_mode: Selector<3>, pub organ_b3_harmonic_third: bool, pub organ_b3_decay_fast: bool, pub organ_b3_volume_soft: bool, pub organ_vox_vibrato_mode: Selector<2>, pub organ_vox_vibrato_on: bool, pub organ_farfisa_vibrato_mode: Selector<2>, pub organ_farfisa_vibrato_on: bool, pub piano_slot_detune: Selector<3>, pub reverb_on: bool, pub reverb_type: ReverbType, pub reverb_amount: Level, pub compressor_on: bool, pub compressor_amount: Level, pub rotary_speaker_on: bool, pub rotary_speaker_source: Selector<2>, pub rotary_speaker_drive: Level, pub rotary_speaker_stop_mode: bool, pub rotary_speaker_speed: RotorSpeed, pub rotary_speaker_speed_wheel: MorphOf<1>, pub rotary_speaker_speed_aftertouch: MorphOf<1>, pub rotary_speaker_speed_ctrl_pedal: MorphOf<1>, pub slot_a: Slot, pub slot_b: Slot, /* 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 0x02 bit 5 is bit 18.

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.

Unclaimed bits, kept verbatim through a re-encode: 0..=15, 19, 30..=32, 39..=42, 51..=63, 66..=71, 78..=88, 92..=104, 108..=119, 123..=135, 170..=183.

The body’s map, in offset order:

bytesbitsfieldtype
0x00..0x020..=15unclaimed
0x02 bits 7..616..=17slot_selectionSelector<2>
0x02 bit 518..=18dual_keyboardbool
0x02 bit 419..=19unclaimed
0x02 bits 3..020..=23split_low_noteSplitNote
0x03 bits 7..424..=27split_high_noteSplitNote
0x03 bit 328..=28split_three_zonesbool
0x03 bit 229..=29split_two_zonesbool
0x03 bits 1..0; 0x04 bit 730..=32unclaimed
0x04 bit 633..=33organ_pitch_stickbool
0x04 bit 534..=34transpose_enabledbool
0x04 bits 4..135..=38transposeStageTranspose
0x04 bit 0; 0x05 bits 7..539..=42unclaimed
0x05 bits 4..0; 0x06 bits 7..543..=50master_clockMasterTempo
0x06 bits 4..0; 0x07 bits 7..051..=63unclaimed
0x08 bits 7..664..=65organ_modelSelector<2>
0x08 bits 5..066..=71unclaimed
0x09 bits 7..572..=74organ_b3_vibrato_modeSelector<3>
0x09 bit 475..=75organ_b3_harmonic_thirdbool
0x09 bit 376..=76organ_b3_decay_fastbool
0x09 bit 277..=77organ_b3_volume_softbool
0x09 bits 1..0; 0x0a bits 7..0; 0x0b bit 778..=88unclaimed
0x0b bits 6..589..=90organ_vox_vibrato_modeSelector<2>
0x0b bit 491..=91organ_vox_vibrato_onbool
0x0b bits 3..0; 0x0c bits 7..0; 0x0d bit 792..=104unclaimed
0x0d bits 6..5105..=106organ_farfisa_vibrato_modeSelector<2>
0x0d bit 4107..=107organ_farfisa_vibrato_onbool
0x0d bits 3..0; 0x0e bits 7..0108..=119unclaimed
0x0f bits 7..5120..=122piano_slot_detuneSelector<3>
0x0f bits 4..0; 0x10 bits 7..0123..=135unclaimed
0x11 bit 7136..=136reverb_onbool
0x11 bits 6..4137..=139reverb_typeReverbType
0x11 bits 3..0; 0x12 bits 7..5140..=146reverb_amountLevel
0x12 bit 4147..=147compressor_onbool
0x12 bits 3..0; 0x13 bits 7..5148..=154compressor_amountLevel
0x13 bit 4155..=155rotary_speaker_onbool
0x13 bits 3..2156..=157rotary_speaker_sourceSelector<2>
0x13 bits 1..0; 0x14 bits 7..3158..=164rotary_speaker_driveLevel
0x14 bit 2165..=165rotary_speaker_stop_modebool
0x14 bit 1166..=166rotary_speaker_speedRotorSpeed
0x14 bit 0167..=167rotary_speaker_speed_wheelMorphOf<1>
0x15 bit 7168..=168rotary_speaker_speed_aftertouchMorphOf<1>
0x15 bit 6169..=169rotary_speaker_speed_ctrl_pedalMorphOf<1>
0x15 bits 5..0; 0x16 bits 7..0170..=183unclaimed
0x17..0x110184..=2175slot_aSlot
0x110..0x2092176..=4167slot_bSlot

Fields§

§slot_selection: Selector<2>

Bits 16..=17 (byte 0x02, bits 7..6).

§dual_keyboard: bool

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

§split_low_note: SplitNote

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

§split_high_note: SplitNote

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

§split_three_zones: bool

Bits 28..=28 (byte 0x03, bit 3).

§split_two_zones: bool

Bits 29..=29 (byte 0x03, bit 2).

§organ_pitch_stick: bool

Bits 33..=33 (byte 0x04, bit 6).

§transpose_enabled: bool

Bits 34..=34 (byte 0x04, bit 5).

§transpose: StageTranspose

Bits 35..=38 (byte 0x04, bits 4..1).

§master_clock: MasterTempo

Bits 43..=50 (byte 0x05, bits 4..0; byte 0x06, bits 7..5).

§organ_model: Selector<2>

Bits 64..=65 (byte 0x08, bits 7..6).

§organ_b3_vibrato_mode: Selector<3>

Bits 72..=74 (byte 0x09, bits 7..5).

§organ_b3_harmonic_third: bool

Bits 75..=75 (byte 0x09, bit 4).

§organ_b3_decay_fast: bool

Bits 76..=76 (byte 0x09, bit 3).

§organ_b3_volume_soft: bool

Bits 77..=77 (byte 0x09, bit 2).

§organ_vox_vibrato_mode: Selector<2>

Bits 89..=90 (byte 0x0b, bits 6..5).

§organ_vox_vibrato_on: bool

Bits 91..=91 (byte 0x0b, bit 4).

§organ_farfisa_vibrato_mode: Selector<2>

Bits 105..=106 (byte 0x0d, bits 6..5).

§organ_farfisa_vibrato_on: bool

Bits 107..=107 (byte 0x0d, bit 4).

§piano_slot_detune: Selector<3>

Bits 120..=122 (byte 0x0f, bits 7..5).

§reverb_on: bool

Bits 136..=136 (byte 0x11, bit 7).

§reverb_type: ReverbType

Bits 137..=139 (byte 0x11, bits 6..4).

§reverb_amount: Level

Bits 140..=146 (byte 0x11, bits 3..0; byte 0x12, bits 7..5).

§compressor_on: bool

Bits 147..=147 (byte 0x12, bit 4).

§compressor_amount: Level

Bits 148..=154 (byte 0x12, bits 3..0; byte 0x13, bits 7..5).

§rotary_speaker_on: bool

Bits 155..=155 (byte 0x13, bit 4).

§rotary_speaker_source: Selector<2>

Bits 156..=157 (byte 0x13, bits 3..2).

§rotary_speaker_drive: Level

Bits 158..=164 (byte 0x13, bits 1..0; byte 0x14, bits 7..3).

§rotary_speaker_stop_mode: bool

Bits 165..=165 (byte 0x14, bit 2).

§rotary_speaker_speed: RotorSpeed

Bits 166..=166 (byte 0x14, bit 1).

§rotary_speaker_speed_wheel: MorphOf<1>

Bits 167..=167 (byte 0x14, bit 0).

§rotary_speaker_speed_aftertouch: MorphOf<1>

Bits 168..=168 (byte 0x15, bit 7).

§rotary_speaker_speed_ctrl_pedal: MorphOf<1>

Bits 169..=169 (byte 0x15, bit 6).

§slot_a: Slot

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

Bytes 0x17..0x110.

§slot_b: Slot

Slot B. Same type: the two are the same layout, and neither is a copy of the other — slot_selection says which sounds.

Bytes 0x110..0x209.

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.

Source§

impl Program

Source

pub fn split_enabled(&self) -> bool

Whether any split is active.

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; 521]

Source§

fn from(p: &Program) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<[u8; 521]> for Program

Source§

type Error = ParseError

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

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