Commit Graph

2176 Commits

Author SHA1 Message Date
jjceresa af65147cf4 enhance readability 2020-09-17 16:20:28 +02:00
jjceresa ef0f515239 - Rename set_mapping_type enum
- add comments to explains what fluid_handle_set_map() and
  fluid_handle_reset_map() functions do.
2020-09-17 07:11:25 +02:00
jjceresa c51e23e0ee fix bad argument passed to fluid_ostream_printf() 2020-09-16 19:26:05 +02:00
jjceresa 2d4d132214 simplify fluid_handle_chanmap() 2020-09-16 17:34:26 +02:00
jjceresa 3e08cb062c add resetfxmap shell command 2020-09-16 17:21:09 +02:00
jjceresa 5b71358c94 fix comments update 2020-09-16 16:16:47 +02:00
jjceresa 732d24a7a1 rename enum channel_mapping_type 2020-09-16 16:12:13 +02:00
jjceresa 547da169d9 fix typo in comment 2020-09-16 16:09:43 +02:00
jjceresa bfbf65555b split reset mapping API. This lead in 2 APIs
- fluid_synth_mixer_reset_channel_mapping()
-fluid_synth_mixer_reset_fx_mapping()
2020-09-16 16:02:36 +02:00
jjceresa b6c82df6fc reorder mixer mapping shell commands 2020-09-16 12:23:02 +02:00
jjceresa 1c5723aeff simplify shell command fxmap 2020-09-16 12:17:32 +02:00
jjceresa 0f807e63a1 Fix typos in comments 2020-09-16 12:05:50 +02:00
jjceresa ccad46936d fix missing check of result1 2020-09-16 03:36:00 +02:00
jjceresa b2cc3a6341 split set mapping API. This leads to 3 API:
- fluid_synth_mixer_set_chan_to_out_mapping().
- fluid_synth_mixer_set_chan_to_fx_mapping().
- fluid_synth_mixer_set_fx_to_out_mapping().
2020-09-16 02:59:56 +02:00
jjceresa ce472b340c fix typo in command name 2020-09-16 00:05:18 +02:00
jjceresa 10f04c0a6a add fxmap shell command 2020-09-15 19:49:18 +02:00
jjceresa efbddb8d3d Separate getter function. This leads to the API
- fluid_synth_mixer_get_channel_mapping().
- fluid_synth_mixer_get_fx_mapping().
2020-09-15 19:17:03 +02:00
jjceresa 4162bbe516 polish MIDI channel buffers mapping in fluid_voice_init() 2020-09-13 13:52:00 +02:00
jjceresa 226a6de812 consolidate parameters checking
- out_from_chan must be in range [-1..synth->audio_groups[
- fx_from_chan must be in range [-1..synth-effects_groups[
2020-09-13 12:03:37 +02:00
jjceresa 7728ed6102 add comment in fluid_synth_mixer_reset_mapping() 2020-09-13 11:53:56 +02:00
jjceresa dd5b2bc414 return status from fluid_rvoice_eventhandler_push() 2020-09-13 11:43:17 +02:00
jjceresa fc8f48f1c1 fix typos in comments 2020-09-08 21:53:12 +02:00
jjceresa 8546f337f4 declare const fluid_rvoice_mixer_t *mixer 2020-09-08 18:16:21 +02:00
jjceresa 6e6e2fe74b remove useless parentheses 2020-09-08 18:13:18 +02:00
jjceresa 309b0385ae arrange commands strings 2020-09-08 16:48:47 +02:00
jjceresa 7ef467e970 fix correct indentation 2020-09-08 16:20:21 +02:00
jjceresa 54191f44d3 simplify fluid_synth_mixer_set_mapping() 2020-09-08 16:13:38 +02:00
jjceresa 373644908c simplify fluid_synth_mixer_get_mapping() 2020-09-08 15:49:51 +02:00
jjceresa 77abe1a9f5 Consolidate fluid_rvoice_mixer_get_fx_out_mapping()
- check parameter fxunit_idx.
2020-09-08 15:31:33 +02:00
jjceresa 2d7ea7a65b consolidate fluid_rvoice_mixer_set_fx_out_mapping()
- Check parameter fxunit_idx and out_from_fx
- return FLUID_OK or FLUID_FAILED
2020-09-08 15:20:34 +02:00
jjceresa 27a398851e Add function API to set default mapping
- Add fluid_synth_mixer_reset_mapping() in fluid_synth.c.
- Add command resetchanmap in fluid_cmd.c.
2020-09-08 14:48:11 +02:00
jjceresa f62419a367 Add command setchanfxmapout in fluid_cmd.c
- fix a bug in fluid_setchanmap().
- in fluid_synth_mixer_set_mapping check out_from_fx  in range
  [0..synth->audio_group[.
2020-09-08 07:25:08 +02:00
jjceresa 94ad3d6750 Add command setchanmapfx 2020-09-08 05:35:02 +02:00
jjceresa 0fa451f46b Add function API fluid_synth_mixer_set_mapping()
- Add fluid_synth_mixer_set_mapping() in fluid_synth.c.
- Add setter function fluid_rvoice_mixer_set_fx_out_mapping() in
  fluid_rvoice_mixer.c.
- Add command sechanmapout in fluid_cmd.c.
2020-09-08 05:15:54 +02:00
jjceresa ac62a8a41c Add function API fluid_synth_mixer_get_mapping()
- Add fluid_synth_mixer_get_mapping() in fluid_synth.c.
- Add getter function fluid_rvoice_mixer_get_fx_out_mapping() in
  fluid_rvoice_mixer.c.
- Add command chanmap in fluid_cmd.c.
2020-09-08 02:05:41 +02:00
jjceresa 7fca968b6b Add fx unit output mapping to audio dry output 2020-09-08 00:09:04 +02:00
jjceresa 13c486231b Add MIDI channel mapping to fx unit input 2020-09-07 23:29:26 +02:00
jjceresa 0b0e5dd2a1 Add MIDI channel mapping to audio dry output 2020-09-07 23:04:06 +02:00
Tom M 565002f34f
Add SonarQube static code analysis (#671) 2020-09-06 23:43:18 +02:00
derselbst 23b270c08b Merge branch '2.1.x' into master 2020-09-06 14:54:26 +02:00
derselbst ff7c72c80f Bump to 2.1.5 2020-09-06 11:52:39 +02:00
jjceresa f94cee0a50
Add multi channels support for audio driver. (#667)
This PR addresses #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).
2020-09-02 21:31:50 +02:00
jjceresa 57af8803f2
Mapping of fx unit output to dry buffers in mix mode. (#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
2020-09-02 21:10:31 +02:00
jjceresa 7834c4eb62 Add a chart about voice mixing and rendering 2020-09-02 20:54:05 +02:00
Tom M aea6644324
Use a runtime check to detect version of libinstpatch (#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.
2020-08-31 20:35:21 +02:00
jjceresa c76949e6d3
Limiting audio-channels to audio-groups (#663) 2020-08-22 13:24:41 +02:00
derselbst 0acfd81e28 Merge branch '2.1.x' into master 2020-08-17 18:24:45 +02:00
derselbst fa6f9c3570 Remove unused member variable 2020-08-17 18:23:43 +02:00
Tom M 43078d6b7b
TravisCI: add a build for GCC 4.8 (#662) 2020-08-17 18:19:15 +02:00
Fabrice Fontaine 0cccf83a38 CMakeLists.txt: fix build with gcc 4.8 (#661)
-Werror=incompatible-pointer-types is unconditionally used since version
2.1.4 and 137a14e106. 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>
2020-08-17 18:01:39 +02:00