### Synthesizer::note_on Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Synthesizer.html?search= Starts a note on the specified channel. ```APIDOC ## pub fn note_on(&mut self, channel: i32, key: i32, velocity: i32) ### Description Starts a note with the given key and velocity. ### Parameters - **channel** (i32) - Required - The channel of the note. - **key** (i32) - Required - The key of the note. - **velocity** (i32) - Required - The velocity of the note. ``` -------------------------------- ### MidiFileSequencer::play Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html?search= Starts playback of the specified MIDI file. ```APIDOC ### pub fn play(&mut self, midi_file: &Arc, play_loop: bool) Plays the MIDI file. #### Arguments - **midi_file** (&Arc) - The MIDI file to be played. - **play_loop** (bool) - If true, the MIDI file loops after reaching the end. ``` -------------------------------- ### get_speed Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html Gets the current playback speed. ```APIDOC ## pub fn get_speed(&self) -> f64 ### Description Gets the current playback speed. ### Remarks The default value is 1. The tempo will be multiplied by this value during playback. ``` -------------------------------- ### get_synthesizer Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html Gets the synthesizer handled by the sequencer. ```APIDOC ## pub fn get_synthesizer(&self) -> &Synthesizer ### Description Gets the synthesizer handled by the sequencer. ``` -------------------------------- ### get_midi_file Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html Gets the currently playing MIDI file. ```APIDOC ## pub fn get_midi_file(&self) -> Option<&MidiFile> ### Description Gets the currently playing MIDI file. ``` -------------------------------- ### get_position Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html Gets the current playback position in seconds. ```APIDOC ## pub fn get_position(&self) -> f64 ### Description Gets the current playback position in seconds. ``` -------------------------------- ### end_of_sequence Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html Gets a value that indicates whether the current playback position is at the end of the sequence. ```APIDOC ## pub fn end_of_sequence(&self) -> bool ### Description Gets a value that indicates whether the current playback position is at the end of the sequence. ### Remarks If the play method has not yet been called, this value will be true. This value will never be true if loop playback is enabled. ``` -------------------------------- ### new Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html Initializes a new instance of the sequencer. ```APIDOC ## pub fn new(synthesizer: Synthesizer) -> Self ### Description Initializes a new instance of the sequencer. ### Arguments - **synthesizer** (Synthesizer) - The synthesizer to be handled by the sequencer. ``` -------------------------------- ### SynthesizerSettings::new Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SynthesizerSettings.html?search=std%3A%3Avec Initializes a new instance of synthesizer settings with a specified sample rate. ```APIDOC ## pub fn new(sample_rate: i32) -> Self ### Description Initializes a new instance of synthesizer settings. ### Arguments - **sample_rate** (i32) - The sample rate for synthesis. ``` -------------------------------- ### Synthesizer::new Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Synthesizer.html Initializes a new synthesizer instance using a specified SoundFont and configuration settings. ```APIDOC ## pub fn new(sound_font: &Arc, settings: &SynthesizerSettings) -> Result ### Description Initializes a new synthesizer using a specified SoundFont and settings. ### Parameters - **sound_font** (&Arc) - Required - The SoundFont instance. - **settings** (&SynthesizerSettings) - Required - The settings for synthesis. ``` -------------------------------- ### SynthesizerSettings Constructor Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SynthesizerSettings.html?search=std%3A%3Avec Initializes a new instance of the synthesizer settings with a specified sample rate. ```rust pub fn new(sample_rate: i32) -> Self ``` -------------------------------- ### MidiFileSequencer::new Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html?search= Initializes a new instance of the sequencer with a given synthesizer. ```APIDOC ### pub fn new(synthesizer: Synthesizer) -> Self Initializes a new instance of the sequencer. #### Arguments - **synthesizer** (Synthesizer) - The synthesizer to be handled by the sequencer. ``` -------------------------------- ### MidiFile::new Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFile.html Loads a MIDI file from a provided data stream. ```APIDOC ## pub fn new(reader: &mut R) -> Result ### Description Loads a MIDI file from the provided data stream. ### Parameters - **reader** (R: Read) - Required - The data stream used to load the MIDI file. ``` -------------------------------- ### SoundFont::new Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SoundFont.html Loads a SoundFont from a given data stream. ```APIDOC ## pub fn new(reader: &mut R) -> Result ### Description Loads a SoundFont from the provided data stream. ### Parameters - **reader** (R: Read) - Required - The data stream used to load the SoundFont. ``` -------------------------------- ### Preset::get_library Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Preset.html?search=u32+-%3E+bool Retrieves the library information for the preset. ```APIDOC ### pub fn get_library(&self) -> i32 Returns the library info for the preset. ``` -------------------------------- ### SampleHeader Methods Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SampleHeader.html Methods available on the SampleHeader struct to retrieve sample properties. ```APIDOC ## pub fn get_name(&self) -> &str Gets the name of the sample. ## pub fn get_start(&self) -> i32 Gets the start point of the sample in the sample data. ## pub fn get_end(&self) -> i32 Gets the end point of the sample in the sample data. ## pub fn get_start_loop(&self) -> i32 Gets the loop start point of the sample in the sample data. ## pub fn get_end_loop(&self) -> i32 Gets the loop end point of the sample in the sample data. ## pub fn get_sample_rate(&self) -> i32 Gets the sample rate of the sample. ## pub fn get_original_pitch(&self) -> i32 Gets the key number of the recorded pitch of the sample. ## pub fn get_pitch_correction(&self) -> i32 Gets the pitch correction in cents that should be applied to the sample on playback. ## pub fn get_link(&self) -> i32 Gets the link info. ## pub fn get_sample_type(&self) -> i32 Gets the sample type. ``` -------------------------------- ### play Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html Plays the MIDI file. ```APIDOC ## pub fn play(&mut self, midi_file: &Arc, play_loop: bool) ### Description Plays the MIDI file. ### Arguments - **midi_file** (&Arc) - The MIDI file to be played. - **play_loop** (bool) - If true, the MIDI file loops after reaching the end. ``` -------------------------------- ### Preset Methods Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Preset.html Methods available on the Preset struct to retrieve preset information. ```APIDOC ## pub fn get_name(&self) -> &str Gets the name of the preset. ## pub fn get_patch_number(&self) -> i32 Gets the patch number of the preset. ## pub fn get_bank_number(&self) -> i32 Gets the bank number of the preset. ## pub fn get_library(&self) -> i32 Gets the library info. ## pub fn get_genre(&self) -> i32 Gets the genre info. ## pub fn get_morphology(&self) -> i32 Gets the morphology info. ## pub fn get_regions(&self) -> &[PresetRegion] Gets the regions of the preset. ``` -------------------------------- ### pub fn get_minor(&self) -> i32 Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SoundFontVersion.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the minor version number of the SoundFont. ```APIDOC ## pub fn get_minor(&self) -> i32 ### Description Gets the minor version of the SoundFont. ### Returns - **i32** - The minor version number. ``` -------------------------------- ### SampleHeader Methods Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SampleHeader.html?search=u32+-%3E+bool Methods available on the SampleHeader struct to retrieve sample metadata. ```APIDOC ## SampleHeader Methods ### get_name Returns the name of the sample as a string slice. ### get_start Returns the start point of the sample in the sample data (i32). ### get_end Returns the end point of the sample in the sample data (i32). ### get_start_loop Returns the loop start point of the sample in the sample data (i32). ### get_end_loop Returns the loop end point of the sample in the sample data (i32). ### get_sample_rate Returns the sample rate of the sample (i32). ### get_original_pitch Returns the key number of the recorded pitch of the sample (i32). ### get_pitch_correction Returns the pitch correction in cents to be applied on playback (i32). ### get_link Returns the link info (i32). ### get_sample_type Returns the sample type (i32). ``` -------------------------------- ### render Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html Renders the waveform. ```APIDOC ## pub fn render(&mut self, left: &mut [f32], right: &mut [f32]) ### Description Renders the waveform. ### Arguments - **left** (&mut [f32]) - The buffer of the left channel to store the rendered waveform. - **right** (&mut [f32]) - The buffer of the right channel to store the rendered waveform. ### Remarks The output buffers for the left and right must be the same length. ``` -------------------------------- ### MidiFile::new_with_loop_type Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFile.html Loads a MIDI file from a stream with a specified loop type configuration. ```APIDOC ## pub fn new_with_loop_type(reader: &mut R, loop_type: MidiFileLoopType) -> Result ### Description Loads a MIDI file from the stream with a specified loop type extension. ### Parameters - **reader** (R: Read) - Required - The data stream used to load the MIDI file. - **loop_type** (MidiFileLoopType) - Required - The type of the loop extension to be used (e.g., LoopPoint, RpgMaker, IncredibleMachine, FinalFantasy). ``` -------------------------------- ### SoundFontInfo Methods Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SoundFontInfo.html Methods available on the SoundFontInfo struct to retrieve metadata. ```APIDOC ## SoundFontInfo Methods ### get_version Returns the version of the SoundFont as a `SoundFontVersion`. ### get_target_sound_engine Returns the target sound engine of the SoundFont as a `&str`. ### get_bank_name Returns the bank name of the SoundFont as a `&str`. ### get_rom_name Returns the ROM name of the SoundFont as a `&str`. ### get_rom_version Returns the ROM version of the SoundFont as a `SoundFontVersion`. ### get_creation_date Returns the creation date of the SoundFont as a `&str`. ### get_author Returns the author of the SoundFont as a `&str`. ### get_target_product Returns the target product of the SoundFont as a `&str`. ### get_copyright Returns the copyright message for the SoundFont as a `&str`. ### get_comments Returns the comments for the SoundFont as a `&str`. ### get_tools Returns the tools used to create the SoundFont as a `&str`. ``` -------------------------------- ### pub fn get_major(&self) -> i32 Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SoundFontVersion.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the major version number of the SoundFont. ```APIDOC ## pub fn get_major(&self) -> i32 ### Description Gets the major version of the SoundFont. ### Returns - **i32** - The major version number. ``` -------------------------------- ### MidiFileSequencer Methods Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html?search=u32+-%3E+bool Methods available for interacting with the MidiFileSequencer instance. ```APIDOC ## pub fn new(synthesizer: Synthesizer) -> Self Initializes a new instance of the sequencer. ### Arguments - **synthesizer** (Synthesizer) - The synthesizer to be handled by the sequencer. ## pub fn play(&mut self, midi_file: &Arc, play_loop: bool) Plays the MIDI file. ### Arguments - **midi_file** (&Arc) - The MIDI file to be played. - **play_loop** (bool) - If true, the MIDI file loops after reaching the end. ## pub fn stop(&mut self) Stops playing. ## pub fn render(&mut self, left: &mut [f32], right: &mut [f32]) Renders the waveform. ### Arguments - **left** (&mut [f32]) - The buffer of the left channel to store the rendered waveform. - **right** (&mut [f32]) - The buffer of the right channel to store the rendered waveform. ### Remarks The output buffers for the left and right must be the same length. ## pub fn get_synthesizer(&self) -> &Synthesizer Gets the synthesizer handled by the sequencer. ## pub fn get_midi_file(&self) -> Option<&MidiFile> Gets the currently playing MIDI file. ## pub fn get_position(&self) -> f64 Gets the current playback position in seconds. ## pub fn end_of_sequence(&self) -> bool Gets a value that indicates whether the current playback position is at the end of the sequence. ### Remarks If the play method has not yet been called, this value will be true. This value will never be true if loop playback is enabled. ## pub fn get_speed(&self) -> f64 Gets the current playback speed. ### Remarks The default value is 1. The tempo will be multiplied by this value during playback. ## pub fn set_speed(&mut self, value: f64) Sets the playback speed. ### Remarks The value must be non-negative. ``` -------------------------------- ### pub fn get_name(&self) -> &str Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Instrument.html?search=u32+-%3E+bool Retrieves the name of the instrument as a string slice. ```APIDOC ## pub fn get_name(&self) -> &str ### Description Gets the name of the instrument. ### Returns - **&str** - The name of the instrument. ``` -------------------------------- ### Define SampleHeader struct Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SampleHeader.html The structure definition for SampleHeader, marked as non-exhaustive. ```rust #[non_exhaustive] pub struct SampleHeader { /* private fields */ } ``` -------------------------------- ### Preset::get_name Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Preset.html?search=u32+-%3E+bool Retrieves the name of the preset. ```APIDOC ### pub fn get_name(&self) -> &str Returns the name of the preset as a string slice. ``` -------------------------------- ### set_speed Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html Sets the playback speed. ```APIDOC ## pub fn set_speed(&mut self, value: f64) ### Description Sets the playback speed. ### Arguments - **value** (f64) - The speed value. ### Remarks The value must be non-negative. ``` -------------------------------- ### set_speed(&mut self, value: f64) Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Sets the playback speed of the sequencer. ```APIDOC ### pub fn set_speed(&mut self, value: f64) Sets the playback speed. #### Remarks The value must be non-negative. ``` -------------------------------- ### Preset::get_genre Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Preset.html?search=u32+-%3E+bool Retrieves the genre information for the preset. ```APIDOC ### pub fn get_genre(&self) -> i32 Returns the genre info for the preset. ``` -------------------------------- ### MidiFileSequencer::render Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html?search= Renders the audio waveform into the provided buffers. ```APIDOC ### pub fn render(&mut self, left: &mut [f32], right: &mut [f32]) Renders the waveform. #### Arguments - **left** (&mut [f32]) - The buffer of the left channel to store the rendered waveform. - **right** (&mut [f32]) - The buffer of the right channel to store the rendered waveform. #### Remarks The output buffers for the left and right must be the same length. ``` -------------------------------- ### get_name Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Instrument.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the name of the instrument. ```APIDOC ## pub fn get_name(&self) -> &str ### Description Returns the name of the instrument as a string slice. ### Returns - **&str** - The name of the instrument. ``` -------------------------------- ### Preset::get_morphology Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Preset.html?search=u32+-%3E+bool Retrieves the morphology information for the preset. ```APIDOC ### pub fn get_morphology(&self) -> i32 Returns the morphology info for the preset. ``` -------------------------------- ### MidiFile::get_length Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFile.html Retrieves the total duration of the MIDI file in seconds. ```APIDOC ## pub fn get_length(&self) -> f64 ### Description Get the length of the MIDI file in seconds. ``` -------------------------------- ### Synthesizer::render Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Synthesizer.html Renders the synthesized audio waveform into the provided buffers. ```APIDOC ## pub fn render(&mut self, left: &mut [f32], right: &mut [f32]) ### Description Renders the waveform. The output buffers for the left and right must be the same length. ### Parameters - **left** (&mut [f32]) - Required - The buffer of the left channel to store the rendered waveform. - **right** (&mut [f32]) - Required - The buffer of the right channel to store the rendered waveform. ``` -------------------------------- ### SynthesizerSettings Struct Definition Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SynthesizerSettings.html?search=std%3A%3Avec The definition of the SynthesizerSettings struct, which is marked as non-exhaustive. ```rust #[non_exhaustive] pub struct SynthesizerSettings { pub sample_rate: i32, pub block_size: usize, pub maximum_polyphony: usize, pub enable_reverb_and_chorus: bool, } ``` -------------------------------- ### Preset Struct Definition Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Preset.html The definition of the Preset struct, which is marked as non-exhaustive. ```rust #[non_exhaustive] pub struct Preset { /* private fields */ } ``` -------------------------------- ### stop Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html Stops playing. ```APIDOC ## pub fn stop(&mut self) ### Description Stops playing. ``` -------------------------------- ### SoundFontVersion Struct Definition Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SoundFontVersion.html?search= The definition of the SoundFontVersion struct, which contains private fields and is marked as non-exhaustive. ```rust #[non_exhaustive] pub struct SoundFontVersion { /* private fields */ } ``` -------------------------------- ### SoundFont Data Accessors Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SoundFont.html Methods to retrieve metadata and internal components of the SoundFont. ```APIDOC ## SoundFont Accessor Methods ### get_info Returns the information of the SoundFont as a `SoundFontInfo` object. ### get_bits_per_sample Returns the bits per sample of the sample data as an `i32`. ### get_wave_data Returns the raw sample data as a slice of `i16`. ### get_sample_headers Returns the samples of the SoundFont as a slice of `SampleHeader`. ### get_presets Returns the presets of the SoundFont as a slice of `Preset`. ### get_instruments Returns the instruments of the SoundFont as a slice of `Instrument`. ``` -------------------------------- ### MidiFileSequencer::set_speed Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html?search= Sets the playback speed of the sequencer. ```APIDOC ### pub fn set_speed(&mut self, value: f64) Sets the playback speed. #### Arguments - **value** (f64) - The speed multiplier. Must be non-negative. ``` -------------------------------- ### MidiFileSequencer Definition Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFileSequencer.html?search= The internal structure definition for the MIDI file sequencer. ```rust #[non_exhaustive] pub struct MidiFileSequencer { /* private fields */ } ``` -------------------------------- ### Preset::get_regions Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Preset.html?search=u32+-%3E+bool Retrieves the regions associated with the preset. ```APIDOC ### pub fn get_regions(&self) -> &[PresetRegion] Returns a slice of PresetRegion objects belonging to this preset. ``` -------------------------------- ### Preset::get_bank_number Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Preset.html?search=u32+-%3E+bool Retrieves the bank number of the preset. ```APIDOC ### pub fn get_bank_number(&self) -> i32 Returns the bank number associated with the preset. ``` -------------------------------- ### Synthesizer::process_midi_message Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Synthesizer.html Processes a raw MIDI message to control the synthesizer state. ```APIDOC ## pub fn process_midi_message(&mut self, channel: i32, command: i32, data1: i32, data2: i32) ### Description Processes a MIDI message. ### Parameters - **channel** (i32) - Required - The channel to which the message will be sent. - **command** (i32) - Required - The type of the message. - **data1** (i32) - Required - The first data part of the message. - **data2** (i32) - Required - The second data part of the message. ``` -------------------------------- ### Define PresetRegion Struct Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.PresetRegion.html?search=std%3A%3Avec The structure definition for PresetRegion, which contains private fields. ```rust #[non_exhaustive] pub struct PresetRegion { /* private fields */ } ``` -------------------------------- ### contains Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.InstrumentRegion.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Checks if the region covers the given key and velocity. ```APIDOC ## pub fn contains(&self, key: i32, velocity: i32) -> bool ### Description Checks if the region covers the given key and velocity. Returns true if the region covers the given key and velocity. ### Parameters - **key** (i32) - The key of a note. - **velocity** (i32) - The velocity of a note. ### Returns - **bool** - True if the region covers the specified key and velocity. ``` -------------------------------- ### MidiFile struct definition Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.MidiFile.html The internal structure of the MidiFile type. ```rust #[non_exhaustive] pub struct MidiFile { /* private fields */ } ``` -------------------------------- ### Define SoundFont struct Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.SoundFont.html?search= The definition of the SoundFont struct, which contains private fields and is marked as non-exhaustive. ```rust #[non_exhaustive] pub struct SoundFont { /* private fields */ } ``` -------------------------------- ### Synthesizer Struct Definition Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Synthesizer.html The primary structure for the SoundFont synthesizer. ```rust #[non_exhaustive] pub struct Synthesizer { /* private fields */ } ``` -------------------------------- ### Preset::get_patch_number Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Preset.html?search=u32+-%3E+bool Retrieves the patch number of the preset. ```APIDOC ### pub fn get_patch_number(&self) -> i32 Returns the patch number associated with the preset. ``` -------------------------------- ### SoundFontError Enum Definition Source: https://docs.rs/rustysynth/1.3.6/rustysynth/enum.SoundFontError.html The definition of the SoundFontError enum, containing variants for various I/O and parsing errors. ```rust #[non_exhaustive] pub enum SoundFontError { Show 22 variants IoError(Error), RiffChunkNotFound, InvalidRiffChunkType { expected: FourCC, actual: FourCC, }, ListChunkNotFound, InvalidListChunkType { expected: FourCC, actual: FourCC, }, ListContainsUnknownId(FourCC), SampleDataNotFound, UnsupportedSampleFormat, SubChunkNotFound(FourCC), InvalidPresetList, InvalidInstrumentId { preset_id: usize, instrument_id: usize, }, InvalidPreset(usize), PresetNotFound, InvalidInstrumentList, InvalidSampleId { instrument_id: usize, sample_id: usize, }, InvalidInstrument(usize), InstrumentNotFound, InvalidSampleHeaderList, InvalidZoneList, ZoneNotFound, InvalidGeneratorList, SanityCheckFailed, } ``` -------------------------------- ### get_regions Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Instrument.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E Retrieves the regions associated with the instrument. ```APIDOC ## pub fn get_regions(&self) -> &[InstrumentRegion] ### Description Returns a slice containing the regions that make up the instrument. ### Returns - **&[InstrumentRegion]** - A slice of InstrumentRegion objects. ``` -------------------------------- ### Synthesizer::set_master_volume Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Synthesizer.html Updates the master volume level of the synthesizer. ```APIDOC ## pub fn set_master_volume(&mut self, value: f32) ### Description Sets the master volume. ### Parameters - **value** (f32) - Required - The new value of the master volume. ``` -------------------------------- ### Instrument struct definition Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Instrument.html The definition of the Instrument struct, which is marked as non-exhaustive. ```rust #[non_exhaustive] pub struct Instrument { /* private fields */ } ``` -------------------------------- ### Synthesizer::note_off Source: https://docs.rs/rustysynth/1.3.6/rustysynth/struct.Synthesizer.html?search= Stops a note on the specified channel. ```APIDOC ## pub fn note_off(&mut self, channel: i32, key: i32) ### Description Stops a note on the specified channel. ### Parameters - **channel** (i32) - Required - The channel of the note. - **key** (i32) - Required - The key of the note. ``` -------------------------------- ### MidiFileError Enum Definition Source: https://docs.rs/rustysynth/1.3.6/rustysynth/enum.MidiFileError.html The definition of the MidiFileError enum, which is marked as non-exhaustive, requiring a wildcard arm when matching. ```rust #[non_exhaustive] pub enum MidiFileError { IoError(Error), InvalidChunkType { expected: FourCC, actual: FourCC, }, InvalidChunkData(FourCC), UnsupportedFormat(i16), InvalidTempoValue, } ``` -------------------------------- ### MidiFileLoopType Enum Source: https://docs.rs/rustysynth/1.3.6/rustysynth/enum.MidiFileLoopType.html?search= The MidiFileLoopType enum defines the loop behavior for MIDI playback. It is marked as non-exhaustive, meaning future versions may add new variants. ```APIDOC ## MidiFileLoopType ### Description Specifies the type of the loop extension to use when playing back a MIDI file. ### Variants - **LoopPoint(usize)** - Specifies the loop start point by a tick value. - **RpgMaker** - The RPG Maker style loop. CC #111 will be the loop start point. - **IncredibleMachine** - The Incredible Machine style loop. CC #110 and #111 will be the start and end points of the loop. - **FinalFantasy** - The Final Fantasy style loop. CC #116 and #117 will be the start and end points of the loop. ``` -------------------------------- ### MidiFileLoopType Enum Source: https://docs.rs/rustysynth/1.3.6/rustysynth/enum.MidiFileLoopType.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E The MidiFileLoopType enum defines the loop behavior for MIDI playback. It is marked as non-exhaustive, meaning future variants may be added. ```APIDOC ## MidiFileLoopType ### Description Specifies the type of the loop extension to use when playing back a MIDI file. ### Variants - **LoopPoint(usize)**: Specifies the loop start point by a tick value. - **RpgMaker**: The RPG Maker style loop. CC #111 will be the loop start point. - **IncredibleMachine**: The Incredible Machine style loop. CC #110 and #111 will be the start and end points of the loop. - **FinalFantasy**: The Final Fantasy style loop. CC #116 and #117 will be the start and end points of the loop. ``` -------------------------------- ### Define MidiFileLoopType Enum Source: https://docs.rs/rustysynth/1.3.6/rustysynth/enum.MidiFileLoopType.html?search=Option%3CT%3E%2C+%28T+-%3E+U%29+-%3E+Option%3CU%3E The MidiFileLoopType enum is marked as non-exhaustive, requiring a wildcard arm when matching. ```rust #[non_exhaustive] pub enum MidiFileLoopType { LoopPoint(usize), RpgMaker, IncredibleMachine, FinalFantasy, } ``` -------------------------------- ### Define LoopMode Enum Source: https://docs.rs/rustysynth/1.3.6/rustysynth/enum.LoopMode.html The LoopMode enum specifies the looping behavior for audio samples. ```rust pub enum LoopMode { NoLoop, Continuous, LoopUntilNoteOff, } ``` -------------------------------- ### SynthesizerError Enum Definition Source: https://docs.rs/rustysynth/1.3.6/rustysynth/enum.SynthesizerError.html?search=std%3A%3Avec The definition of the non-exhaustive SynthesizerError enum. ```rust #[non_exhaustive] pub enum SynthesizerError { SampleRateOutOfRange(i32), BlockSizeOutOfRange(usize), MaximumPolyphonyOutOfRange(usize), } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.