MuseScore
3.4
Music composition and notation
|
#include <fluid.h>
Public Member Functions | |
Fluid () | |
~Fluid () | |
virtual void | init (float sampleRate) |
virtual const char * | name () const |
virtual void | play (const PlayEvent &) |
virtual const QList< MidiPatch * > & | getPatchInfo () const |
virtual SynthesizerGroup | state () const |
virtual bool | setState (const SynthesizerGroup &) |
virtual void | allSoundsOff (int) |
virtual void | allNotesOff (int) |
int | loadProgress () |
void | setLoadProgress (int val) |
bool | loadWasCanceled () |
void | setLoadWasCanceled (bool status) |
Preset * | get_preset (unsigned int sfontnum, unsigned int banknum, unsigned int prognum) |
Preset * | find_preset (unsigned int banknum, unsigned int prognum) |
void | modulate_voices (int chan, bool is_cc, int ctrl) |
void | modulate_voices_all (int chan) |
void | damp_voices (int chan) |
int | kill_voice (Voice *voice) |
void | print_voice () |
void | update_presets () |
This function assures that every MIDI channels has a valid preset (NULL is okay). More... | |
int | get_cc (int chan, int num) const |
void | system_reset () |
void | program_change (int chan, int prognum) |
void | set_gen2 (int chan, int param, float value, int absolute, int normalized) |
Change the value of a generator. More... | |
float | get_gen (int chan, int param) |
void | set_gen (int chan, int param, float value) |
void | set_interp_method (int chan, int interp_method) |
Preset * | get_channel_preset (int chan) const |
virtual bool | loadSoundFonts (const QStringList &s) |
virtual bool | addSoundFont (const QString &s) |
virtual bool | removeSoundFont (const QString &s) |
QStringList | soundFonts () const |
std::vector< SoundFontInfo > | soundFontsInfo () const override |
void | start_voice (Voice *voice) |
Voice * | alloc_voice (unsigned id, Sample *sample, int chan, int key, int vel, double vt) |
void | free_voice_by_kill () |
virtual void | process (unsigned len, float *out, float *effect1, float *effect2) |
bool | program_select (int chan, unsigned sfont_id, unsigned bank_num, unsigned preset_num) |
void | get_program (int chan, unsigned *sfont_id, unsigned *bank_num, unsigned *preset_num) |
void | get_pitch_wheel_sens (int chan, int *pval) |
void | pitch_wheel_sens (int chan, int val) |
void | get_pitch_bend (int chan, int *ppitch_bend) |
void | freeVoice (Voice *v) |
double | getPitch (int k) const |
float | ct2hz_real (float cents) |
float | act2hz (float c) |
float | ct2hz (float cents) |
virtual double | masterTuning () const |
virtual void | setMasterTuning (double f) |
QString | error () const |
virtual SynthesizerGui * | gui () |
bool | globalTerminate () |
void | setGlobalTerminate (bool terminate=true) |
Public Member Functions inherited from Ms::Synthesizer | |
Synthesizer () | |
virtual | ~Synthesizer () |
float | sampleRate () const |
virtual void | setValue (int, double) |
virtual double | value (int) const |
void | reset () |
bool | active () const |
void | setActive (bool val=true) |
Static Public Member Functions | |
static QFileInfoList | sfFiles () |
Protected Member Functions | |
SFont * | get_sfont_by_name (const QString &name) |
SFont * | get_sfont_by_id (int id) |
SFont * | get_sfont (int idx) const |
bool | sfunload (int id) |
int | sfload (const QString &filename) |
Protected Attributes | |
int | _state |
unsigned int | sfont_id |
QList< Channel * > | channel |
unsigned int | noteid |
Protected Attributes inherited from Ms::Synthesizer | |
float | _sampleRate |
SynthesizerGui * | _gui |
Private Member Functions | |
void | updatePatchList () |
Private Attributes | |
QList< SFont * > | sfonts |
QList< MidiPatch * > | patches |
QList< Voice * > | freeVoices |
QList< Voice * > | activeVoices |
QString | _error |
double | sample_rate |
float | _masterTuning |
double | _tuning [128] |
int | _loadProgress = 0 |
bool | _loadWasCanceled = false |
QMutex | mutex |
bool | _globalTerminate = false |
Static Private Attributes | |
static bool | initialized = false |
Friends | |
class | Voice |
class | Preset |
FluidS::Fluid::Fluid | ( | ) |
FluidS::Fluid::~Fluid | ( | ) |
|
inline |
|
virtual |
Reimplemented from Ms::Synthesizer.
|
virtual |
Reimplemented from Ms::Synthesizer.
Voice * FluidS::Fluid::alloc_voice | ( | unsigned | id, |
Sample * | sample, | ||
int | chan, | ||
int | key, | ||
int | vel, | ||
double | vt | ||
) |
|
virtual |
Reimplemented from Ms::Synthesizer.
|
inline |
|
inline |
void FluidS::Fluid::damp_voices | ( | int | chan | ) |
|
inline |
Preset * FluidS::Fluid::find_preset | ( | unsigned int | banknum, |
unsigned int | prognum | ||
) |
void FluidS::Fluid::free_voice_by_kill | ( | ) |
void FluidS::Fluid::freeVoice | ( | Voice * | v | ) |
|
inline |
|
inline |
float FluidS::Fluid::get_gen | ( | int | chan, |
int | param | ||
) |
void FluidS::Fluid::get_pitch_bend | ( | int | chan, |
int * | ppitch_bend | ||
) |
void FluidS::Fluid::get_pitch_wheel_sens | ( | int | chan, |
int * | pval | ||
) |
Preset * FluidS::Fluid::get_preset | ( | unsigned int | sfontnum, |
unsigned int | banknum, | ||
unsigned int | prognum | ||
) |
void FluidS::Fluid::get_program | ( | int | chan, |
unsigned * | sfont_id, | ||
unsigned * | bank_num, | ||
unsigned * | preset_num | ||
) |
|
inlineprotected |
|
protected |
|
protected |
|
inlinevirtual |
Implements Ms::Synthesizer.
|
inline |
|
inline |
|
virtual |
Reimplemented from Ms::Synthesizer.
|
virtual |
Reimplemented from Ms::Synthesizer.
int FluidS::Fluid::kill_voice | ( | Voice * | voice | ) |
|
inline |
|
virtual |
Implements Ms::Synthesizer.
|
inline |
|
inlinevirtual |
Reimplemented from Ms::Synthesizer.
void FluidS::Fluid::modulate_voices | ( | int | chan, |
bool | is_cc, | ||
int | ctrl | ||
) |
void FluidS::Fluid::modulate_voices_all | ( | int | chan | ) |
|
inlinevirtual |
Implements Ms::Synthesizer.
void FluidS::Fluid::pitch_wheel_sens | ( | int | chan, |
int | val | ||
) |
|
virtual |
Implements Ms::Synthesizer.
void FluidS::Fluid::print_voice | ( | ) |
|
virtual |
Implements Ms::Synthesizer.
void FluidS::Fluid::program_change | ( | int | chan, |
int | prognum | ||
) |
bool FluidS::Fluid::program_select | ( | int | chan, |
unsigned | sfont_id, | ||
unsigned | bank_num, | ||
unsigned | preset_num | ||
) |
|
virtual |
Reimplemented from Ms::Synthesizer.
void FluidS::Fluid::set_gen | ( | int | chan, |
int | param, | ||
float | value | ||
) |
void FluidS::Fluid::set_gen2 | ( | int | chan, |
int | param, | ||
float | value, | ||
int | absolute, | ||
int | normalized | ||
) |
Change the value of a generator.
This function allows to control all synthesis parameters in real-time. The changes are additive, i.e. they add up to the existing parameter value. This function is similar to sending an NRPN message to the synthesizer. The function accepts a float as the value of the parameter. The parameter numbers and ranges are described in the SoundFont 2.01 specification, paragraph 8.1.3, page 48. See also 'fluid_gen_type'.
Using the fluid_synth_set_gen2() function, it is possible to set the absolute value of a generator. This is an extension to the SoundFont standard. If 'absolute' is non-zero, the value of the generator specified in the SoundFont is completely ignored and the generator is fixed to the value passed as argument. To undo this behavior, you must call fluid_synth_set_gen2 again, with 'absolute' set to 0 (and possibly 'value' set to zero).
If 'normalized' is non-zero, the value is supposed to be normalized between 0 and 1. Before applying the value, it will be scaled and shifted to the range defined in the SoundFont specifications.
void FluidS::Fluid::set_interp_method | ( | int | chan, |
int | interp_method | ||
) |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Reimplemented from Ms::Synthesizer.
|
virtual |
Implements Ms::Synthesizer.
|
static |
|
protected |
|
protected |
QStringList FluidS::Fluid::soundFonts | ( | ) | const |
|
overridevirtual |
Implements Ms::Synthesizer.
void FluidS::Fluid::start_voice | ( | Voice * | voice | ) |
Kill all voices on a given channel, which belong into excl_class. This function is called by a SoundFont's preset in response to a noteon event. If one noteon event results in several voice processes (stereo samples), ignore_ID must name the voice ID of the first generated voice (so that it is not stopped). The first voice uses ignore_ID=-1, which will terminate all voices on a channel belonging into the exclusive class excl_class.
|
virtual |
Implements Ms::Synthesizer.
void FluidS::Fluid::system_reset | ( | ) |
void FluidS::Fluid::update_presets | ( | ) |
This function assures that every MIDI channels has a valid preset (NULL is okay).
This function is called after a SoundFont is unloaded or reloaded.
|
private |
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
protected |
|
private |
|
staticprivate |
|
private |
|
protected |
|
private |
|
private |
|
protected |
|
private |