Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fx unit api #673

Merged
merged 71 commits into from
Nov 22, 2020
Merged

Fx unit api #673

merged 71 commits into from
Nov 22, 2020

Conversation

jjceresa
Copy link
Collaborator

@jjceresa jjceresa commented Sep 9, 2020

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.

jjceresa added 8 commits September 9, 2020 10:25
- add setter and getter functions for theses parameters.
  Now commands have 2 parameters:
  - First parameter is the fx unit index.
  - second parameter is the reverb value to set.
- Fix a bug in fluid_rvoice_mixer_set_reverb_params().
 Now commands have 2 parameters:
 - First parameter is the fx unit index.
 - second parameter is the chorus value to set.
@jjceresa
Copy link
Collaborator Author

The following actual API:

  • fluid_synth_set_chorusXX(synth, param);
  • fluid_synth_get_chorus_XX(synth, param);
  • fluid_synth_set_reverbXX(synth, param);
  • fluid_synth_get_reverbXX(synth, param);

becomes now redundant with the new one called with unit_idx set to -1:

  • fluid_synth_set_chorusXX2(synth, unit_idx,param);
  • fluid_synth_get_chorus_XX2(synth,unit_idx, param);
  • fluid_synth_set_reverbXX2(synth, unit_idx, param);
  • fluid_synth_get_reverb_XX2(synth, unit_idx, param);

That means that actual API should not be called by new application (and perhaps should be deprecated sooner or later ?). Perhaps we could ask to the mail-list if these deprecation could cause any backward issues ?

@sonarcloud
Copy link

sonarcloud bot commented Sep 12, 2020

SonarCloud Quality Gate failed.

Bug C 4 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell B 279 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

jjceresa added 8 commits October 25, 2020 15:02
-fluid_synth_set_reverb_group_xxxx()
-fluid_synth_get_reverb_group_xxxx()
-fluid_synth_set_chorus_group_xxxx()
-fluid_synth_get_chorus_group_xxxx()
The commands has one or 2 parameters: fx_command [unit_idx] value.
When there is 2 parameters the first parameter is the unit index
the value is applied to.
When there is one parameter the value are applied to all fx units,
this make the command backward compatible.
@lgtm-com
Copy link

lgtm-com bot commented Oct 25, 2020

This pull request introduces 1 alert when merging a74d792 into e5695b7 - view on LGTM.com

new alerts:

  • 1 for Wrong type of arguments to formatting function

@lgtm-com
Copy link

lgtm-com bot commented Oct 25, 2020

This pull request introduces 1 alert when merging 30a1767 into e5695b7 - view on LGTM.com

new alerts:

  • 1 for Wrong type of arguments to formatting function

}

param[0].i = set;
/* put fx unit index in bits [b15..b8] and set mask in bits [b7..b0] */
param[0].i = (fxunit_idx << 8) | (set & FLUID_CHORUS_SET_ALL) ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derselbst
Copy link
Member

Would compilers complain about the following?

No. From a purely technical point of view, I see no reason why casting an enum to double and back would not work. That doesn't mean that it will work fine in all scenarios. Keep in mind that fluidsynth is used by many programming languages. There is no guarantee, that there will a concellation where this does not work.

Apart from that, I feel ok with promoting a single int to double and cast it back. An enum, however, only has a few distinct values. Casting that to double feels like really poor design to me. An enum could also represent bitmasks. Would this survive an intermediate cast to double? I don't know.

Also, this approach would lead to redundant client code:

fluid_synth_chorus_on(synth, 1, true);
fluid_synth_reverb_set_param(synth, 1, FLUID_CHORUS_TYPE, FLUID_CHORUS_MOD_TRIANGLE);

rather than

fluid_synth_chorus_on(synth, 1, FLUID_CHORUS_MOD_TRIANGLE);

I think of it as two separate functions: one that affects the mode of the effect, the other function affecting its effect parameters.

Chorus can be in three different modes: Sinus, Triangle, OFF.

Likewise for reverb: FLUID_REVERB_MOD_ON, FLUID_REVERB_MOD_OFF. If we ever wanted to add another type of reverb it would nicely integrate into this "mode" API function. (We had this discussion in the past, remember: Freeverb vs. FDN reverb)


So, if we can't agree on this, we should fall back to separate setter functions. Without the need for an "all-in-one" setter function:

int fluid_synth_set_chorus_group_nr(fluid_synth_t *synth, int fxunit_idx, int nr);
int fluid_synth_set_chorus_group_level(fluid_synth_t *synth, int fxunit_idx, double level);
int fluid_synth_set_chorus_group_speed(fluid_synth_t *synth, int fxunit_idx, double speed);
int fluid_synth_set_chorus_group_depth(fluid_synth_t *synth, int fxunit_idx, double depth_ms);
int fluid_synth_set_chorus_group_type(fluid_synth_t *synth, int fxunit_idx, int type);

@mawe42
Copy link
Member

mawe42 commented Nov 11, 2020

Keep in mind that fluidsynth is used by many programming languages. There is no guarantee, that there will a concellation where this does not work.

So you are saying that there could be platforms or programming languages where a double/float can not accurately represent smaller (<= 16 bit) integer numbers? That would be very unusual, I think... But proving that something does not exist is hard, so I can understand if you want to be on the absolute safe side here. I guess we should move back to separate getters/setters for both effects then.

Also, this approach would lead to redundant client code:

fluid_synth_chorus_on(synth, 1, true);
fluid_synth_reverb_set_param(synth, 1, FLUID_CHORUS_TYPE, FLUID_CHORUS_MOD_TRIANGLE);

I don't agree that this example contains redundant code. I think it's perfectly fine and much cleaner than the alternative. Consider the case when you want to configure a disabled chorus unit: you would have to ensure to remember the mode for later, when the user actually wants to switch it on. Or consider the case when a user wants to switch a chorus unit off and later on again. Before switching it off, you need to save the mode param somewhere only to be able to set it back to the original value.

@mawe42
Copy link
Member

mawe42 commented Nov 11, 2020

One more comment about the double casting: LADSPA does the same, actually. All values, even control values for things that the plugin internally uses as an integer, are passed as floats. Now you could argue that LADSPA is not the nicest interface, but it's still widely used and I quite like it for it's simplicity.

@derselbst
Copy link
Member

Or consider the case when a user wants to switch a chorus unit off and later on again. Before switching it off, you need to save the mode param somewhere only to be able to set it back to the original value.

Ok.

LADSPA does the same, actually

I don't want to compare to other interfaces, because I don't know the historical background or the motivation of their developers back then.

Here, we are designing a new interface. And I think it's hard to make decisions here, because it's hard to think of a practical or musical sense for this new interface. I have to admit, that I still only see the pure technical need for this API. I'm still not convinced that it makes sense from a musical perspective, sry.

@mawe42
Copy link
Member

mawe42 commented Nov 11, 2020

I don't want to compare to other interfaces, because I don't know the historical background or the motivation of their developers back then.

Understood, and I agree. I just wanted to point out that there is a precedence for "float-only" interfaces. And it is an interface that I myself am very comfortable with, including the "float-only" aspect.

I have to admit, that I still only see the pure technical need for this API.

Yes, I feel the same, I'm not invested in this feature. If it were up to me, then I think we should hide the fact that there are multiple effect instances used internally (or rather: keep it hidden).

But JJC said he really needs the real-time multi-channel mixing feature and also that he needs to be able to control the effect groups separately. And even though I don't understand why and why in this way, I still think if somebody has a real need, then we should be open to change. But every time I think about both of these changes more generally, I switch from "let's do it" to "I'm really not sure" and back again.

Fact is: we are currently changing or deprecating existing APIs that are used by a lot of people, to satisfy a use-case that so far only one person has expressed an interest in (or even understands why there is a need for it). I really hope it's worth it and that JJC will make good and frequent use of this feature :-)

@jjceresa
Copy link
Collaborator Author

Here, we are designing a new interface. And I think it's hard to make decisions here, because it's hard to think of a practical or musical sense for this new interface.

Yes, I feel the same, I'm not invested in this feature.

To me, having independent control fx reverb/chorus parameter on independent MIDI instruments (each on its MIDI channel) has a real musical sense. This is audible in many music.

I have to admit, that I still only see the pure technical need for this API. I'm still not convinced that it makes sense from a musical perspective,sry

we are currently changing or deprecating existing APIs that are used by a lot of people, to satisfy a use-case that so far only one person has expressed an interest in (or even understands why there is a need for it).

The "lot of people" your refer are impossible to number and never gave input when questioned on the mailing list. I hope they are happy when they change the reverb room-size and this impacts all MIDI instruments at the same time !.

I wouldn't wanna be the only person who breaks habits of lot of people. So far I would prefer to abandon this PR.

@mawe42
Copy link
Member

mawe42 commented Nov 12, 2020

To me, having independent control fx reverb/chorus parameter on independent MIDI instruments (each on its MIDI channel) has a real musical sense. This is audible in many music.

I very much agree with this, using different effects on different MIDI instruments is common, normal, makes musical sense. What I don't quite understand is why you need the solution you are proposing. Why the many other solutions that already exist are not suitable. Even solutions already existing in fluidsynth: instead of the internal reverb and chorus, you could simply use multiple external LADSPA effects and control them interactively via the API to achieve the same effect. Then use a "unity gain amp" plugin to mix your buffers any way you like.

we are currently changing or deprecating existing APIs that are used by a lot of people, to satisfy a use-case that so far only one person has expressed an interest in (or even understands why there is a need for it).

The "lot of people" your refer are impossible to number and never gave input when questioned on the mailing list. I hope they are happy when they change the reverb room-size and this impacts all MIDI instruments at the same time !.

Of course, lot of people is just a guess. But I do think that the reverb and chorus APIs are the more well known parts of fluidsynth. And I could probably name a few high profile programs that make use of it.

I wouldn't wanna be the only person who breaks habits of lot of people. So far I would prefer to abandon this PR.

Don't get me wrong... I'm not saying abandon the idea. It's not up to me anyway. I'm just saying I hope your need for this feature is real. That you will use it frequently and that it is not just a "this would make sense" idea. And these thoughts come into my head because I still (i know... I repeat myself) haven't understood where you are coming from. As Windows has only recently gained multi-channel support (thanks to you!), the use-case must be fairly new. So I'm wondering much of it is based in the real world and how much of it is a solution looking for a problem.

@jjceresa
Copy link
Collaborator Author

very much agree with this, using different effects on different MIDI instruments is common, normal, makes musical sense. What I don't quite understand is why you need the solution you are proposing. Why the many other solutions that already exist are not suitable. Even solutions already existing in fluidsynth: instead of the internal reverb and chorus, you could simply use multiple external LADSPA effects and control them interactively via the API to achieve the same effect. Then use a "unity gain amp" plugin to mix your buffers any way you like.

The solution you propose is to get rid of internal functionalities that already exist and replace these by external effects. For now I would prefer application the more simple as possible. This gives me more time as I prefer playing on piano rather then computer keyboard.

As Windows has only recently gained multi-channel support (thanks to you!), the use-case must be fairly new.

This PR has nothing to do with audio multi-channels, and corresponds only to the real need already expressed in the first message.

@mawe42
Copy link
Member

mawe42 commented Nov 12, 2020

This PR has nothing to do with audio multi-channels, and corresponds only to the real need already expressed in the first message.

Sorry, but the first message does not express a need, it simply states what you want to change... not why. The only thing that could be taken as a motivation for this PR is the link to #669. And that issue is about the multi-channel real-time control you proposed. So I assumed that this PR here is simply the ground work for #669.

Ok, so you are saying that you need to control separate fx per MIDI channel even if the real-time multi-channel feature does not make it into FluidSynth. I hadn't understood that until now.

@jjceresa
Copy link
Collaborator Author

So I assumed that this PR here is simply the ground work for #669.

This PR is the ground work for #669 point 2.1 only. #669 point 1 is addressed by PR 672.
For clarity, I should have to split this issue 669 in two. Also 669 issue title (that I cannot update anymore) doesn't reflect point 2. Sorry.

@jjceresa
Copy link
Collaborator Author

So, if we can't agree on this, we should fall back to separate setter functions. Without the need for an "all-in-one" setter function

The all-in-one setter (param enum) function is really a nice idea as it allows to add parameters in the future without requiring new API. For example the reverb unit actually has only a "late stage" but we could add the missing "early stage" controlled by new enum values.

To avoid double/int values casting, I proposed a compromise to split the interface like this:

  • fluid_synth_xxxx_set_param_num( ..,int param, double value)
  • fluid_synth_xxxx_set_param_int(..,int param, int value)).
  • fluid_synth_xxxx_get_param_num( ..,int param, double value)
  • fluid_synth_xxxx_get_param_int(..,int param, int value)).
    Opinions ?.

@mawe42
Copy link
Member

mawe42 commented Nov 13, 2020

Thanks JJC, also a good approach. And similar to the way we currently handle the synth settings.

Even though Tom already said choices by other people are of no concern to us, I think its still interesting to see how other people have approached this problem.

  • LADSPA: uses floats for all parameters, see fluid_ladspa_effect_set_control().
  • VST2(and 3?): also only use floats, but with a twist: here it is always 32-bit float params in the range 0.0 - 1.0.
  • LV2: uses unions containing many different types, including public factory methods to create the correct union instance from a basic type.

But of course they have to use something generic because they can't know what people might want as parameters in their plugins. We know exactly which parameters our two effects accept.

So, my preference would be (in order):

  1. generic setters/getters with floats
  2. JJC new suggestion with typed generic setters/getters
  3. The current style of specific setters/getters and one all-in-one getter/setter.

Options 2. and 3. can easily switch places for me, though. It depends on how likely it is that we will add or change the parameters of the internal effects. If it's not likely, then 3. would switch place with 2.

@derselbst
Copy link
Member

My problem with

fluid_synth_xxxx_set_param_num( ..,int param, double value)
fluid_synth_xxxx_set_param_int(..,int param, int value)).
fluid_synth_xxxx_get_param_num( ..,int param, double value)
fluid_synth_xxxx_get_param_int(..,int param, int value)).

is that people need to look up the enum param and see which typed function to use. I, personally, consider this to be uncomfortable. However, if we really wanted to do this, we could also use a variable argument list:

int fluid_synth_xxxx_set_param(synth, int param, ...);

Depending on param, variable argument number one will be treated as int or double. libtiff actually uses that approach: TIFFGetField()

@jjceresa
Copy link
Collaborator Author

My problem with
fluid_synth_xxxx_set_param_num( ..,int param, double value)
fluid_synth_xxxx_set_param_int(..,int param, int value)).
is that people need to look up the enum param and see which typed function to use.

No because, I forgot to mention that there would be also 2 distincts param enum type.
enum fluid_xxxx_param_num
{
....
};

enum fluid_xxxx_param_int
{
....
};

Anyway, the enum param idea requires the user to look for the function name first then to the typed enum, which is still a bit uncomfortable compared to actual specific function for each param. I think that it worth to:
1)come back using actual specific function for each param which is easier to use (less parameters) and clean API.
2)Internally we can keep the "enum param- all-in-one" setter function (not public ofc), because, (a) it allows to check param values range, (b) it requires little overload when called from public API, (c) It makes quite easy the addition of future specific function for new param.

@derselbst
Copy link
Member

I think that it worth to come back using actual specific function for each param

Ok.

jjceresa and others added 8 commits November 20, 2020 03:48
Internally keep fluid_synth_reverb_set_param(),
fluid_synth_reverb_get_param() as private functions.
Revert using specific API functions for chorus param.
Internally keep fluid_synth_chorus_set_param(),fluid_synth_chorus_get_param() as private functions.
Declare fluid_synth_reverb_get_param(), fluid_synth_chorus_get_param()
static.
Copy link
Member

@derselbst derselbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good now. Waiting for the CI to complete. Thanks!

@jjceresa
Copy link
Collaborator Author

Waiting for the CI to complete. Thanks!

Thanks for reviewing.

@sonarcloud
Copy link

sonarcloud bot commented Nov 22, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 22 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@derselbst derselbst merged commit c9b187b into master Nov 22, 2020
@derselbst derselbst deleted the fx-unit-api branch November 22, 2020 20:02
CartoonFan pushed a commit to CartoonFan/fluidsynth that referenced this pull request Dec 20, 2020
* Properly handle overlapping notes when using fluid_event_note() (FluidSynth#637)

* Fix regression introduced in a893994

Mentioned commit broke fluid_synth_start() when using a DLS soundfont.

* Fix an uninitialized memory access

that could possibly trigger an FPE trap for instruments that use the exclusive class generator

* Update API docs

* Bump to 2.1.4

* Update Doxyfile

* Turn incompatible-pointer-types warning into error

* Fix passing arguments from incompatible pointer type

* Fix a NULL deref in jack driver

* Fix a possible race condition during midi autoconnect

* Fix printf format warnings

* Update Android Asset loader to new callback API

* Update Travis CI (FluidSynth#658)

* update to Ubuntu Focal
* use clang10
* avoid unintentional fallbacks to  default `/usr/bin/c++` compiler
* fix related compiler warnings

* fix NULL permitted for out and fx pointer buffer

Closes FluidSynth#659

* CMakeLists.txt: fix build with gcc 4.8 (FluidSynth#661)

-Werror=incompatible-pointer-types is unconditionally used since version
2.1.4 and 137a14e. This will raise a
build failure when checking for threads on gcc 4.8:

/home/buildroot/autobuild/run/instance-3/output-1/host/bin/arm-none-linux-gnueabi-gcc --sysroot=/home/buildroot/autobuild/run/instance-3/output-1/host/arm-buildroot-linux-gnueabi/sysroot -DTESTKEYWORD=inline  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -Wall -W -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wno-unused-parameter -Wdeclaration-after-statement -Werror=implicit-function-declaration -Werror=incompatible-pointer-types -Wbad-function-cast -Wcast-align   -DNDEBUG -fPIE   -o CMakeFiles/cmTC_98946.dir/CheckIncludeFile.c.o   -c /home/buildroot/autobuild/run/instance-3/output-1/build/fluidsynth-2.1.4/CMakeFiles/CMakeTmp/CheckIncludeFile.c
cc1: error: -Werror=incompatible-pointer-types: no option -Wincompatible-pointer-types

Fixes:
 - http://autobuild.buildroot.org/results/13cbba871db56ef8657a3d13c6ac8e1b4da0d244

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

* TravisCI: add a build for GCC 4.8 (FluidSynth#662)

* Remove unused member variable

* Limiting audio-channels to audio-groups (FluidSynth#663)

* Use a runtime check to detect version of libinstpatch (FluidSynth#666)

It could be that during runtime an older version of libinstpatch is used than the one fluidsynth was compiled against. In this case, libinstpatch will fail to load DLS fonts, because libinstpatch's initialization semantics don't match those compiled into fluidsynth.

* Add a chart about voice mixing and rendering

* Mapping of fx unit output to dry buffers in mix mode. (FluidSynth#668)

Currently, all fx unit output (in mix mode) are mapped to the `first buffer`.
This is not appropriate for synth.audio-groups > 1

This PR allows the mapping of fx output based on `fx unit index` and `synth.audio-groups` value.
This allows us to get the `fx output `mixed to the respective  `buffer` on which a `MIDI channel` is mapped.
For example: with `synth.audio-groups = 3` and  `synth.effect-groups = 3`:
- MIDI chan 0 (dry + fx0) is mapped to buf 0
- MIDI chan 1 (dry + fx1) is mapped to buf 1
- MIDI chan 2 (dry + fx2) is mapped to buf 2

* Add multi channels support for audio driver. (FluidSynth#667)

This PR addresses FluidSynth#665.

1) Add new functions for multi channels support: `fluid_synth_write_float_channels()`, `fluid_synth_write_s16_channels()`
2) `dsound` and `waveout` driver make use of this support. tested on 2 audio devices: 
    - creative SB Live! (6 channels).
    - Realtek: ALC889A (8 channels).

* Bump to 2.1.5

* Add SonarQube static code analysis (FluidSynth#671)

* Add SonarQube and LGTM badges to README

* Remove fluid_event_any_control_change() from public API (FluidSynth#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.

* Remove dead code

* Fix an impossible NULL deref

* Fix a NULL dereference

Access to field 'zone' results in a dereference of a null pointer (loaded from variable 'prev_preset'), if `size` is negative. Problem is: Parameter `size` is `chunk.size` and should be unsigned.

* Fix another NULL dereference

Access to field 'zone' results in a dereference of a null pointer (loaded from variable 'pr'), if size is negative. However, size should be unsigned.

* Remove a FIXME

I don't see any problem calling fluid_channel_init() from within synth context

* Remove a FIXME

I don't see any 'allocation' of preset. And ALL public synth functions have a mutex lock which might potentially block when called from synth context, but only then if the client app pessimizes this situation by extensively calling the synth from outside the synth context.

* Remove a FIXME

I have no clue what it refers to or what it's meant by that.

* Add comment into empty block

* Remove a FIXME

Not aware of any problems caused by the old glib thread API. It will be removed sooner or later anyway.

* Remove a FIXME

* Set the systemd unit target to default.target

fluidsynth.service.in:
The [Install] section [1] in systemd unit declares in which target the
service will be started.
The `multi-user.target` [2] - managed by the systemd _system_ service
manager - is used in the `fluidsynth.service`.
However, as it is a _user_ unit it needs to be pulled in by the
`default.target` [3] instead, which is the main target for the user
session (as started by `user@.service` [4]).

[1] https://www.freedesktop.org/software/systemd/man/systemd.unit.html#%5BInstall%5D%20Section%20Options
[2] https://www.freedesktop.org/software/systemd/man/systemd.special.html#multi-user.target
[3] https://www.freedesktop.org/software/systemd/man/systemd.special.html#default.target1
[4] https://www.freedesktop.org/software/systemd/man/user@.service.html

* 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 FluidSynth#678

* Make winmidi driver multi devices capable. (FluidSynth#677)

* Fix minor bug in windows audio driver (FluidSynth#680)

* Improve error reporting in Waveout and DSound drivers

* Fix Windows build

* Add proper unicode support to Windows error reporting

* Fix build on Windows 9x/ME

Addresses FluidSynth#679

* Promote Controller/Pressure/Bend event functions to 32bits (FluidSynth#670)

* Elaborate on synth.cpu-cores

* Add FluidMixer chart to API docs

* Ensure WaveOut compatibility with Win9X/NT (FluidSynth#687)

* Update and rename README.Android.md to README.md

* Update Android CircleCI build to use latest orb, Android API, Oboe and Cerbero (FluidSynth#690)

This fixes the currently-broken CircleCI build for Android-useable .so files.

Currently the Cerbero build is based off https://github.com/falrm/cerbero until https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/641 is merged and deployed to the GitHub cerbero mirror.

Here is a successful build with the updated CircleCI workflow: https://app.circleci.com/pipelines/github/falrm/fluidsynth-android/31/workflows/0ad3186a-394c-4736-984b-96496b608053/jobs/32

Fixes FluidSynth#688

* Replace FreeBSD 13.0 with 11.4 (FluidSynth#692)

13.0 hasn't been released yet and the CI build keeps failing for long.

* Remove unused variable

* Fix possible uninitialized use of dry_idx variable

* avoid an unlikely race condition

* Add hint message when compiled without getopt support (FluidSynth#697)

* Add getopt support to CMake summary

* Add public API to pin and unpin presets to the sample cache (FluidSynth#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.

* Revert "remove VintageDreamsWaves-v2.sf3"

This reverts commit a36c06c. We've got
explicit permission from Ian Wilson to convert it to SF3.

Addresses FluidSynth#701.

* Updated XSL / styling for fluidsettings.xml

* Cleanup section label markup and rendering

* Use (empty string) for empty default values of str settings

* shell.port is an int setting, not num

* Update periods and period-size with current values from source

* Consistently format all floats

* Better explain currently unused effects-channels

* Update effects-groups description to avoid the word "unit"

* Update ladspa.active description

Use 1 (TRUE) for consistency and mention LADSPA documentation

* As gs is default for midi-bank-select, list it as first option for clarity

* Options seems to be more widely used, so use that instead of Choices

* Remove FLUIDSYNTH_API and FLUID_DEPRECATED macros from documentation

* Remove "References" and "Referenced by" links from doc

They auto generated links are quite long on some functions, making
the documentation harder to read.

* Enable navigation sidebar

* Make larger enums easier to read

* Move doxygen customizations into separate directory

* Restructure devdocs into separate pages

* Change files into groups / modules

* Some additional subgrouping

* Use xsltproc to include settings in API documentation

* Replace all links to fluidsettings.xml with proper \ref's

* Command Shell group for all shell related commands

With subgroups for command handler, shell and server.

* Audio output group

With subgroups Audio Driver and File Renderer

* Logging interface

* MIDI input group

Contains MIDI Driver, MIDI Router, MIDI Player and MIDI Events

* MIDI Seqencer documentation

* Settings documentation

* Miscellaneous group

* SoundFont API

Includes Generators, Modulators, Loader etc

* Add version defines and functions to misc group

* Rename setting reference page name to lowercase, for consistency

* Structure the large synth header into subgroups

Also include version.h and ladspa.h in the Synthesizer group.

* Consistent capitalization of usage guide section names

* Some more brief message abbreviation hints

* Custom doxygen layout to rename modules to API Reference

* Sort groups/modules, briefs and members

* Updated documentation styling

* Remove footer, as it takes away valuable vertical space

* Make sure libxslt is only searched if doxygen is available as well

* Also update the styling of the deprecated list

* Mark settings with callbacks as realtime and output this in the generated docs

* Separate new_* and delete_* functions from the rest

* Sync the static Doxyfile with Doxyfile.cmake

Still missing is the integration of the generated fluidsettings.txt,
as that requires a build script currently not available on the
server generating the public API docs.

* Split doxygen INPUT into separate lines, for easier readability

* Move recent changes into separate file

* Move usage guide pages into separate files in doc/usage

* Move examples into doc/examples directory

* Split HTML_EXTRA_FILEs into separate lines

* Use \image for images and improve quality of FluidMixer image

* Use custom \setting{} alias to link to fluid settings

* Smaller cleanup and reformatting of long lines.

* Add generated fluidsettings.txt for fluidsynth.org API doc build

Probably not the final solution, but works for now.

* Hide nav sync toggle button

* Style improvements for small screens
- hide side nav
- hide search box
- make content full height

* Improve styling of field tables (enum values)

* Document how to revert the styling and layout changes

* Add documentation hints to style guide

* Make top links black on hover, not white

* Add missing group brief descriptions

* Remove debug leftover

* Remove obsolete doxygen config options

* Add intro text to deprecated list

* Use SVG for fluid mixer image

* Workaround for doxygen bug with linebreaks in ALIASES

Using \_linebr is not ideal, as it's an internal command. But that
seems to be the most compatible way to specify line breaks in ALIASES
accross different doxygen versions at the moment.

* GitHub Action to build the API docs from master branch (FluidSynth#704)

Uploads the complete HTML API docs as an artifact called api_docs.zip

* Remove unused command alias and sync Doxyfile.cmake and Doxyfile

* Settings reference style more consistent with rest of reference pages

* Update generated fluidsettings.txt for API doc build on fluidsynth.org

* Fx unit api (FluidSynth#673)

This PR addresses FluidSynth#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.

* Update owner of the SoundFont registered trademark. (FluidSynth#706)

As of the time of this PR, the SoundFont registered trademark is owned by Creative Technology Ltd.
http://tmsearch.uspto.gov/bin/showfield?f=doc&state=4803:rj74xq.2.1
http://assignments.uspto.gov/assignments/q?db=tm&qt=sno&reel=&frame=&sno=74325965

* Handle GS SysEx messages for setting whether a channel is used for rhythm part. (FluidSynth#708)

Some MIDI files that uses the GS standard uses channels other than channel 10 as percussion channel. Currently FluidSynth ignores the messages setting that up, causing notes meant to be played with a drum instrument played with a melodic instrument or vice versa. This patch will partially fix the issue.

Currently the implementation in this patch doesn't cover a specific "quirk" in Roland GS Modules: they seem to remember the last used instrument in the selected mode. This patch simply sets the instrument number to 0 instead.

A test file is attached. If played correctly (with `-o synth.device-id=16`) no out of place drum or piano sounds should be heard.

[wikipedia_MIDI_sample_gstest.mid.gz](https://github.com/FluidSynth/fluidsynth/files/5610727/wikipedia_MIDI_sample_gstest.mid.gz)

* Fix Windows CI

Remove fake pkg-config

* Re-enable unit tests with mingw

and allow them to fail to ensure build artifacts are being published

* Update API doc build to upload to GH pages

* Fix build path in API doc publish step

* Clean existing files in API doc on GH pages

* Fix commit message for deploying API doc

* Also set commit name and email for api doc build commits

* Commit to test API doc build

Will be removed with next commit again.

* Revert "Commit to test API doc build"

This reverts commit fd39f6e.

* Make some strings const (FluidSynth#716)

* Replace g_ascii_strtoll() with FLUID_STRTOL() (FluidSynth#717)

* Elaborate on synth.device-id

* Breaking unit tests for WindowsXP should be fatal

* Update Issue templates to point to GitHub discussion

Co-authored-by: Tom M <tom.mbrt@googlemail.com>
Co-authored-by: jjceresa <jjc_fluid@orange.fr>
Co-authored-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Co-authored-by: jjceresa <32781294+jjceresa@users.noreply.github.com>
Co-authored-by: David Runge <dave@sleepmap.de>
Co-authored-by: KO Myung-Hun <komh@chollian.net>
Co-authored-by: Jon Latané <jonlatane@gmail.com>
Co-authored-by: Marcus Weseloh <marcus@weseloh.cc>
Co-authored-by: Nathan Umali <some1namednate@gmail.com>
Co-authored-by: Chris Xiong <chirs241097@gmail.com>
Co-authored-by: Carlo Bramini <30959007+carlo-bramini@users.noreply.github.com>
junzhuimx pushed a commit to nxp-imx/gst-plugins-bad that referenced this pull request Jun 20, 2023
fluid_synth_set_chorus_on and fluid_synth_set_reverb_on were
deprecated in favor of new funtions where you can also specify
the fx_group the effect would apply.

The behavior of the set_* variants was to apply to all groups
so we pass -1 to the new functions as per documentation.

https://www.fluidsynth.org/api/group__chorus__effect.html#ga3c48310eecdca9cd338799d19f19c32d

and

https://www.fluidsynth.org/api/group__reverb__effect.html#gacb7917564c988cf54f2e35189b509c8e

and the introduction of the change:

FluidSynth/fluidsynth#673

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2718>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants