AUDIO
Source snapshot · 11 November 2026

API reference / ravet_instrument::NegotiatedVoices

Struct NegotiatedVoices 

pub struct NegotiatedVoices<const N: usize> { /* private fields */ }
Expand description

Explicit opt-in receiver for one chosen lower or upper MPE zone. Starts polyphonic with a two-semitone bend range. RPN6 on the chosen master enables 1..15 members or disables with zero; other masters and values >15 are ignored. Accepted zone messages kill all slots/controllers (including release tails), set member/master ranges to 48/2, and report changed occupied slots so the DSP owner can stop them. Disabling returns to polyphonic 2/2. Repeated valid zone messages also reset.

In MPE mode RPN0 CC6 values 0..96 set the independent master range or shared member range, refreshing held/sustained snapshots. CC38 fractional ranges are ignored. Polyphonic RPN0, overlapping zones, MIDI-CI, synthesis/format export are outside this receiver. Polyphony accepts bank/program requests independently on all channels; an active zone accepts them only on its master. Zone configuration/reset clears program selectors/requests; bend-range changes and CC121 preserve them. Prepared apply/reset/finish neither allocate nor perform I/O.

Implementations§

§

impl<const N: usize> NegotiatedVoices<N>

pub fn new(side: ZoneSide) -> Result<Self, VoiceError>

pub fn mode(&self) -> VoiceMode

pub fn bend_ranges(&self) -> (f32, f32)

Current (member, master) ranges in semitones.

pub fn voices(&self) -> &[Voice; N]

pub fn last_program_request(&self, channel: u8) -> Option<MidiProgramRequest>

Last accepted request; not a committed sound. Reset/zone configuration clears all channels; invalid channels return None.

pub fn finish(&mut self, index: usize) -> Result<(), VoiceError>

pub fn reset(&mut self)

Clear notes, controllers and selectors; preserve the negotiated zone/ranges.

pub fn apply(&mut self, message: MidiMessage) -> NegotiatedChanges

Auto Trait Implementations§

§

impl<const N: usize> Freeze for NegotiatedVoices<N>

§

impl<const N: usize> RefUnwindSafe for NegotiatedVoices<N>

§

impl<const N: usize> Send for NegotiatedVoices<N>

§

impl<const N: usize> Sync for NegotiatedVoices<N>

§

impl<const N: usize> Unpin for NegotiatedVoices<N>

§

impl<const N: usize> UnsafeUnpin for NegotiatedVoices<N>

§

impl<const N: usize> UnwindSafe for NegotiatedVoices<N>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.