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&hivellokey&hikeypitch_keycentervolumepansampledefault_pathloop_modeloop_startloop_endoffsetcutoffresonancefil_veltrackfil_keycenterfil_keytrackfilter_typetuneampeg_startampeg_delayampeg_attackampeg_holdampeg_decayampeg_sustainampeg_release
§SF2 specification support
§Generators
startAddrsOffsetstartloopAddrsOffsetendloopAddrsOffsetinitialFilterFcinitialFilterQpandelayVolEnvattackVolEnvholdVolEnvdecayVolEnvsustainVolEnvreleaseVolEnvinstrumentkeyRangevelRangeinitialAttenuationcoarseTunefineTunesampleIDsampleModesoverridingRootKey
§Modulators
None
Implementations§
source§impl SampleSoundfont
impl SampleSoundfont
sourcepub fn new(
path: impl Into<PathBuf>,
stream_params: AudioStreamParams,
options: SoundfontInitOptions,
) -> Result<Self, LoadSfError>
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 theAudioStreamParamsdocumentation for the available options.options: The soundfont configuration. See theSoundfontInitOptionsdocumentation for the available options.
sourcepub fn new_sfz(
sfz_path: impl Into<PathBuf>,
stream_params: AudioStreamParams,
options: SoundfontInitOptions,
) -> Result<Self, LoadSfzError>
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 theAudioStreamParamsdocumentation for the available options.options: The soundfont configuration. See theSoundfontInitOptionsdocumentation for the available options.
sourcepub fn new_sf2(
sf2_path: impl Into<PathBuf>,
stream_params: AudioStreamParams,
options: SoundfontInitOptions,
) -> Result<Self, Sf2ParseError>
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 theAudioStreamParamsdocumentation for the available options.options: The soundfont configuration. See theSoundfontInitOptionsdocumentation for the available options.
Trait Implementations§
source§impl Debug for SampleSoundfont
impl Debug for SampleSoundfont
source§impl SoundfontBase for SampleSoundfont
impl SoundfontBase for SampleSoundfont
fn stream_params(&self) -> &AudioStreamParams
fn get_attack_voice_spawners_at( &self, bank: u8, preset: u8, key: u8, vel: u8, ) -> Vec<Box<dyn VoiceSpawner>>
fn get_release_voice_spawners_at( &self, _bank: u8, _preset: u8, _key: u8, _vel: u8, ) -> Vec<Box<dyn VoiceSpawner>>
Auto Trait Implementations§
impl Freeze for SampleSoundfont
impl RefUnwindSafe for SampleSoundfont
impl Send for SampleSoundfont
impl Sync for SampleSoundfont
impl Unpin for SampleSoundfont
impl UnwindSafe for SampleSoundfont
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more