Skip to main content

Rom

Struct Rom 

Source
pub struct Rom(/* private fields */);
Expand description

Processed synthesizer ROM data (control + PCM).

A ROM is either static (bundled at compile time) or owned (loaded at runtime). Both provide access to PCM samples through accessor methods.

Implementations§

Source§

impl Rom

Source

pub fn pcm(&self) -> &[i16]

Returns a reference to the PCM sample data.

Source

pub fn default_programs(&self) -> &[usize; 8]

Returns the default program index for each melodic part (8 entries).

Source

pub fn default_panpots(&self) -> &[i32; 9]

Returns the default pan position for each part (9 entries).

Source

pub fn reserve_settings(&self) -> &[u8; 9]

Returns the default partial reserve setting for each part (9 entries).

Source

pub fn fill_raw_timbres(&self, raw_timbres: &mut RawTimbreBank)

Fills raw timbre byte arrays from the control ROM.

Source§

impl Rom

Source

pub fn new(control_rom: &[u8], pcm_rom: &[u8]) -> Result<Rom, Error>

Creates a new Rom from ROM memory byte slices.

The input slices are read-only; PCM data is unscrambled into a heap-allocated buffer owned by the returned Rom.

Trait Implementations§

Source§

impl Debug for Rom

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Rom

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl Freeze for Rom

§

impl RefUnwindSafe for Rom

§

impl Send for Rom

§

impl Sync for Rom

§

impl Unpin for Rom

§

impl UnsafeUnpin for Rom

§

impl UnwindSafe for Rom

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 = Infallible

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

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

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.