Commit graph

167 commits

Author SHA1 Message Date
Marcus Weseloh
2a2027085e Separate new_* and delete_* functions from the rest 2020-11-13 22:23:29 +01:00
Marcus Weseloh
a9135faf70 Structure the large synth header into subgroups
Also include version.h and ladspa.h in the Synthesizer group.
2020-11-12 21:27:00 +01:00
Marcus Weseloh
6780293d0c Add version defines and functions to misc group 2020-11-12 21:27:00 +01:00
Marcus Weseloh
9248032feb SoundFont API
Includes Generators, Modulators, Loader etc
2020-11-12 21:27:00 +01:00
Marcus Weseloh
7f1ac22869 Miscellaneous group 2020-11-12 21:27:00 +01:00
Marcus Weseloh
4a40695541 Settings documentation 2020-11-12 21:27:00 +01:00
Marcus Weseloh
39ae70793a MIDI Seqencer documentation 2020-11-12 21:27:00 +01:00
Marcus Weseloh
4185b25d6f MIDI input group
Contains MIDI Driver, MIDI Router, MIDI Player and MIDI Events
2020-11-12 21:27:00 +01:00
Marcus Weseloh
bae3dec78a Logging interface 2020-11-12 21:27:00 +01:00
Marcus Weseloh
66b7c19893 Audio output group
With subgroups Audio Driver and File Renderer
2020-11-12 21:27:00 +01:00
Marcus Weseloh
af68288628 Command Shell group for all shell related commands
With subgroups for command handler, shell and server.
2020-11-12 21:27:00 +01:00
Marcus Weseloh
272cc5edad Some additional subgrouping 2020-11-12 21:23:31 +01:00
Marcus Weseloh
a11806aa32 Change files into groups / modules 2020-11-12 21:23:31 +01:00
Marcus Weseloh
109c41c355
Add public API to pin and unpin presets to the sample cache (#698)
Following the discussion about an API to pin and unpin preset samples in the sample cache here:
https://lists.nongnu.org/archive/html/fluid-dev/2020-10/msg00016.html

Short explanation of the change:

Only the default loader currently supports dynamic sample loading, so I thought it might be a good idea to keep the changes for this feature mostly contained in the default loader as well. I've added two new preset notify flags (FLUID_PRESET_PIN and FLUID_PRESET_UNPIN) that are handled by the preset->notify callback and trigger the loading and possibly unloading of the samples.
2020-10-31 13:23:15 +01:00
Tom M
97615ef2cf
Promote Controller/Pressure/Bend event functions to 32bits (#670) 2020-10-08 16:33:52 +02:00
KO Myung-Hun
83394ab286 Define FLUIDSYNTH_API on OS/2
Previously, CMake on OS/2 exported all the symbols unconditionally. Now
it exports necessary symbols only. As a result, it's necessary to
define FLUIDSYNTH_API correctly.

Addresses #678
2020-09-24 17:59:05 +02:00
Tom M
4c1292d8ab
Remove fluid_event_any_control_change() from public API (#674)
Originally, I have only marked it deprecated. But since we have an SOVERSION bump next release and because this function was only meant for internal usage, I think it's safe to remove it right now.
2020-09-12 10:40:57 +02:00
Tom M
0d98c47545
Revise the sequencer's event queue (#604)
Proposing a new event queue for the sequencer, based on prior discussion:
https://lists.nongnu.org/archive/html/fluid-dev/2019-12/msg00001.html

With this change fluidsynth will require a C++98 compliant compiler.

Consider this as RFC, feedback is welcome.

The "pain-points" from the discussion:

#### 1. It is slow.

Done (thanks to heap sort), see runtime of `test_seq_event_queue_sort`.

#### 2. A meaningful ordering for events with the same tick has not been considered.

Done, see comments in `fluid_seq_queue.cpp`.

#### 3. Complicated implementation

Now uses one single event queue, which requires C++98. Implemented similarly to std::priority_queue by using heap sort.

The "queue" I use currently is of type `std::deque`. `deque` does not provide preallocation. `std::vector` does provide it. However, `std::deque` has the huge advantage that appending additional elements is cheap. For `std::vector` appending new elements would require to reallocate all the memory and copy it to the new array. So,

* either use `std::deque` with the risk that memory allocation may occur during `fluid_sequencer_send_at()`, or
* use `std::vector` with a preallocated pool of events and make `fluid_sequencer_send_at()` when the `vector` runs out of capacity.

Comments?

#### 4. Events that have been processed are deleted and gone.

After having thought about this more, this is the correct behavior. After events have been dispatched, they must be released to free underlying memory, see point 3. For the very rare case that a client (e.g. fluid_player) may require those events in the future, the client should be responsible for storing the events somewhere.

#### 5. The sequencer supports the system timer as alternative time source.

The conclusion from the mailing list was that the system timer can be removed. This has been done.

#### 6. Time Scaling

Time scaling can now be used for arbitrary tempo changes. The previous implementation was capable of that as well, however, the time-scale was limited to 1000. The only limitation for the scale is now >0, see `test_seq_scale`.

### Other Points

* `fluid_sequencer_remove_events()` turned out to be broken before, as it did not remove all events from the queue. This has been fixed, see `test_seq_event_queue_remove`.

* Consider the following code executed by `threadA`:

```c
fluid_sequencer_send_at(event0);
fluid_sequencer_set_time_scale(); // new scale
fluid_sequencer_send_at(event1);
```

The new scale will be definitely applied to `event1`. However, if another concurrently running `threadB` executes `fluid_sequencer_process()`, it was previously not clear, whether the new scale was also applied to event0. This depends on whether `event0` was still in the `preQueue`, and this depends on `event0.time` and the tick count that `fluid_sequencer_process()` is being called with. This has been changed. As of now, events are queued with their timestamp AS-IS. And only the latest call to `fluid_sequencer_set_time_scale()` is being considered during `fluid_sequencer_process()`. This makes the implementation very simple, i.e. no events need to be changed and the sequencer doesn't have to be locked down. On the other hand, it means that `fluid_sequencer_set_time_scale()` can only be used for tempo changes when called from the sequencer callback. In other words, if `threadA` executes the code above followed by `fluid_sequencer_process()`, `event0` and `event1` will be executed with the same tempo, which is the latest scale provided to the seq. Is this acceptable? The old implementation had the same limitation. And when looking through the internet, I only find users who call `fluid_sequencer_set_time_scale()` from the sequencer callback. Still, this is a point I'm raising for discussion.
2020-05-26 17:16:22 +02:00
Tom M
9995fd88b2
Support loading SoundFonts >2GiB on Windows (#629)
Since sizeof(long) == 4 even on 64 bit Windose, big files cannot be
loaded natively via the ANSI C file API. This change makes fluidsynth's
file callback API use long long, which is guaranteed to be at least 64
bit wide.
2020-05-26 16:53:59 +02:00
derselbst
871e409572 Update API doc of fluid_audio_func_t 2020-02-16 10:03:27 +01:00
Tom M
c85ad53d60
Deprecate usage of the system timer for the sequencer (#599)
Deprecate usage of the system timer for the sequencer and print a warning if the system timer is used.
2020-01-19 15:37:42 +01:00
derselbst
7af62902b6 Update API doc of fluid_sample_type 2020-01-10 16:57:23 +01:00
luz.paz
45f8e0a868 Fix various typos
Found via `codespell -q 3 -L uint -S ./ChangeLog -L dur`
2019-12-17 20:11:49 +01:00
Tom M
cd199cfdc8
Remove unused tracing code from sequencer (#596) 2019-12-14 18:09:29 +01:00
jjceresa
bebb5571ae Make Fine Tune destination of default modulator Pitch-Wheel-To-pitch (#590) 2019-11-08 21:26:07 +01:00
Tom M
56e0cfd7c1
Merge pull request #586 from FluidSynth/typecheck-fluid-log
Improve type-checking of fluid_log() format specifiers
2019-11-04 16:44:51 +01:00
derselbst
60bcdd4457 Add deprecation attribute to fluid_synth_set_sample_rate() 2019-11-03 10:55:29 +01:00
derselbst
bf6cc7ef6f Enable type-checking against format string of fluid_log() 2019-11-03 08:14:52 +01:00
derselbst
24e7c5090b Minor update to the synth API 2019-10-05 14:43:17 +02:00
Tom M
17042f4dc1
Add a public wrapper function for free() (#562)
to allow proper deallocation for programming languages other than C.
2019-09-24 16:14:34 +02:00
derselbst
2c9c176e17 fix documentation of fluid_sfont_iteration_next_t 2018-12-26 21:03:59 +01:00
derselbst
d0813be1c5 add missing getters for lyric and text midi events
fixes #468
2018-12-20 17:45:10 +01:00
derselbst
f0312c13d3 deprecate fluid_synth_error() 2018-10-09 17:52:33 +02:00
derselbst
4d8574d38a change fluid_log_* prototypes to const char* 2018-08-23 16:56:22 +02:00
derselbst
af1fc75717 add fluid_synth_count_effects_groups() 2018-07-12 10:34:02 +02:00
Tom M
c4f0b19c64
Merge pull request #405 from FluidSynth/fluid-synth-process
Complete implementation of fluid_synth_process() and add support for multi-channel effects rendering.
2018-07-11 17:26:51 +02:00
derselbst
7f1cdd2acf make fluid_synth_add_default_mod() const correct 2018-07-11 11:52:45 +02:00
derselbst
d7609d43f6 remove ramsfont 2018-06-26 08:34:41 +02:00
derselbst
5ea6bed2d4 Merge branch 'master' into fluid-synth-process 2018-06-25 17:12:29 +02:00
derselbst
9382edabd5 enforce coding style guide
using astyle
2018-06-24 13:13:18 +02:00
derselbst
734eaa9bb4 deprecate fluid_synth_nwrite_float() in favor of fluid_synth_process() 2018-06-18 16:21:37 +02:00
derselbst
995f22192d add a getter for fluid_preset_t::sfont 2018-06-04 10:49:58 +02:00
derselbst
a33e3c698d set soundfont iteration methods on fluid_sfont_t creation 2018-06-03 07:13:04 +02:00
derselbst
c1a2a7af19 update API doc of soundfont loader module 2018-06-03 07:04:17 +02:00
derselbst
77e608e3ce add public getters and iteration functions for fluid_sfont_t 2018-06-02 15:01:40 +02:00
derselbst
344133a704 add public getters for fluid_preset_t 2018-06-02 14:07:53 +02:00
Tom M
51252b72b4
Merge branch 'master' into issue49 2018-05-17 22:13:36 +02:00
derselbst
435361ef0c rename chorus getters to match naming conventions
fluid_synth_get_chorus_speed() and fluid_synth_get_chorus_depth()
2018-05-17 21:38:04 +02:00
derselbst
75e168cb58 update API doc of fluid_synth_process() and add usage example 2018-05-17 14:43:59 +02:00
derselbst
8690b4dbda remove default reverb and chorus macros from public API
should now be fetched through a settings instance
2018-05-10 20:00:25 +02:00