Commit graph

269 commits

Author SHA1 Message Date
derselbst
0354196e43 Fix typo in API docs 2020-05-27 17:26:14 +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
5af89f8c92 Bump to 2.1.3 2020-05-23 14:29:17 +02:00
derselbst
304096add7 Update API docs about synthesis context 2020-05-02 20:12:01 +02:00
derselbst
f14c33a4e6 Elaborate docs of audio.realtime-prio 2020-04-22 17:28:38 +02:00
derselbst
2a6b22e9bb Bump to 2.1.2 2020-04-05 18:44:06 +02:00
derselbst
eff728753b Update API docs 2020-03-08 09:55:09 +01:00
Tom M
3b851da6f7
Amend comment in fluidsynth_fx.c 2020-02-16 19:55:28 +01:00
derselbst
ab15b32656 Bump to 2.1.1 2020-02-16 15:59:11 +01:00
derselbst
98d395bab0 Update fluidsynth_fx example to explain effects mixing 2020-02-16 10:03:45 +01:00
derselbst
746cbeb1c1 Remove orphaned SF spec link from API docs 2020-02-16 09:44:07 +01:00
derselbst
d5424462b5 Update documentation of --verbose option 2020-02-14 13:40:50 +01:00
Tom M
af2342ac43
Solve the sequencer client unregistering problem (#610)
Responsibility for calling fluid_sequencer_unregister_client() in case of FLUID_SEQ_UNREGISTERING events has been moved to fluid_sequencer_send_now(). In other words, a FLUID_SEQ_UNREGISTERING event now really unregisters the client, no matter how the client's callback function looks like.

Avoids leaking the sequencer clients if implementations do not unregister them explicitly.

Also fixes another memory leak if fluid_sequencer_register_fluidsynth() clients were unregistered with fluid_sequencer_unregister_client() rather than by sending an unregistering event.
2020-02-01 14:32:35 +01:00
Tom M
872c6bc678
Compile suitable demo files from doc/ (#611) 2020-01-24 08:57:20 +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
e19652d45a Amend documentation about synth.sample-rate setting 2020-01-11 14:45:20 +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
derselbst
37c9ae2bf4 Bump to 2.1.0 stable 2019-11-30 15:42:25 +01:00
derselbst
56dd87ebf1 Deprecate fluid_synth_set_sample_rate()
Addresses #585
2019-10-31 09:29:55 +01:00
derselbst
644668a776 Merge branch '2.0.x' into master 2019-10-27 16:52:45 +01:00
derselbst
56a4507513 Mention fluid_sample_set_sound_data() in API docs 2019-10-27 16:49:04 +01:00
derselbst
5c442c9b13 Document --quiet option in manual 2019-10-27 12:18:00 +01:00
derselbst
881eb9b080 Mention new audio drivers in API docs 2019-10-23 21:16:05 +02:00
derselbst
585396d36e Bump version to 2.1.0 RC1 2019-10-23 21:00:38 +02:00
derselbst
79e5807a14 Mention fluid_sample_set_sound_data() in API docs 2019-10-23 20:53:52 +02:00
jjceresa
0288466f40 Chorus enhancement. (#548)
This adds new LFO modulators:
 - these modulators are computed on the fly, instead of using lfo lookup table. Advantages:
      - Avoiding a lost of 608272 memory bytes when lfo speed is low (0.3Hz).
      - Allows to diminish the lfo speed lower limit to 0.1Hz instead of 0.3Hz.
        A speed of 0.1 is interesting for chorus. Using a lookup table for 0.1Hz
        would require too much memory (1824816 bytes).
      - Make use of first-order all-pass interpolator instead of bandlimited interpolation.
      - Although lfo modulator is computed on the fly, cpu load is lower than using
        lfo lookup table with bandlimited interpolator.

Also adds a stereo unit controlled by WIDTH macro. WIDTH [0..10] value define a stereo separation between left and right.
 - When 0, the output is monophonic.
 - When > 0 , the output is stereophonic.

 WIDTH is currently fixed to maximum value to provide maximum stereo effect.
2019-10-23 16:41:13 +02:00
derselbst
1f2c301cc3 Build fluidsynth for Android in RelWithDebInfo 2019-10-21 15:16:35 +02:00
Tom M
5919be2ceb
Revise README (#566)
The readme has been revised. Most of the SoundFont related information was moved to the wiki. Obsolete documentation files have been removed.
2019-10-13 10:56:24 +02:00
derselbst
9ab3e3ab51 Merge branch '2.0.x' into master 2019-09-28 07:38:54 +02:00
derselbst
62b38b1c66 Minor typo in API docs 2019-09-27 16:53:27 +02:00
derselbst
9793c0def3 bump to 2.0.7 2019-09-24 16:23:55 +02:00
jjceresa
5f6914bb34 Add Sostenuto PDF documentation (#559)
This document explains what sostenuto pedal is compared to sustain pedal. It is intended for a musician playing live. It gives information about specifications and implementation in fluidsynth.
2019-09-14 17:19:43 +03:00
derselbst
c6030874ab Merge branch '2.0.x' into master 2019-08-25 11:00:07 +02:00
derselbst
cac2c6bf84 Fix example code in the API docs
order of object creation: audio driver must be last
2019-08-25 10:59:11 +02:00
derselbst
1e7a5f594d Merge branch '2.0.x' into master 2019-08-19 16:39:36 +02:00
derselbst
f78486a50b Update developer docs 2019-08-17 18:01:01 +02:00
derselbst
dec5e98f23 Bump version to 2.0.6 2019-08-17 18:00:29 +02:00
Atsushi Eno
f87f35fe71 [Android] remove extra cmake args with proper use of PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR. (#534) 2019-04-22 09:30:52 +02:00
Atsushi Eno
656fe6e2d9 [Android] disable sdl2 and enable sndfile at cmake. (#533) 2019-04-21 16:44:54 +02:00
Atsushi Eno
492ab8c7f6 [Android] add libsndfile to build. (#532)
This brings in support for compressed soundfonts (sf3) for Android.
We need libsndfile.so, but it has various dependencies (libogg, libvorbis,
libflac), which are somewhat annoying to build if you do everything
by yourself.

Fortunately cerbero has recipes for libogg, libvorbis and libflac.
I added custom recipe for libsndfile in the referenced cerbero fork, and
therefore the changes could be just in cerbero world.
2019-04-20 09:27:15 +02:00
derselbst
c9a670d26c Merge branch '2.0.x' into master 2019-04-18 20:21:01 +02:00
derselbst
b817232f16 update API docs for 2.0.5 2019-04-17 20:07:40 +02:00
derselbst
e31bbe3504 Merge branch '2.0.x' into master 2019-04-17 19:14:46 +02:00
derselbst
226b411a04 wording docs 2019-04-13 14:52:45 +02:00
derselbst
e5c29cf8b8 bump to 2.0.5 2019-04-13 14:02:01 +02:00
Atsushi Eno
daa037b0d3 Add Android audio drivers based on OpenSLES and Oboe (#464)
This set of changes implements audio drivers for Android, OpenSLES and Oboe. The changes in the original sources are kept minimal so that it should be easily maintained.
2019-03-27 18:02:23 +01:00
derselbst
c096c54cb6 Merge branch '2.0.x' into master 2019-02-09 09:52:53 +01:00
derselbst
851a26fff1 bump to 2.0.4 2019-02-08 17:39:12 +01:00
derselbst
b98ba5bc63 Merge branch '2.0.x'
Closes #500
2019-01-12 16:54:35 +01:00
Marcus Weseloh
53bed2d506 Fix example code to deactivate reverb and chorus via fluid_settings_setint 2019-01-12 14:37:20 +01:00
Marcus Weseloh
241f676047 Add note about changes to fluid_settings_set* functions introduced in #293 2019-01-12 14:37:12 +01:00
derselbst
8b1820580b Merge branch '2.0.x' 2018-12-30 12:42:30 +01:00
derselbst
1bae9b2fe1 bump to version 2.0.3 2018-12-30 12:42:00 +01:00
derselbst
15d27b7145 fix inverse logic in fluid_sample_set_sound_data() 2018-12-29 17:34:36 +01:00
derselbst
5fe56b32b2 clarify availability sdl2 and waveout audio driver options 2018-12-21 20:11:01 +01:00
derselbst
10ddcc0cd3 Merge branch '2.1-testing' into master 2018-12-21 20:05:32 +01:00
derselbst
d0813be1c5 add missing getters for lyric and text midi events
fixes #468
2018-12-20 17:45:10 +01:00
carlo-bramini
978283bbf0 Add Sdl2 driver (#478) 2018-12-14 16:43:35 +01:00
derselbst
d5ba910f3c document waveout option for audio.driver 2018-12-04 19:36:10 +01:00
derselbst
eb22cfbdbb bump to version 2.0.2 2018-11-18 09:39:09 +01:00
derselbst
ac356a408b update fluidsettings.xml on jack midi autoconnect 2018-10-31 13:14:59 +01:00
derselbst
f0312c13d3 deprecate fluid_synth_error() 2018-10-09 17:52:33 +02:00
jjceresa
8178d72d82 fix typos and grammar in FluidPolyMono-0004.pdf (#440) 2018-10-09 14:57:17 +02:00
derselbst
0f11c9a0da bump to 2.0.1 2018-10-07 14:47:07 +02:00
derselbst
3a0640d633 bump manpage date 2018-10-06 13:51:40 +02:00
derselbst
3ef6af5ade Merge branch 'recent-docs' 2018-10-06 11:45:18 +02:00
derselbst
3d528a0f05 revise deprecated reverb/chorus commands in man page 2018-10-05 18:40:15 +02:00
derselbst
fd7db023dd set upper chorus depth to 256 ms
upper depth limit (ms) = (MAX_SAMPLES * 1000) / lower sample rate limit

with MAX_SAMPLES==2048 && lowersrate==8000
2018-10-05 18:39:54 +02:00
derselbst
0fb62e4184 fix lower limit of synth.sample-rate in docs 2018-10-05 18:12:27 +02:00
sykhro
78a6ce71a3 Fix the sfload_mem example to actually read back the pointer address 2018-09-19 01:18:42 +02:00
derselbst
e2e34ba9eb update fluidsettings regarding coremidi autoconnect 2018-09-15 14:13:35 +02:00
jjceresa
401f53a009 Update polymono doc and AUTHORS files (#428)
- fix comments in polymono documentation.
- add author entry.
2018-09-12 12:10:29 +02:00
derselbst
cbe4003d97 bump version to 2.0.0 (stable release) 2018-09-12 12:07:35 +02:00
Tom M
e4b8e2b44c
Implement fluid_get_userconf() on windows (#425) 2018-09-09 22:34:35 +02:00
derselbst
7f4049c88f prepare for fluidsynth 2.0RC1 2018-08-15 18:09:33 +02:00
derselbst
2ea8c9a7dc extend documentation on multi-channel rendering 2018-07-16 12:10:07 +02:00
derselbst
9546e4a9fe bump date of API docs 2018-07-11 23:43:07 +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
253a381898 update the documentation of synth.effects-groups
and some related settings
2018-07-11 13:16:50 +02:00
derselbst
12cfe0d1c4 add note about ramsfont in API docs 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
550f853509 update example fluidsynth_fx.c 2018-06-23 14:34:30 +02:00
derselbst
fd27e15746 update API docs on fluid_synth_process() 2018-06-23 14:26:41 +02:00
derselbst
c309e417c5 adjust implementation of audio drivers for fluid_synth_process() 2018-06-18 16:01:27 +02:00
derselbst
109db1484b fluidsettings: report boolean settings as int 2018-06-17 20:02:46 +02:00
derselbst
474bb83303 fix typo in fluidsynth_process.c 2018-05-19 09:28:37 +02:00
derselbst
27ce8ec824 bump API doc to 2.0 beta 2018-05-19 09:06:03 +02:00
derselbst
b375070768 cleanup 2.0 API docs
* remove obsolete 1.1.* change history
* increase readability of 2.0 changes
2018-05-18 16:28:09 +02:00
derselbst
b07599b6f7 clarify comments in fluidsynth_process.c 2018-05-18 15:50:58 +02:00
derselbst
fd84365328 fix typo in Doxyfile 2018-05-18 12:50:10 +02:00
Tom M
51252b72b4
Merge branch 'master' into issue49 2018-05-17 22:13:36 +02:00
Tom M
b40fb9d782
Merge pull request #382 from FluidSynth/unregister
fix double free when deleting fluid_seqbind_t
2018-05-17 22:13:08 +02:00
derselbst
0188cd9d93 rename reverb roomsize setting to match naming conventions 2018-05-17 21:44:03 +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
57abab0a31 document reverb and chorus settings 2018-05-17 19:59:34 +02:00
derselbst
e1a3e2468b require explicit unregistering of sequencer clients 2018-05-17 15:36:38 +02:00
derselbst
75e168cb58 update API doc of fluid_synth_process() and add usage example 2018-05-17 14:43:59 +02:00
derselbst
36546a9efb remove synth.parallel-render setting 2018-05-09 20:54:51 +02:00