Releases: RealBitdancer/opal-rust
Releases · RealBitdancer/opal-rust
Release list
opal-rust v2.0.2-2
Added
- First public release of the Rust binding. Binds opal 2.0.2.
- The
opalcrate compiles vendored C11 sources fromvendor/opal/. There is no
bindgen step. SetOPAL_SRCto compile a local checkout instead. The crate sets
links = "opal"and isno_stdplusalloc. Opal,Channel,Operator, andWriteBufare hand-mirrored as#[repr(C)]
with snake_case field names. Tests check every size and field offset against the
C compiler.- Methods for the eight C functions:
new,set_sample_rate,write_reg,
write_reg_buffered,flush_write_buf,pan,sample, andread_status.
boxedheap-allocates the ~70 KiB state.write_regsandwrite_regs_buffered
take iterator batches.renderandrender_stereofill interleaved or typed
stereo buffers. EnvelopeStageandChannelTypetransparent newtypes (Display,From<c_int>).
Index sentinelsOP_NONE,MOD_OWN_FB, andCH_NONE. Status bit constants.
modulator_slotandcarrier_slotmatch the upstream header table.VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH, and packedVERSION
(major * 10000 + minor * 100 + patch), matchingOPAL_VERSION_*inopal.h.- Public sample-rate arguments are
u32hertz. A rate of0becomes the native
OPL3 rate. Values that do not fit in a Cintare clamped. - Edition 2024. MSRV is current stable (1.97).
- NEW (register 105h bit 0) is a live mode bit. Bank 1, waveforms 4-7, CHA and
CHB, and four-operator pairing apply only while it is set. pair_indexis the physical partner, orCH_NONEif the channel cannot pair.
chan_typesays whether 4-op is active.- After
Opal::new, every operator'seg_outis 0x1FF. - A masked timer overflow sets FT1 or FT2. IRQ (bit 7) is set only when that
timer is unmasked. - Demo:
cargo run --example demowrites a short FM arpeggio toopal-demo.wav. - Tests cover silence after init, pair-index wiring, NEW as a live mode bit, tone
generation, save-state clones, buffered write equivalence, resampler full-scale
step regression, pan, stereo render parity, timer flags, and sample-rate
round-trip (0and overflow clamp).