Commit Graph

1945 Commits

Author SHA1 Message Date
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
jjceresa 458cea0aff Fix incorrect comment (#488)
Normalized value of MIDI sources (before unipolar or bipolar mapping) is always in the range [0..+1], regardless of MIDI event (even for FLUID_MOD_PITCHWHEEL).
2018-12-21 19:54:15 +01:00
Tom M d666515c31
Merge pull request #487 from FluidSynth/min-attenuation
Fix minor bug in lower_boundary_for_attenuation()
2018-12-21 19:53:26 +01:00
jjceresa e9b0f0d24b Add modulators checking at soundfont loading time (#467)
Actually some basic modulators check are done at noteon time (in fluid_voice_add_mod()). That means that we know if a modulator (modx) is invalid only when a MIDI noteon is received and only for a preset modx belongs to. This is not appropriate.

This moves the modulator checking at soundfont loading time. Enhancements are:
1) A better verbose modulator integrity check, for any soundfont loaded at appropriate time.
1.1) All modulators are checked (preset zone (local/global), instrument zone (local/global).
1.2.1) Modulators check are enforced to source src1 and src2  (for non-CC and CC sources) (following SF specs (except for CC LSB) ( see comment in fluid_synth_cc_LOCAL()).
Modulators CC sources checking is coherent with the actual behaviour in fluid_synth_cc_LOCAL() in regard of modulation triggering.
1.2.2) Also, identical modulator in the same zone are detected. 
1.2.3) Any invalid modulator(sources invalid, or modulator identical) is removed at loading time with a warning message displaying the cause and name of the modulators.

2) This fix a bug in noteon, in the case of identical modulators in global preset zone.
Assuming 2 identical modulator (m1 and m2) in a preset global zone, the actual noteon doesn't check this case (the actual code detect identical modulator in all others zones (instrument (local or global), preset(local)) but not preset global).

3) NoteOn is faster.
3.1)There is no more modulators checks at noteon making this more efficient.
3.2) As there are no identical modulator in the same zone, there is no more identity modulator check (i.e local zone against local zone), (i.e global zone against global zone). This result in a faster code and the bug described in (2) is gone.

4) Modulators sources checking as been added in API functions fluid_synth_add_default_mod() and fluid_voice_add_mod(). Please
2018-12-21 19:42:00 +01:00
jjceresa e8dd6ae389 Import modulator source src1 correctly.
- When primary source input (src1) is set to General Controller
  'No Controller', output will be forced to 0.0 at synthesis time
  (see fluid_mod_get_value()).
  That means that the minimum value of the modulator will be always 0.0.
  We need to force amount value to 0 to ensure a correct evaluation of the
  minimum value later (see fluid_voice_get_lower_boundary_for_attenuation()).
2018-12-21 12:19:37 +01:00
derselbst 54a9f29305 remove public comments about internal details 2018-12-20 17:46:10 +01:00
derselbst d0813be1c5 add missing getters for lyric and text midi events
fixes #468
2018-12-20 17:45:10 +01:00
jjceresa b659fd82a5 Import modulator source src2 correctly.
- When secondary source input (src2) is set to General
  Controller 'No Controller', output will be forced to +1.0 at synthesis time
  (see fluid_mod_get_value()).
  That means that this source will behave unipolar only. We need to force the
  unipolar flags to ensure the modulator will behave correctly later in
  fluid_voice_get_lower_boundary_for_attenuation().
2018-12-19 18:12:09 +01:00
derselbst 2cef5b0587 Merge branch 'master' into 2.1-testing 2018-12-19 14:22:40 +01:00
Marcus Weseloh 8da7f11a11 Only retrieve modification time once and remove warning if failed
This change removes the warning message if retrieving the soundfont file
modification time fails in the sample cache loader. The warning made sense
while we didn't have mtime support on all platforms, but after switching
to GLibs g_stat, it's no longer needed.

To reduce the number of calls to fluid_get_file_modification_time and also
get rid of a possible race condition, getting the mtime has been moved to
fluid_samplecache_load.

This change also fixes #483 because it removes the bogus warning messages
if a soundfont was loaded from memory by abusing the filename to store a
pointer.
2018-12-19 14:14:34 +01:00
carlo-bramini c9b8d40fc2 Fourcc support (#482)
Have a direct comparison to the fourcc code rather than searching through chunk ids all the time with chunkid()
2018-12-19 14:09:29 +01:00
jjceresa b7af84fbd5 optimizing fluid_voice_modulate() (#486)
This avoids recalculation of the same generator when several modulators have that generator as destination.
2018-12-19 14:07:34 +01:00
jjceresa 06bca9b894 Fix minor bug in lower_boundary_for_attenuation()
- v variable is renamed min_val for clarity.
- This fix a bug when calculating the possible minimun
  value (min_val) of a modulator. min_val should only
  be dependant of:
  - signs of mapped sources (ie bipolar [-1..+1] or unipolar [0..+1])
  - sign of amount.
  - absolute value of amount.
2018-12-16 07:57:51 +01:00
Tom M ef5739f3ce
Merge pull request #484 from FluidSynth/fix-cross-build
Cross Compilation Fixes
2018-12-15 07:46:53 +01:00
derselbst a9662bf331 fix gcc8 complaining about stringop-truncation 2018-12-14 19:42:08 +01:00
derselbst 4f1f7349db fix cmake not finding make_tables when cross-compiling
Fixes #477.
2018-12-14 17:50:03 +01:00
derselbst cb485806c3 remove unused io.h include 2018-12-14 17:50:03 +01:00
derselbst 73689925da disable clang-tidy for normal builds
It may cause errors when cross compiling. Keep it for profiling builds
though.

Fixes #475.
2018-12-14 17:49:49 +01:00
carlo-bramini 978283bbf0 Add Sdl2 driver (#478) 2018-12-14 16:43:35 +01:00
derselbst dde52c35dd update test_sfont_loading to call fluid_is_soundfont() 2018-12-09 10:35:21 +01:00
derselbst d5ba910f3c document waveout option for audio.driver 2018-12-04 19:36:10 +01:00
jjceresa ba9092ef98 Reducing defsfont loader code (#480) 2018-12-02 17:42:51 +01:00
carlo-bramini cfe2d158f4 Add WaveOut driver (#466) 2018-12-01 15:04:26 +01:00
jjceresa 749ce44753 Implement FDN Reverb (#380)
Supersedes the previous Schroeder-Moorer based "Freeverb".
2018-12-01 14:55:18 +01:00
Tom M b67ecb8b56
Merge pull request #406 from FluidSynth/modenv-convex
Convex shape for modEnv
2018-12-01 14:41:42 +01:00
Tom M b9c253b6d9
Merge pull request #473 from carlo-bramini/winmidi-fixes-1
Minor Winmidi fixes
2018-12-01 13:00:01 +01:00
carlo-bramini ebb383b47f
Force default device if none is selected 2018-11-25 21:20:18 +01:00
carlo-bramini 26325edb22
Optimize device search
Search of the MIDI device can be done before allocating the struct for the driver.
2018-11-25 21:13:25 +01:00
carlo-bramini fa924516f0
Max length of device name is MAXPNAMELEN 2018-11-25 21:10:16 +01:00
carlo-bramini 9aeac6ca6e
Unprepare MIDI buffers
This was missing.
2018-11-25 20:14:18 +01:00
carlo-bramini c57d7fffe8
move fluid_winmidi_callback()
Function fluid_winmidi_callback() has been moved on top of the source and made static.
2018-11-25 20:06:56 +01:00
carlo-bramini cfa8019a53
Remove old fluid_winmidi_input_error() 2018-11-25 20:05:40 +01:00
carlo-bramini cea2645530
Makes fluid_winmidi_input_error() thread-safe
The changes are:
1) made the function static
2) implemented UNICODE support
3) made thread-safe
4) delete unused static buffer
2018-11-25 20:03:12 +01:00
carlo-bramini dea91e7932
Merge pull request #1 from FluidSynth/master
Sync to master
2018-11-25 19:55:57 +01:00
carlo-bramini b8b41f781f Improve chunk id search (#471)
If we move UNKN_ID to the bottom of the enum, in the for() cycle inside chunkid() if the value is not found then the "i" variable will be already UNKN_ID.
2018-11-25 10:02:33 +01:00
jjceresa 36da011191 Avoid redundant dsp parameter updates upon modulation. (#461) 2018-11-25 08:21:51 +01:00
carlo-bramini 98e4046096 Fix handle leak in winmidi driver (#469) 2018-11-23 19:49:20 +01:00
jjceresa 6e9d84f02a Forbid DATA_ENTRY_LSB to modulate (#465)
and document illegal CC modulation
2018-11-18 15:43:03 +01:00
derselbst f52e4fdf39 update documentation for enable-threads 2018-11-18 09:45:28 +01:00
derselbst eb22cfbdbb bump to version 2.0.2 2018-11-18 09:39:09 +01:00
derselbst c8d1ec3841 Merge branch 'recent-docs' into master 2018-11-18 09:12:22 +01:00
carlo-bramini fe92a0a655 Introduce enable-threads option to cmake (#463) 2018-11-18 08:55:52 +01:00
carlo-bramini 29c668683f Improve float calculations (#462)
I tried to check the generated ASM code when WITH_FLOAT macro is defined and when it is undefined. In both cases I noticed that there are some points where the math number are converted from float to double and viceversa. Actually this happens whether the FPU is present or not, perhaps for granting the right precision in digits. I also noticed few points that could be simplified a bit by using integer math, so I also included them.

 * Since fluid_voice_get_actual_key() returns an integer value, the value 60 could be subtracted directly as integer, the code generated looks a bit better.
 * FLUID_NOISE_FLOOR needs to be cast to fluid_real_t to generate a bit more efficient code.
 * DC_OFFSET needs a cast to fluid_real_t to generate a bit more efficient code.
 * "last_fres" and "output_rate" are already fluid_real_t, so they do not need type cast.
 * "chan_add", "par1_add" and "par2_add" are integer types, so they can be added without FPU. "chan_mul", "par1_mul" and "par2_mul" are already fluid_real_t, so they do not need type cast. Instead, the constant 0.5 needs cast to fluid_real_t to be more efficient.
2018-11-16 16:52:34 +01:00
carlo-bramini bd41795263 Remove redundant dependency to readline in fluid_cmd.c
Libreadline is already used into fluid_istream_readline().
In my opinion, there is no need to have this duplicated code, so I would suggest to move the call to add_history() into fluid_sys.h

Closes #460.
2018-11-10 08:25:55 +01:00
carlo-bramini 0bf5c28275 "ready" is unused if ENABLE_MIXER_THREADS=0 2018-11-10 08:09:08 +01:00
Tom M 06bcf8db9f
Fix an incorrectly aligned result when converting between pointer types (#457)
fix alignment issue of idlist
2018-11-10 08:07:30 +01:00
Tom M edc59ee3b5
Merge pull request #458 from FluidSynth/clang-tidying
Fix clang-tidy warnings
2018-11-10 08:01:10 +01:00
Tom M 417dc59ffd
Merge pull request #459 from carlo-bramini/minor-math-fix
Minor math fixes
2018-11-06 18:06:44 +01:00
carlo-bramini d20f6cff66
Use integer math. 2018-11-03 21:07:37 +01:00