Struct xsynth_core::soundfont::SampleSoundfont

source ·
pub struct SampleSoundfont { /* private fields */ }
Expand description

Represents a sample soundfont to be used within XSynth.

Supports SFZ and SF2 soundfonts.

§SFZ specification support (opcodes)

  • lovel & hivel
  • lokey & hikey
  • pitch_keycenter
  • volume
  • pan
  • sample
  • default_path
  • loop_mode
  • loop_start
  • loop_end
  • offset
  • cutoff
  • resonance
  • fil_veltrack
  • fil_keycenter
  • fil_keytrack
  • filter_type
  • tune
  • ampeg_start
  • ampeg_delay
  • ampeg_attack
  • ampeg_hold
  • ampeg_decay
  • ampeg_sustain
  • ampeg_release

§SF2 specification support

§Generators

  • startAddrsOffset
  • startloopAddrsOffset
  • endloopAddrsOffset
  • initialFilterFc
  • initialFilterQ
  • pan
  • delayVolEnv
  • attackVolEnv
  • holdVolEnv
  • decayVolEnv
  • sustainVolEnv
  • releaseVolEnv
  • instrument
  • keyRange
  • velRange
  • initialAttenuation
  • coarseTune
  • fineTune
  • sampleID
  • sampleModes
  • overridingRootKey

§Modulators

None

Implementations§

source§

impl SampleSoundfont

source

pub fn new( path: impl Into<PathBuf>, stream_params: AudioStreamParams, options: SoundfontInitOptions, ) -> Result<Self, LoadSfError>

Loads a new sample soundfont of an unspecified type. The type of the soundfont will be determined from the file extension.

Parameters:

  • path: The path of the soundfont to be loaded.
  • stream_params: Parameters of the output audio. See the AudioStreamParams documentation for the available options.
  • options: The soundfont configuration. See the SoundfontInitOptions documentation for the available options.
source

pub fn new_sfz( sfz_path: impl Into<PathBuf>, stream_params: AudioStreamParams, options: SoundfontInitOptions, ) -> Result<Self, LoadSfzError>

Loads a new SFZ soundfont

Parameters:

  • path: The path of the SFZ soundfont to be loaded.
  • stream_params: Parameters of the output audio. See the AudioStreamParams documentation for the available options.
  • options: The soundfont configuration. See the SoundfontInitOptions documentation for the available options.
source

pub fn new_sf2( sf2_path: impl Into<PathBuf>, stream_params: AudioStreamParams, options: SoundfontInitOptions, ) -> Result<Self, Sf2ParseError>

Loads a new SF2 soundfont

Parameters:

  • path: The path of the SF2 soundfont to be loaded.
  • stream_params: Parameters of the output audio. See the AudioStreamParams documentation for the available options.
  • options: The soundfont configuration. See the SoundfontInitOptions documentation for the available options.

Trait Implementations§

source§

impl Debug for SampleSoundfont

source§

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

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

impl SoundfontBase for SampleSoundfont

source§

fn stream_params(&self) -> &AudioStreamParams

source§

fn get_attack_voice_spawners_at( &self, bank: u8, preset: u8, key: u8, vel: u8, ) -> Vec<Box<dyn VoiceSpawner>>

source§

fn get_release_voice_spawners_at( &self, _bank: u8, _preset: u8, _key: u8, _vel: u8, ) -> Vec<Box<dyn VoiceSpawner>>

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<F, T> IntoSample<T> for F
where T: FromSample<F>,

source§

fn into_sample(self) -> T

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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>,

§

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.