Commit graph

1281 commits

Author SHA1 Message Date
Carlo Bramini
10510e486b
[WINDOWS] Fix declaration of GUIDs (try 2). (#868)
Supersedes and closes #867.
2021-04-29 21:03:19 +02:00
Tom M
7b3c2b87f7
Address clang-tidy10 warnings (#860) 2021-04-27 20:28:32 +02:00
Tom M
f69a47081a
Fix MinGW warnings (#861) 2021-04-27 20:27:56 +02:00
Tom M
00806600b6
fluid_compare_func_t const correctness (#858)
fluid_compare_func_t should receive const args.
2021-04-25 13:44:40 +02:00
Carlo Bramini
883ea24960
Remove useless braces. (#855) 2021-04-20 19:40:25 +02:00
Carlo Bramini
52baa228db Remove useless braces.
It is not really clear to me the reason because braces are written into the initialization of channel_mask_speakers[], since their presence causes these messages from the compiler:

fluid_dsound.c:63:5: warning: braces around scalar initializer

In my opinion, it is better to remove them.
2021-04-20 19:40:08 +02:00
Tom M
f55bc7990c
Merge pull request #848 from FluidSynth/crt-free
Make Windows CRT linkage user-selectable
2021-04-16 18:21:25 +02:00
Chris Xiong
5eff4e592e wasapi: correctly render effects if no custom audio processing is used.
I couldn't find a conceivable use case for calling `new_fluid_audio_driver2`
with `fluid_synth_process` as its callback in client code... So I took the
lazy route.

If custom audio processing is indeed used, nothing would be changed by this
patch. It still gets no effects buffer (like the vast majority of other
drivers).
2021-04-16 18:34:11 +08:00
Chris Xiong
0d627c7c0b wasapi: use device period size in shared mode. 2021-04-16 18:21:36 +08:00
Pedro López-Cabanillas
03fb32c979
WASAPI driver reorganization (#839)
Avoid initializing COM in the caller's thread context.

See also: #833
2021-04-14 09:35:35 +02:00
derselbst
ab4eebaf5b Clarify API documentation of fluid_free() 2021-04-13 21:07:37 +02:00
jjceresa
149e08f181
Fix incomplete chorus reverb help strings (#845) 2021-04-12 10:10:03 +02:00
Marcus Weseloh
aa966e4c31
Fix a memory leak if a setting is registered multiple times (#844)
If a string setting is registered multiple times, the previous
default value wasn't freed, leading to a memory leak.
2021-04-11 19:32:43 +02:00
Marcus Weseloh
aad6288955
Merge pull request #823 from FluidSynth/refactor-and-fix-sffile-defsfont
Refactor of sffile and defsfont code, including some bugfixes
2021-04-11 00:25:43 +02:00
jjceresa
c72abf4e0c
Fix typos in fx API documentation (#841) 2021-04-10 22:47:10 +02:00
derselbst
d2754028b4 Merge branch 'master' into refactor-and-fix-sffile-defsfont 2021-04-10 16:30:05 +02:00
Marcus Weseloh
736caf9d21 Add ability to get name of generator from gen index
Used in dump_sfont test utility.
2021-04-10 15:44:13 +02:00
Marcus Weseloh
1b61e1fbd3 Add fluid_list function to find index of data in list
Will be used in the defsfont dump utility.
2021-04-10 15:37:41 +02:00
Tom M
8a39c5aea4
Zone Validation Test (#826)
This is my implementation of a unit test to verify the preset and instrument zone validation behaviour.
2021-04-10 15:33:12 +02:00
Marcus Weseloh
74ccd9cb9d Fix maybe-uninitialized warning in gcc 9.3 2021-04-10 12:06:32 +02:00
Marcus Weseloh
614fcab9cc Fix missing initializer warnings on gcc 9.3 2021-04-10 12:04:05 +02:00
Tom M
ebbaff32bf
Fix typo in --help 2021-04-08 13:30:40 +02:00
Vladimir Davidovich
30c899973d
Fix failure to create the audio driver on macOS (#828)
The deprecated Component Manager for hosting Audio Components is not supported when rebuilding against the 11.00 or later SDK.
Co-authored-by: Vladimir Davidovich <thy.ringo@gmail.com>
2021-04-07 21:32:59 +02:00
Marcus Weseloh
5ebd4d3d26 Speedup SF2 loading by using prepend instead of append on samples
Using prepend both in sffile and defsfont reduces insert complexity
to O(1) and does not affect the final order of the sample list, as
the reversed order of the samples in sffile is reversed again in
defsfont.
2021-03-28 15:00:43 +02:00
Marcus Weseloh
0f8e2c7fde Refactor load_igen and load_pgen
Cleanup of the code structure and fix of the ineffective
check for global zones that are not first in list.

Fixes #813
2021-03-27 22:42:57 +01:00
Marcus Weseloh
dfbef11da0 Remove instsamp hack
This change removes the need for the instsamp hack in instrument
and preset zones. The sampleid and instrument generators are
treated as any other generator and simply passed to the defsfont
import functions. Those read the two generators and use the
index to look up valid samples and instruments.

Both generators are then reset to GEN_UNUSED again, just to make
sure that the rest of FluidSynth doesn't get confused. But that might
not be necessary.
2021-03-27 22:42:57 +01:00
Marcus Weseloh
6ca9b21740 Add more invalid generators for presets and instruments
Presets should not contain sampleid generators, instruments
should not contain instrument generators.
2021-03-27 22:42:57 +01:00
Marcus Weseloh
6b63c80d3d Remove code duplication by re-using enum from fluid_gen.h
We already have an enum for all generator values, so there is
no need to define another list in the loader code.
2021-03-27 22:42:57 +01:00
Marcus Weseloh
c4d38a7125 Fix preset generator validity checks
The previous implementation used 0 as end-of-list sentinel
value. But 0 is also the id of the first generator in the
invalid_preset_gen list. This effectively prevented checks
for invalid preset generators.

Also contains some code cleanup to make the check for invalid
instrument generators similar to invalid preset generators.

Fixes #821
2021-03-27 22:42:57 +01:00
Marcus Weseloh
259aecedf2 Remove unused macros 2021-03-27 22:42:57 +01:00
Marcus Weseloh
84704ea440 Remove Gen_MaxValid macro
Not really necessary, checking against Gen_Last is just as
understandable and removes a macro.
2021-03-27 22:42:57 +01:00
Marcus Weseloh
359af770a3 Rename Gen_Dummy to Gen_last to clarify the purpose 2021-03-27 22:42:57 +01:00
Marcus Weseloh
b61abdd907 Remove unused structs in sffile code 2021-03-27 22:42:57 +01:00
Marcus Weseloh
16d2f43509 Remove unused library, genre and morphology fields
Those fields are not used anywhere, so let's simply remove them.
2021-03-27 22:42:57 +01:00
Tom M
8413c35aca
Fix a regression in fluid_player_stop() (#822)
fluid_player_stop() should not set the STOPPING state, when the player has already finished. Introduced in 676923757c.
2021-03-27 18:35:00 +01:00
Marcus Weseloh
9a4b95a742 Reset the synth after the end, not before the start of a song
This change prevents an unnecessary synth reset before the first
MIDI song is played. It allows changing synth parameters via a
config file without having to unset the player.reset-synth setting.
2021-03-24 20:41:18 +01:00
Tom M
c32faa7b17
Parallelize SF2 loading (#812)
The loading of SF2 samples can be parallelized as well, at least for bigger soundfonts like the Stgiga 4GB monster.

The following test is performed with hot-caches:

`time src/fluidsynth -i -a alsa Stgiga\'s\ HiDef\ Soundfont\ \(2019-05-25\).sf2`

Serial version:
```
real    0m15,460s
user    0m14,163s
sys     0m1,192s
```

Parallelized version proposed by this PR:
```
real    0m5,851s
user    0m14,089s
sys     0m1,194s
```
2021-03-17 19:41:33 +01:00
Tom M
5ae72f8c74
Merge branch 'master' into fluid-sffile-variable-renaming 2021-03-15 21:40:16 +01:00
derselbst
9ea6c75724 Merge branch '2.1.x' into master 2021-03-15 21:27:42 +01:00
Tom M
005719628a
Invalid generators were not removed from zone list (#810)
fluid_list_remove() should receive the beginning of a list, so it can adjust the predecessor of the element to be removed. Otherwise the element would remain in the list, which in this case led to a use-after-free afterwards.
2021-03-15 20:12:51 +01:00
Marcus Weseloh
e3d95cb854 Rename p in load_igen to inst_list 2021-03-14 21:33:46 +01:00
Marcus Weseloh
552b1c4aa6 Rename p in load_imod to inst_list 2021-03-14 21:32:08 +01:00
Marcus Weseloh
dd037c725e Rename p in load_ibag to inst_list 2021-03-14 21:31:27 +01:00
Marcus Weseloh
93a74ff3bd Rename pr in load_ihdr to prev_inst 2021-03-14 21:29:28 +01:00
Marcus Weseloh
c545766ea6 Rename p in load_ihdr to inst 2021-03-14 21:27:40 +01:00
Marcus Weseloh
8df5abf903 Rename p in load_pgen to preset_list 2021-03-14 21:24:25 +01:00
Marcus Weseloh
9e7c108f4c Rename p in load_pmod to preset_list 2021-03-14 21:12:04 +01:00
Marcus Weseloh
f1baa556a6 Rename p in load_pbag to preset_list 2021-03-14 21:11:07 +01:00
Marcus Weseloh
edc99ebc24 Rename p2 in fixup_igen to zone_list 2021-03-14 21:03:10 +01:00
Marcus Weseloh
06145d2139 Rename p2 in fixup_pgen to zone_list 2021-03-14 21:02:29 +01:00