Commit Graph

186 Commits

Author SHA1 Message Date
Tom M a50680aafa
Add warnings and extend documentation for issue #1120 (#1126) 2022-06-27 17:26:15 +02:00
derselbst 15529d50a8 Make MIDI Event API const correct 2022-04-19 22:15:18 +02:00
derselbst 757b151601 Move fluid_event_from_midi_event() to fluid_event.c 2022-04-12 21:45:19 +02:00
JimHenry b1a28624ba Add fluid_event_from_midi_event(fluid_event_t *evt, const fluid_midi_event_t *event) to create a sequencer event from a midi event. Issue #1078 2022-04-12 10:37:29 +02:00
Nihal 2fafca42a1
fix typo (#954) 2021-08-07 13:35:04 +02:00
luz paz e4c8ef080c Fix source comment typos
Found via `codespell -q 3 -S ChangeLog -L bloc,blocs,capela,parms,readd,seh`
2021-07-10 08:44:35 -04:00
Tom M d709339ab5
Fix ordering of NoteOn Vel=0 events (#908) 2021-06-11 22:57:54 +02:00
Tom M 1525a6fc0b
Restore old behaviour of fluid_player_join() (#876)
This basically reverts #783 because it causes a deadlock in existing client code.
2021-05-07 22:50:09 +02:00
derselbst 0ea101721a Make users aware of relative sequencer tick error 2021-05-01 15:16:39 +02:00
Arthur Chaloin 676923757c
Fix race condition in fluid_player_callback (#783)
Co-authored-by: Arthur Chaloin <arthur.chaloin@gmail.com>
2021-02-27 13:09:48 +01:00
Arthur Chaloin 13185d32b2
Add optional per tick callback to player (#780)
Co-authored-by: Arthur Chaloin <arthur.chaloin@gmail.com>
Co-authored-by: derselbst <tom.mbrt@googlemail.com>
2021-02-26 21:05:31 +01:00
derselbst 998eeee471 Elaborate API docs of fluid_audio_func_t 2021-01-22 19:46:03 +01:00
jjceresa 4f2cb370a1
Add shell commands to the MIDI File Player (#713) 2021-01-15 19:04:02 +01:00
Tom M ca6bcda7d9
Merge pull request #739 from FluidSynth/parse-cmd3
Handle settings-related commands in user command file early
2021-01-10 12:08:19 +01:00
jjceresa 2cada68e02
Fix MIDI player tempo reset issues (#711) 2021-01-10 12:01:28 +01:00
derselbst 40ed09367a Parse set commands from config file early 2021-01-09 18:51:33 +01:00
Tom M 9a25e71b02
Add FLUID_SEQ_SCALE event type (#723) 2020-12-27 17:53:36 +01:00
jjceresa c9b187bd85
Fx unit api (#673)
This PR addresses #669 point 2.1.
It proposes set/get API functions to change/read fx unit parameters.
The deprecated shell commands are updated. Now the commands line have 2 parameters:
- first parameter is the fx unit index.
- second parameter is the value to apply to the fx unit.
2020-11-22 21:02:06 +01:00
Marcus Weseloh 36280b9788 Add missing group brief descriptions 2020-11-14 17:10:26 +01:00
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