mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-05-30 17:00:39 +00:00
Smaller cleanup and reformatting of long lines.
This commit is contained in:
parent
b565b3ebc3
commit
eebbfb6a62
4 changed files with 37 additions and 14 deletions
|
@ -39,6 +39,7 @@ What is FluidSynth?
|
|||
|
||||
- FluidSynth is open source, in active development. For more details, take a look at http://www.fluidsynth.org
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
\example example.c
|
||||
|
|
|
@ -40,8 +40,8 @@ with fluid_settings_setstr(). In most cases, the default driver should work
|
|||
out of the box.
|
||||
|
||||
Additional options that define the audio quality and latency are
|
||||
\setting{audio_sample-format}, \setting{audio_period-size}, and \setting{audio_periods}. The details
|
||||
are described later.
|
||||
\setting{audio_sample-format}, \setting{audio_period-size}, and
|
||||
\setting{audio_periods}. The details are described later.
|
||||
|
||||
You create the audio driver with the new_fluid_audio_driver() function. This
|
||||
function takes the settings and synthesizer object as arguments. For example:
|
||||
|
@ -66,12 +66,12 @@ As soon as the audio driver is created, it will start playing. The audio
|
|||
driver creates a separate thread that uses the synthesizer object to generate
|
||||
the audio.
|
||||
|
||||
There are a number of general audio driver settings. The audio.driver
|
||||
settings define the audio subsystem that will be used. The \setting{audio_periods} and
|
||||
There are a number of general audio driver settings. The audio.driver settings
|
||||
define the audio subsystem that will be used. The \setting{audio_periods} and
|
||||
\setting{audio_period-size} settings define the latency and robustness against
|
||||
scheduling delays. There are additional settings for the audio subsystems
|
||||
used. For a full list of available <strong>audio driver settings</strong>,
|
||||
please refer to the \setting{audio} documentation.
|
||||
scheduling delays. There are additional settings for the audio subsystems used.
|
||||
For a full list of available <strong>audio driver settings</strong>, please
|
||||
refer to the \setting{audio} documentation.
|
||||
|
||||
<strong>*Note:</strong> In order to use sdl2 as audio driver, the application
|
||||
is responsible for initializing SDL (e.g. with SDL_Init()). This must be done
|
||||
|
|
|
@ -2,9 +2,18 @@
|
|||
|
||||
\page CreatingSettings Creating and changing the settings
|
||||
|
||||
Before you can use the synthesizer, you have to create a settings object. The settings objects is used by many components of the FluidSynth library. It gives a unified API to set the parameters of the audio drivers, the midi drivers, the synthesizer, and so forth. A number of default settings are defined by the current implementation.
|
||||
Before you can use the synthesizer, you have to create a settings object. The
|
||||
settings objects is used by many components of the FluidSynth library. It gives
|
||||
a unified API to set the parameters of the audio drivers, the midi drivers, the
|
||||
synthesizer, and so forth. A number of default settings are defined by the
|
||||
current implementation.
|
||||
|
||||
All settings have a name that follows the "dotted-name" notation. For example, \setting{synth_polyphony} refers to the number of voices (polyphony) allocated by the synthesizer. The settings also have a type. There are currently three types: strings, numbers (double floats), and integers. You can change the values of a setting using the fluid_settings_setstr(), fluid_settings_setnum(), and fluid_settings_setint() functions. For example:
|
||||
All settings have a name that follows the "dotted-name" notation. For example,
|
||||
\setting{synth_polyphony} refers to the number of voices (polyphony) allocated
|
||||
by the synthesizer. The settings also have a type. There are currently three
|
||||
types: strings, numbers (double floats), and integers. You can change the
|
||||
values of a setting using the fluid_settings_setstr(), fluid_settings_setnum(),
|
||||
and fluid_settings_setint() functions. For example:
|
||||
|
||||
\code
|
||||
#include <fluidsynth.h>
|
||||
|
@ -19,6 +28,11 @@ int main(int argc, char** argv)
|
|||
}
|
||||
\endcode
|
||||
|
||||
The API contains the functions to query the type, the current value, the default value, the range and the "hints" of a setting. The range is the minimum and maximum value of the setting. The hints gives additional information about a setting. For example, whether a string represents a filename. Or whether a number should be interpreted on on a logarithmic scale. Check the settings.h API documentation for a description of all functions.
|
||||
The API contains the functions to query the type, the current value, the
|
||||
default value, the range and the "hints" of a setting. The range is the minimum
|
||||
and maximum value of the setting. The hints gives additional information about
|
||||
a setting. For example, whether a string represents a filename. Or whether a
|
||||
number should be interpreted on on a logarithmic scale. Check the settings.h
|
||||
API documentation for a description of all functions.
|
||||
|
||||
*/
|
||||
|
|
|
@ -2,18 +2,26 @@
|
|||
|
||||
\page synth-context Understanding the "synthesis context"
|
||||
|
||||
When reading through the functions exposed via our API, you will often read the note: "May or may not be called from synthesis context."
|
||||
When reading through the functions exposed via our API, you will often read the
|
||||
note: "May or may not be called from synthesis context."
|
||||
|
||||
The reason for this is that some functions are intentionally not thread-safe. Or they require to be called from this context to behave correctly.
|
||||
The reason for this is that some functions are intentionally not thread-safe.
|
||||
Or they require to be called from this context to behave correctly.
|
||||
|
||||
FluidSynth's rendering engine is implemented by using the "Dispatcher Thread Pattern". This means that a certain thread @c A which calls one of FluidSynth's rendering functions, namely
|
||||
FluidSynth's rendering engine is implemented by using the "Dispatcher Thread
|
||||
Pattern". This means that a certain thread @c A which calls one of FluidSynth's
|
||||
rendering functions, namely
|
||||
|
||||
- fluid_synth_process()
|
||||
- fluid_synth_nwrite_float()
|
||||
- fluid_synth_write_float()
|
||||
- fluid_synth_write_s16()
|
||||
|
||||
automatically becomes the "synthesis thread". The terms "synthesis context" and "synthesis thread" are equivalent. A few locations in our API provide hooks that allow you to interfere this "synthesis context". At those locations you can register your own custom functions that will always be called by thread @c A. For this use-case, the following functions are of interest:
|
||||
automatically becomes the "synthesis thread". The terms "synthesis context" and
|
||||
"synthesis thread" are equivalent. A few locations in our API provide hooks
|
||||
that allow you to interfere this "synthesis context". At those locations you
|
||||
can register your own custom functions that will always be called by thread
|
||||
@c A. For this use-case, the following functions are of interest:
|
||||
|
||||
- new_fluid_audio_driver2()
|
||||
- fluid_player_set_playback_callback()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue