pub struct OrganPanel {Show 27 fields
pub b3_vib: B3Vib,
pub b3_perc_third: bool,
pub b3_perc_speed: B3PercSpeed,
pub b3_preset2_selected: bool,
pub b3_preset1_drawbars: Drawbars,
pub b3_preset1_vib: bool,
pub b3_preset1_perc: bool,
pub b3_bass_bar1: Drawbar,
pub b3_bass_bar2: Drawbar,
pub b3_preset2_drawbars: Drawbars,
pub b3_preset2_vib: bool,
pub b3_preset2_perc: bool,
pub vox_vib: VoxVib,
pub vox_preset2_selected: bool,
pub vox_preset1_drawbars: Drawbars,
pub vox_preset1_vib: bool,
pub vox_preset2_drawbars: Drawbars,
pub vox_preset2_vib: bool,
pub farfisa_vib: FarfisaVib,
pub farfisa_preset2_selected: bool,
pub farfisa_preset1_drawbars: Drawbars,
pub farfisa_preset1_vib: bool,
pub farfisa_preset2_drawbars: Drawbars,
pub farfisa_preset2_vib: bool,
pub pipe_preset2_selected: bool,
pub pipe_preset1_drawbars: Drawbars,
pub pipe_preset2_drawbars: Drawbars,
/* private fields */
}Expand description
The organ panel: drawbar and vib/perc registration for every model and both presets, stored in full so switching either is lossless.
Unclaimed bits, kept verbatim through a re-encode: 0..=23, 30..=40, 42..=55, 102..=111, 150..=167, 171..=184, 186..=199, 237..=247, 285..=295, 299..=312, 314..=327, 365..=375, 413..=440, 442..=455, 492..=503, 540..=551.
The body’s map, in offset order:
| bytes | bits | field | type |
|---|---|---|---|
0x00..0x03 | 0..=23 | — | unclaimed |
0x03 bits 7..5 | 24..=26 | b3_vib | B3Vib |
0x03 bit 4 | 27..=27 | b3_perc_third | bool |
0x03 bits 3..2 | 28..=29 | b3_perc_speed | B3PercSpeed |
0x03 bits 1..0; 0x04 bits 7..0; 0x05 bit 7 | 30..=40 | — | unclaimed |
0x05 bit 6 | 41..=41 | b3_preset2_selected | bool |
0x05 bits 5..0; 0x06 bits 7..0 | 42..=55 | — | unclaimed |
0x07 bits 7..0; 0x08 bits 7..0; 0x09 bits 7..0; 0x0a bits 7..0; 0x0b bits 7..4 | 56..=91 | b3_preset1_drawbars | Drawbars |
0x0b bit 3 | 92..=92 | b3_preset1_vib | bool |
0x0b bit 2 | 93..=93 | b3_preset1_perc | bool |
0x0b bits 1..0; 0x0c bits 7..6 | 94..=97 | b3_bass_bar1 | Drawbar |
0x0c bits 5..2 | 98..=101 | b3_bass_bar2 | Drawbar |
0x0c bits 1..0; 0x0d bits 7..0 | 102..=111 | — | unclaimed |
0x0e bits 7..0; 0x0f bits 7..0; 0x10 bits 7..0; 0x11 bits 7..0; 0x12 bits 7..4 | 112..=147 | b3_preset2_drawbars | Drawbars |
0x12 bit 3 | 148..=148 | b3_preset2_vib | bool |
0x12 bit 2 | 149..=149 | b3_preset2_perc | bool |
0x12 bits 1..0; 0x13 bits 7..0; 0x14 bits 7..0 | 150..=167 | — | unclaimed |
0x15 bits 7..5 | 168..=170 | vox_vib | VoxVib |
0x15 bits 4..0; 0x16 bits 7..0; 0x17 bit 7 | 171..=184 | — | unclaimed |
0x17 bit 6 | 185..=185 | vox_preset2_selected | bool |
0x17 bits 5..0; 0x18 bits 7..0 | 186..=199 | — | unclaimed |
0x19 bits 7..0; 0x1a bits 7..0; 0x1b bits 7..0; 0x1c bits 7..0; 0x1d bits 7..4 | 200..=235 | vox_preset1_drawbars | Drawbars |
0x1d bit 3 | 236..=236 | vox_preset1_vib | bool |
0x1d bits 2..0; 0x1e bits 7..0 | 237..=247 | — | unclaimed |
0x1f bits 7..0; 0x20 bits 7..0; 0x21 bits 7..0; 0x22 bits 7..0; 0x23 bits 7..4 | 248..=283 | vox_preset2_drawbars | Drawbars |
0x23 bit 3 | 284..=284 | vox_preset2_vib | bool |
0x23 bits 2..0; 0x24 bits 7..0 | 285..=295 | — | unclaimed |
0x25 bits 7..5 | 296..=298 | farfisa_vib | FarfisaVib |
0x25 bits 4..0; 0x26 bits 7..0; 0x27 bit 7 | 299..=312 | — | unclaimed |
0x27 bit 6 | 313..=313 | farfisa_preset2_selected | bool |
0x27 bits 5..0; 0x28 bits 7..0 | 314..=327 | — | unclaimed |
0x29 bits 7..0; 0x2a bits 7..0; 0x2b bits 7..0; 0x2c bits 7..0; 0x2d bits 7..4 | 328..=363 | farfisa_preset1_drawbars | Drawbars |
0x2d bit 3 | 364..=364 | farfisa_preset1_vib | bool |
0x2d bits 2..0; 0x2e bits 7..0 | 365..=375 | — | unclaimed |
0x2f bits 7..0; 0x30 bits 7..0; 0x31 bits 7..0; 0x32 bits 7..0; 0x33 bits 7..4 | 376..=411 | farfisa_preset2_drawbars | Drawbars |
0x33 bit 3 | 412..=412 | farfisa_preset2_vib | bool |
0x33 bits 2..0; 0x34 bits 7..0; 0x35 bits 7..0; 0x36 bits 7..0; 0x37 bit 7 | 413..=440 | — | unclaimed |
0x37 bit 6 | 441..=441 | pipe_preset2_selected | bool |
0x37 bits 5..0; 0x38 bits 7..0 | 442..=455 | — | unclaimed |
0x39 bits 7..0; 0x3a bits 7..0; 0x3b bits 7..0; 0x3c bits 7..0; 0x3d bits 7..4 | 456..=491 | pipe_preset1_drawbars | Drawbars |
0x3d bits 3..0; 0x3e bits 7..0 | 492..=503 | — | unclaimed |
0x3f bits 7..0; 0x40 bits 7..0; 0x41 bits 7..0; 0x42 bits 7..0; 0x43 bits 7..4 | 504..=539 | pipe_preset2_drawbars | Drawbars |
0x43 bits 3..0; 0x44 bits 7..0 | 540..=551 | — | unclaimed |
Fields§
§b3_vib: B3VibShared across presets.
Bits 24..=26 (byte 0x03, bits 7..5).
b3_perc_third: boolPercussion third harmonic, shared across presets.
Bits 27..=27 (byte 0x03, bit 4).
b3_perc_speed: B3PercSpeedShared across presets.
Bits 28..=29 (byte 0x03, bits 3..2).
b3_preset2_selected: boolBits 41..=41 (byte 0x05, bit 6).
b3_preset1_drawbars: DrawbarsBits 56..=91 (byte 0x07, bits 7..0; byte 0x08, bits 7..0; byte 0x09, bits 7..0; byte 0x0a, bits 7..0; byte 0x0b, bits 7..4).
b3_preset1_vib: boolBits 92..=92 (byte 0x0b, bit 3).
b3_preset1_perc: boolBits 93..=93 (byte 0x0b, bit 2).
b3_bass_bar1: DrawbarFirst bass drawbar of b3+bass preset 1 — see OrganPanel::b3_bass_drawbars.
It is not in the nine-nibble block, and the two nibbles it shadows there hold
stale leftovers.
Bits 94..=97 (byte 0x0b, bits 1..0; byte 0x0c, bits 7..6).
b3_bass_bar2: DrawbarSecond bass drawbar of b3+bass preset 1. The four bits after it are unused.
Bits 98..=101 (byte 0x0c, bits 5..2).
b3_preset2_drawbars: DrawbarsBits 112..=147 (byte 0x0e, bits 7..0; byte 0x0f, bits 7..0; byte 0x10, bits 7..0; byte 0x11, bits 7..0; byte 0x12, bits 7..4).
b3_preset2_vib: boolBits 148..=148 (byte 0x12, bit 3).
b3_preset2_perc: boolBits 149..=149 (byte 0x12, bit 2).
vox_vib: VoxVibShared across presets.
Bits 168..=170 (byte 0x15, bits 7..5).
vox_preset2_selected: boolBits 185..=185 (byte 0x17, bit 6).
vox_preset1_drawbars: DrawbarsBits 200..=235 (byte 0x19, bits 7..0; byte 0x1a, bits 7..0; byte 0x1b, bits 7..0; byte 0x1c, bits 7..0; byte 0x1d, bits 7..4).
vox_preset1_vib: boolBits 236..=236 (byte 0x1d, bit 3).
vox_preset2_drawbars: DrawbarsBits 248..=283 (byte 0x1f, bits 7..0; byte 0x20, bits 7..0; byte 0x21, bits 7..0; byte 0x22, bits 7..0; byte 0x23, bits 7..4).
vox_preset2_vib: boolBits 284..=284 (byte 0x23, bit 3).
farfisa_vib: FarfisaVibShared across presets.
Bits 296..=298 (byte 0x25, bits 7..5).
farfisa_preset2_selected: boolBits 313..=313 (byte 0x27, bit 6).
farfisa_preset1_drawbars: DrawbarsStored as positions, read by the instrument as tabs — see
OrganPanel::farfisa_tabs.
Bits 328..=363 (byte 0x29, bits 7..0; byte 0x2a, bits 7..0; byte 0x2b, bits 7..0; byte 0x2c, bits 7..0; byte 0x2d, bits 7..4).
farfisa_preset1_vib: boolBits 364..=364 (byte 0x2d, bit 3).
farfisa_preset2_drawbars: DrawbarsBits 376..=411 (byte 0x2f, bits 7..0; byte 0x30, bits 7..0; byte 0x31, bits 7..0; byte 0x32, bits 7..0; byte 0x33, bits 7..4).
farfisa_preset2_vib: boolBits 412..=412 (byte 0x33, bit 3).
pipe_preset2_selected: boolBits 441..=441 (byte 0x37, bit 6).
pipe_preset1_drawbars: DrawbarsBits 456..=491 (byte 0x39, bits 7..0; byte 0x3a, bits 7..0; byte 0x3b, bits 7..0; byte 0x3c, bits 7..0; byte 0x3d, bits 7..4).
pipe_preset2_drawbars: DrawbarsBits 504..=539 (byte 0x3f, bits 7..0; byte 0x40, bits 7..0; byte 0x41, bits 7..0; byte 0x42, bits 7..0; byte 0x43, bits 7..4).
Implementations§
Source§impl OrganPanel
impl OrganPanel
Sourcepub fn field_values(&self) -> Vec<FieldValue>
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.
pub fn field_specs() -> Vec<FieldSpec>
Source§impl OrganPanel
impl OrganPanel
Sourcepub fn preset(&self, model: OrganModel) -> Preset
pub fn preset(&self, model: OrganModel) -> Preset
The registration model is playing.
Sourcepub fn drawbars(&self, model: OrganModel, preset: Preset) -> [u8; 9]
pub fn drawbars(&self, model: OrganModel, preset: Preset) -> [u8; 9]
The nine drawbar positions (physical, 0..=8) stored for model’s preset. This
is the on-disk value; per-model display transforms (Farfisa on/off, Vox’s ignored
8th bar, B3-bass bass-bar remap) are not applied.
Sourcepub fn b3_bass_drawbars(&self) -> [u8; 2]
pub fn b3_bass_drawbars(&self) -> [u8; 2]
The two bass drawbars of B3-with-bass, preset 1 — the bass manual.
These are not in the nine-nibble block. In b3+bass mode preset 1 is the bass manual (only bars 1–2 are live) and preset 2 is the ordinary B3; the bass registration sits in its own four-bit pair after the block, which is why it does not move when the drawbars do.
⚠️ Do not read bars 1–2 from Self::drawbars in this mode — those two
nibbles hold stale leftovers, not zero and not the bass values.
Confirmed on hardware. The captures are 1100_400000000 and 1100_040000000.
Sourcepub fn farfisa_tabs(&self, preset: Preset) -> [bool; 9]
pub fn farfisa_tabs(&self, preset: Preset) -> [bool; 9]
Farfisa drawbars as the instrument actually treats them: on/off tabs, not continuous positions.
A stored nibble of ≥5 reads as on, anything lower as off. Use this rather
than Self::drawbars for Farfisa — the raw 0..=8 value is stored faithfully
but has no meaning beyond which side of the threshold it falls.
Sourcepub fn vib_on(&self, model: OrganModel, preset: Preset) -> bool
pub fn vib_on(&self, model: OrganModel, preset: Preset) -> bool
Whether vibrato/chorus is on for model’s preset. Pipe has none.
Sourcepub fn vib_type(&self, model: OrganModel) -> Option<VibChorus>
pub fn vib_type(&self, model: OrganModel) -> Option<VibChorus>
The vibrato/chorus mode selected for model (shared across presets), or None
for Pipe and for an index the model does not use. Each model offers a different
subset of the six modes at a different index, so the stored value is only
meaningful alongside the model.
Sourcepub fn b3_perc_on(&self, preset: Preset) -> bool
pub fn b3_perc_on(&self, preset: Preset) -> bool
Whether B3 percussion is on for preset (B3 only).
Sourcepub fn b3_perc_third(&self) -> bool
pub fn b3_perc_third(&self) -> bool
Whether B3 percussion uses the third harmonic (shared across presets).
Sourcepub fn b3_perc_speed(&self) -> PercSpeed
pub fn b3_perc_speed(&self) -> PercSpeed
B3 percussion decay speed (shared across presets). The on-disk encoding is not monotonic — soft, fast and both store 2, 1 and 3.
Sourcepub fn set_preset(&mut self, model: OrganModel, preset: Preset)
pub fn set_preset(&mut self, model: OrganModel, preset: Preset)
Play preset on model.
Sourcepub fn set_drawbars(
&mut self,
model: OrganModel,
preset: Preset,
bars: [u8; 9],
) -> Result<(), ParseError>
pub fn set_drawbars( &mut self, model: OrganModel, preset: Preset, bars: [u8; 9], ) -> Result<(), ParseError>
Store nine drawbar positions, 0..=8. A higher one is refused rather than
truncated, since two bars share a byte.
Sourcepub fn set_farfisa_tabs(&mut self, preset: Preset, tabs: [bool; 9])
pub fn set_farfisa_tabs(&mut self, preset: Preset, tabs: [bool; 9])
Set the Farfisa tabs: on stores 8, off stores 0. Any other stored value is
lost — the instrument only reads which side of the ≥5 threshold it falls on, but
the byte does change, so this will not round-trip a program you only meant to
read.
Sourcepub fn set_vib_on(&mut self, model: OrganModel, preset: Preset, on: bool)
pub fn set_vib_on(&mut self, model: OrganModel, preset: Preset, on: bool)
Turn vibrato/chorus on or off for model’s preset. No-op for Pipe, which has
none.
Sourcepub fn set_vib_type(
&mut self,
model: OrganModel,
vib: VibChorus,
) -> Result<(), ParseError>
pub fn set_vib_type( &mut self, model: OrganModel, vib: VibChorus, ) -> Result<(), ParseError>
Select the vibrato/chorus mode for model, shared across presets. Fails for a
mode the model does not offer; Pipe has none.
Sourcepub fn set_b3_perc_on(&mut self, preset: Preset, on: bool)
pub fn set_b3_perc_on(&mut self, preset: Preset, on: bool)
Turn B3 percussion on or off for preset.
Sourcepub fn set_b3_perc_third(&mut self, on: bool)
pub fn set_b3_perc_third(&mut self, on: bool)
Percussion third harmonic (shared across presets).
Sourcepub fn set_b3_perc_speed(&mut self, speed: PercSpeed)
pub fn set_b3_perc_speed(&mut self, speed: PercSpeed)
Percussion decay speed (shared across presets). Note the encoding is not
monotonic — see Self::b3_perc_speed.
Sourcepub fn set_b3_bass_drawbars(&mut self, bars: [u8; 2]) -> Result<(), ParseError>
pub fn set_b3_bass_drawbars(&mut self, bars: [u8; 2]) -> Result<(), ParseError>
Set the two bass drawbars of b3+bass preset 1, 0..=8.
Trait Implementations§
Source§impl Body for OrganPanel
impl Body for OrganPanel
Source§fn read<R: Read + Seek>(
r: &mut BodyReader<'_, R>,
_: &Header,
) -> Result<Self, Error>
fn read<R: Read + Seek>( r: &mut BodyReader<'_, R>, _: &Header, ) -> Result<Self, Error>
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§impl BodyLayout for OrganPanel
impl BodyLayout for OrganPanel
Source§fn layout() -> &'static [LayoutField]
fn layout() -> &'static [LayoutField]
Source§impl Debug for OrganPanel
The decoded values; the backing bytes are not printed.
impl Debug for OrganPanel
The decoded values; the backing bytes are not printed.
Source§impl Default for OrganPanel
[u8; 69] has no Default — the std impls stop at 32 — so this one goes through the
decode, which every organ field is total over.
impl Default for OrganPanel
[u8; 69] has no Default — the std impls stop at 32 — so this one goes through the
decode, which every organ field is total over.