Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package fluidsynth for openSUSE:Factory 
checked in at 2022-03-28 16:58:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fluidsynth (Old)
 and      /work/SRC/openSUSE:Factory/.fluidsynth.new.1900 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fluidsynth"

Mon Mar 28 16:58:43 2022 rev:65 rq:964698 version:2.2.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/fluidsynth/fluidsynth.changes    2022-02-09 
20:38:42.946306470 +0100
+++ /work/SRC/openSUSE:Factory/.fluidsynth.new.1900/fluidsynth.changes  
2022-03-28 16:59:13.340860245 +0200
@@ -1,0 +2,12 @@
+Thu Mar 24 07:06:18 UTC 2022 - Dirk M??ller <dmuel...@suse.com>
+
+- update to 2.2.6:
+  * Undeprecation and minor revisal of the OSS driver
+  * Minor improvements to CoreAudio and CoreMidi drivers
+  * Fix sustained voices being held after ALL_CTRL_OFF
+  * Fix clobbering of PORTAMENTO_CTRL after ALL_CRTL_OFF
+  * Prevent Modulation Envelope from being stuck in decay phase, causing
+    detuned voices and potentially other audible glitches for some soundfonts
+  * Fix a compilation issue with recent glib
+  
+-------------------------------------------------------------------

Old:
----
  fluidsynth-2.2.5.tar.gz

New:
----
  fluidsynth-2.2.6.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fluidsynth.spec ++++++
--- /var/tmp/diff_new_pack.VOKMQt/_old  2022-03-28 16:59:14.076861245 +0200
+++ /var/tmp/diff_new_pack.VOKMQt/_new  2022-03-28 16:59:14.084861256 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package fluidsynth
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,12 +18,12 @@
 
 %define sover   3
 Name:           fluidsynth
-Version:        2.2.5
+Version:        2.2.6
 Release:        0
 Summary:        A Real-Time Software Synthesizer That Uses Soundfont(tm)
 License:        LGPL-2.1-or-later
 Group:          Productivity/Multimedia/Sound/Midi
-URL:            http://www.fluidsynth.org
+URL:            https://www.fluidsynth.orga/
 Source0:        
https://github.com/FluidSynth/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Source1:        %{name}.conf
 Source2:        %{name}.service

++++++ fluidsynth-2.2.5.tar.gz -> fluidsynth-2.2.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/.azure/azure-pipelines-android.yml 
new/fluidsynth-2.2.6/.azure/azure-pipelines-android.yml
--- old/fluidsynth-2.2.5/.azure/azure-pipelines-android.yml     2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/.azure/azure-pipelines-android.yml     2022-03-19 
12:49:15.000000000 +0100
@@ -33,7 +33,7 @@
 variables:
   ICONV_VERSION: '1.16'
   # Use recent master libffi, because 3.3 is broken: checking host system 
type... Invalid configuration `arm-none-linux-eabi': machine `arm-none-linux' 
not recognized
-  FFI_VERSION: 'dd5bd03075149d7cf8441875c1a344e8beb57dde'
+  FFI_VERSION: '3.4.2'
   GETTEXT_VERSION: '0.21'
   #need to switch to meson build system to use a more recent version 
   GLIB_VERSION: '2.58'
@@ -44,8 +44,7 @@
   VORBIS_VERSION: '1.3.7'
   OGG_VERSION: '1.3.5'
   OPUS_VERSION: '1.3.1'
-  # flac 1.3.3 is completely broken: pkgconfig is incorrectly installed, 
compilation failure, etc.; use recent master instead
-  FLAC_VERSION: '27c615706cedd252a206dd77e3910dfa395dcc49'
+  FLAC_VERSION: '1.3.4'
 
   # Android NDK sources and standalone toolchain is put here
   DEV: '$(System.DefaultWorkingDirectory)/android-build-root'
@@ -136,7 +135,7 @@
         wget 
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz
         tar zxf libiconv-${ICONV_VERSION}.tar.gz
 
-        wget -O libffi-${FFI_VERSION}.tar.gz 
https://github.com/libffi/libffi/archive/${FFI_VERSION}.tar.gz
+        wget -O libffi-${FFI_VERSION}.tar.gz 
https://github.com/libffi/libffi/releases/download/v${FFI_VERSION}/libffi-${FFI_VERSION}.tar.gz
         tar zxf libffi-${FFI_VERSION}.tar.gz
 
         wget 
http://ftp.gnu.org/pub/gnu/gettext/gettext-${GETTEXT_VERSION}.tar.gz
@@ -160,7 +159,7 @@
         wget 
https://github.com/xiph/ogg/releases/download/v${OGG_VERSION}/libogg-${OGG_VERSION}.tar.gz
         tar zxf libogg-${OGG_VERSION}.tar.gz
 
-        wget -O flac-${FLAC_VERSION}.tar.gz 
https://github.com/xiph/flac/archive/${FLAC_VERSION}.tar.gz
+        wget -O flac-${FLAC_VERSION}.tar.gz 
https://github.com/xiph/flac/archive/refs/tags/${FLAC_VERSION}.tar.gz
         tar xf flac-${FLAC_VERSION}.tar.gz
 
         wget -O opus-${OPUS_VERSION}.tar.gz 
https://github.com/xiph/opus/archive/refs/tags/v${OPUS_VERSION}.tar.gz
@@ -470,26 +469,10 @@
         sourceDir: 'libogg-$(OGG_VERSION)'
         cmakeArgs: '-DINSTALL_DOCS=0'
 
-    - script: |
-        ls -la libogg-${OGG_VERSION}/build/CMakeFiles/
-        cat libogg-${OGG_VERSION}/build/CMakeFiles/CMakeError.log
-        true
-      displayName: 'Print OGG Cmake Error Log'
-      condition: always()
-      workingDirectory: $(DEV)
-
     - template: cmake-android.yml
       parameters:
         sourceDir: 'libvorbis-$(VORBIS_VERSION)'
 
-    - script: |
-        ls -la libvorbis-${VORBIS_VERSION}/build/CMakeFiles/
-        cat libvorbis-${VORBIS_VERSION}/build/CMakeFiles/CMakeError.log
-        true
-      displayName: 'Print Vorbis Cmake Error Log'
-      condition: always()
-      workingDirectory: $(DEV)
-
     # flac uses c99 macros, but doesnt specify a standard, so we need to do it 
explicitly.
     # On i686, they invoke yasm with -fstack-protector-strong flag... turn off 
asm optimizations.
     - template: cmake-android.yml
@@ -497,42 +480,17 @@
         sourceDir: 'flac-$(FLAC_VERSION)'
         cmakeArgs: '-DCMAKE_C_STANDARD=99 -DCMAKE_C_STANDARD_REQUIRED=1 
-DWITH_ASM=0 -DBUILD_CXXLIBS=0 -DBUILD_PROGRAMS=0 -DBUILD_EXAMPLES=0 
-DBUILD_DOCS=0 -DINSTALL_MANPAGES=0'
 
-    - script: |
-        ls -la flac-${FLAC_VERSION}/build/CMakeFiles/
-        cat flac-${FLAC_VERSION}/build/CMakeFiles/CMakeError.log
-        true
-      displayName: 'Print FLAC Cmake Error Log'
-      condition: always()
-      workingDirectory: $(DEV)
-
     # another broken xiph project that doesn't specify the C standard and 
keeps complaining of you don't have C99
     - template: cmake-android.yml
       parameters:
         sourceDir: 'opus-$(OPUS_VERSION)'
         cmakeArgs: '-DBUILD_PROGRAMS=0 -DOPUS_MAY_HAVE_NEON=1 
-DCMAKE_C_STANDARD=99 -DCMAKE_C_STANDARD_REQUIRED=1'
 
-    - script: |
-        ls -la opus-${OPUS_VERSION}/build/CMakeFiles/
-        cat opus-${OPUS_VERSION}/build/CMakeFiles/CMakeError.log
-        cat opus-${OPUS_VERSION}/build/CMakeFiles/CMakeOutput.log
-        true
-      displayName: 'Print OPUS Cmake Error Log'
-      condition: always()
-      workingDirectory: $(DEV)
-
     - template: cmake-android.yml
       parameters:
         sourceDir: 'libsndfile-$(SNDFILE_VERSION)'
         cmakeArgs: '-DBUILD_PROGRAMS=0 -DBUILD_EXAMPLES=0'
 
-    - script: |
-        ls -la libsndfile-${SNDFILE_VERSION}/build/CMakeFiles/
-        cat libsndfile-${SNDFILE_VERSION}/build/CMakeFiles/CMakeError.log
-        true
-      displayName: 'Print libsndfile Cmake Error Log'
-      condition: always()
-      workingDirectory: $(DEV)
-
     - template: cmake-android.yml
       parameters:
         sourceDir: 'oboe-$(OBOE_VERSION)'
@@ -598,12 +556,11 @@
         sourceDir: '.'
         condition: succeeded()
         installCommand: 'cp *.so ${PREFIX}/lib/'
-      
 
     - script: |
         ls -Rg $(PREFIX)
       displayName: 'Show cross-compiled files in $(PREFIX)'
-      condition: always()
+      condition: or(succeeded(), failed())
 
     - script: |
         set -ex
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/CMakeLists.txt 
new/fluidsynth-2.2.6/CMakeLists.txt
--- old/fluidsynth-2.2.5/CMakeLists.txt 2022-01-23 15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/CMakeLists.txt 2022-03-19 12:49:15.000000000 +0100
@@ -38,7 +38,7 @@
 # FluidSynth package version
 set ( FLUIDSYNTH_VERSION_MAJOR 2 )
 set ( FLUIDSYNTH_VERSION_MINOR 2 )
-set ( FLUIDSYNTH_VERSION_MICRO 5 )
+set ( FLUIDSYNTH_VERSION_MICRO 6 )
 set ( VERSION 
"${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}"
 )
 set ( FLUIDSYNTH_VERSION "\"${VERSION}\"" )
 
@@ -53,7 +53,7 @@
 # This is not exactly the same algorithm as the libtool one, but the results 
are the same.
 set ( LIB_VERSION_CURRENT 3 )
 set ( LIB_VERSION_AGE 0 )
-set ( LIB_VERSION_REVISION 5 )
+set ( LIB_VERSION_REVISION 6 )
 set ( LIB_VERSION_INFO
       "${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/doc/fluidsettings.xml 
new/fluidsynth-2.2.6/doc/fluidsettings.xml
--- old/fluidsynth-2.2.5/doc/fluidsettings.xml  2022-01-23 15:33:33.000000000 
+0100
+++ new/fluidsynth-2.2.6/doc/fluidsettings.xml  2022-03-19 12:49:15.000000000 
+0100
@@ -123,8 +123,7 @@
             <type>bool</type>
             <def>0 (FALSE)</def>
             <desc>
-                When set to 1 (TRUE), samples are loaded to and unloaded from 
memory
-                on demand.
+                When set to 1 (TRUE), samples are loaded to and unloaded from 
memory whenever presets are being selected or unselected for a MIDI channel. 
PROGRAM_CHANGE and PROGRAM_SELECT events are typically responsible for this.
             </desc>
         </setting>
         <setting>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/doc/fluidsynth-v20-devdoc.txt 
new/fluidsynth-2.2.6/doc/fluidsynth-v20-devdoc.txt
--- old/fluidsynth-2.2.5/doc/fluidsynth-v20-devdoc.txt  2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/doc/fluidsynth-v20-devdoc.txt  2022-03-19 
12:49:15.000000000 +0100
@@ -8,8 +8,8 @@
 \author David Henningsson
 \author Tom Moebert
 \author Copyright &copy; 2003-2022 Peter Hanappe, Conrad Berh??rster, Antoine 
Schmitt, Pedro L??pez-Cabanillas, Josh Green, David Henningsson, Tom Moebert
-\version Revision 2.2.5
-\date 2022-01-16
+\version Revision 2.2.6
+\date 2022-03-19
 
 All the source code examples in this document are in the public domain; you 
can use them as you please. This document is licensed under the Creative 
Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this 
license, visit https://creativecommons.org/licenses/by-sa/3.0/ . The FluidSynth 
library is distributed under the GNU Lesser General Public License. A copy of 
the GNU Lesser General Public License is contained in the FluidSynth package; 
if not, visit https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt or write 
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
MA 02110-1301 USA.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/doc/usage/audio_driver.txt 
new/fluidsynth-2.2.6/doc/usage/audio_driver.txt
--- old/fluidsynth-2.2.5/doc/usage/audio_driver.txt     2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/doc/usage/audio_driver.txt     2022-03-19 
12:49:15.000000000 +0100
@@ -16,7 +16,7 @@
 
 - jack: JACK Audio Connection Kit (Linux, Mac OS X, Windows)
 - alsa: Advanced Linux Sound Architecture (Linux)
-- oss: Open Sound System (Linux, Unix)
+- oss: Open Sound System (primarily needed on BSD, rarely also Linux and Unix 
in general)
 - pulseaudio: PulseAudio (Linux, Mac OS X, Windows)
 - coreaudio: Apple CoreAudio (Mac OS X)
 - dsound: Microsoft DirectSound (Windows)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/drivers/fluid_adriver.h 
new/fluidsynth-2.2.6/src/drivers/fluid_adriver.h
--- old/fluidsynth-2.2.5/src/drivers/fluid_adriver.h    2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/drivers/fluid_adriver.h    2022-03-19 
12:49:15.000000000 +0100
@@ -23,6 +23,10 @@
 
 #include "fluidsynth_priv.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * fluid_audio_driver_t
  */
@@ -167,6 +171,8 @@
 void delete_fluid_file_audio_driver(fluid_audio_driver_t *p);
 #endif
 
-
+#ifdef __cplusplus
+}
+#endif
 
 #endif  /* _FLUID_AUDRIVER_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/drivers/fluid_coreaudio.c 
new/fluidsynth-2.2.6/src/drivers/fluid_coreaudio.c
--- old/fluidsynth-2.2.5/src/drivers/fluid_coreaudio.c  2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/drivers/fluid_coreaudio.c  2022-03-19 
12:49:15.000000000 +0100
@@ -27,10 +27,10 @@
 #include "fluid_adriver.h"
 #include "fluid_settings.h"
 
-/* 
+/*
  * !!! Make sure that no include above includes <netinet/tcp.h> !!!
  * It #defines some macros that collide with enum definitions of 
OpenTransportProviders.h, which is included from OSServices.h, included from 
CoreServices.h
- * 
+ *
  * https://trac.macports.org/ticket/36962
  */
 
@@ -73,6 +73,10 @@
 
 #define OK(x) (x == noErr)
 
+#if __MAC_OS_X_VERSION_MAX_ALLOWED < 120000
+#define kAudioObjectPropertyElementMain (kAudioObjectPropertyElementMaster)
+#endif
+
 int
 get_num_outputs(AudioDeviceID deviceID)
 {
@@ -81,7 +85,7 @@
     AudioObjectPropertyAddress pa;
     pa.mSelector = kAudioDevicePropertyStreamConfiguration;
     pa.mScope = kAudioDevicePropertyScopeOutput;
-    pa.mElement = kAudioObjectPropertyElementMaster;
+    pa.mElement = kAudioObjectPropertyElementMain;
 
     if(OK(AudioObjectGetPropertyDataSize(deviceID, &pa, 0, 0, &size)) && size 
> 0)
     {
@@ -118,7 +122,7 @@
     AudioObjectPropertyAddress pa;
     pa.mSelector = kAudioHardwarePropertyDevices;
     pa.mScope = kAudioObjectPropertyScopeWildcard;
-    pa.mElement = kAudioObjectPropertyElementMaster;
+    pa.mElement = kAudioObjectPropertyElementMain;
 
     fluid_settings_register_str(settings, "audio.coreaudio.device", "default", 
0);
     fluid_settings_add_option(settings, "audio.coreaudio.device", "default");
@@ -172,6 +176,14 @@
     OSStatus status;
     UInt32 size;
     int i;
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+    ComponentDescription desc;
+    Component comp;
+#else
+    AudioComponentDescription desc;
+    AudioComponent comp;
+#endif
+    AURenderCallbackStruct render;
 
     dev = FLUID_NEW(fluid_core_audio_driver_t);
 
@@ -187,11 +199,6 @@
     dev->data = data;
 
     // Open the default output unit
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
-    ComponentDescription desc;
-#else
-    AudioComponentDescription desc;
-#endif
     desc.componentType = kAudioUnitType_Output;
     desc.componentSubType = kAudioUnitSubType_HALOutput; 
//kAudioUnitSubType_DefaultOutput;
     desc.componentManufacturer = kAudioUnitManufacturer_Apple;
@@ -199,9 +206,9 @@
     desc.componentFlagsMask = 0;
 
 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
-    Component comp = FindNextComponent(NULL, &desc);
+    comp = FindNextComponent(NULL, &desc);
 #else
-    AudioComponent comp = AudioComponentFindNext(NULL, &desc);
+    comp = AudioComponentFindNext(NULL, &desc);
 #endif
 
     if(comp == NULL)
@@ -223,7 +230,6 @@
     }
 
     // Set up a callback function to generate output
-    AURenderCallbackStruct render;
     render.inputProc = fluid_core_audio_callback;
     render.inputProcRefCon = (void *) dev;
     status = AudioUnitSetProperty(dev->outputUnit,
@@ -250,7 +256,7 @@
         AudioObjectPropertyAddress pa;
         pa.mSelector = kAudioHardwarePropertyDevices;
         pa.mScope = kAudioObjectPropertyScopeWildcard;
-        pa.mElement = kAudioObjectPropertyElementMaster;
+        pa.mElement = kAudioObjectPropertyElementMain;
 
         if(OK(AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &pa, 0, 
0, &size)))
         {
@@ -342,7 +348,7 @@
 
     dev->buffers[0] = FLUID_ARRAY(float, dev->buffer_size);
     dev->buffers[1] = FLUID_ARRAY(float, dev->buffer_size);
-    
+
     if(dev->buffers[0] == NULL || dev->buffers[1] == NULL)
     {
         FLUID_LOG(FLUID_ERR, "Out of memory.");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/drivers/fluid_coremidi.c 
new/fluidsynth-2.2.6/src/drivers/fluid_coremidi.c
--- old/fluidsynth-2.2.5/src/drivers/fluid_coremidi.c   2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/drivers/fluid_coremidi.c   2022-03-19 
12:49:15.000000000 +0100
@@ -49,6 +49,7 @@
 /* End work around */
 
 #include <unistd.h>
+#include <os/log.h>
 #include <CoreServices/CoreServices.h>
 #include <CoreMIDI/MIDIServices.h>
 
@@ -62,6 +63,10 @@
     int autoconn_inputs;
 } fluid_coremidi_driver_t;
 
+static const MIDIClientRef invalid_client = (MIDIClientRef)-1;
+static const MIDIEndpointRef invalid_endpoint = (MIDIEndpointRef)-1;
+static const MIDIPortRef invalid_port = (MIDIPortRef)-1;
+
 void fluid_coremidi_callback(const MIDIPacketList *list, void *p, void *src);
 
 void fluid_coremidi_driver_settings(fluid_settings_t *settings)
@@ -108,6 +113,8 @@
     char *id;
     CFStringRef str_portname;
     CFStringRef str_clientname;
+    OSStatus result;
+    CFStringRef str_input_portname;
 
     /* not much use doing anything */
     if(handler == NULL)
@@ -124,9 +131,10 @@
         return NULL;
     }
 
-    dev->client = 0;
-    dev->endpoint = 0;
-    dev->parser = 0;
+    dev->client = invalid_client;
+    dev->endpoint = invalid_endpoint;
+    dev->input_port = invalid_port;
+    dev->parser = NULL;
     dev->driver.handler = handler;
     dev->driver.data = data;
 
@@ -173,7 +181,7 @@
         FLUID_FREE(portname);    /* -- free port name */
     }
 
-    OSStatus result = MIDIClientCreate(str_clientname, NULL, NULL, &client);
+    result = MIDIClientCreate(str_clientname, NULL, NULL, &client);
     CFRelease(str_clientname);
 
     if(result != noErr)
@@ -194,7 +202,7 @@
         goto error_recovery;
     }
 
-    CFStringRef str_input_portname = CFSTR("input");
+    str_input_portname = CFSTR("input");
     result = MIDIInputPortCreate(client, str_input_portname,
                                  fluid_coremidi_callback,
                                  (void *)dev, &dev->input_port);
@@ -231,17 +239,17 @@
     fluid_coremidi_driver_t *dev = (fluid_coremidi_driver_t *) p;
     fluid_return_if_fail(dev != NULL);
 
-    if(dev->input_port != NULL)
+    if(dev->input_port != invalid_port)
     {
         MIDIPortDispose(dev->input_port);
     }
 
-    if(dev->client != NULL)
+    if(dev->client != invalid_client)
     {
         MIDIClientDispose(dev->client);
     }
 
-    if(dev->endpoint != NULL)
+    if(dev->endpoint != invalid_endpoint)
     {
         MIDIEndpointDispose(dev->endpoint);
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/drivers/fluid_oboe.cpp 
new/fluidsynth-2.2.6/src/drivers/fluid_oboe.cpp
--- old/fluidsynth-2.2.5/src/drivers/fluid_oboe.cpp     2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/drivers/fluid_oboe.cpp     2022-03-19 
12:49:15.000000000 +0100
@@ -25,13 +25,9 @@
  * This file may make use of C++14, because it's required by oboe anyway.
  */
 
-extern "C" {
-
 #include "fluid_adriver.h"
 #include "fluid_settings.h"
 
-} // extern "C"
-
 #if OBOE_SUPPORT
 
 #include <oboe/Oboe.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/drivers/fluid_oss.c 
new/fluidsynth-2.2.6/src/drivers/fluid_oss.c
--- old/fluidsynth-2.2.5/src/drivers/fluid_oss.c        2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/drivers/fluid_oss.c        2022-03-19 
12:49:15.000000000 +0100
@@ -123,17 +123,6 @@
     char *devname = NULL;
     int format;
 
-    FLUID_LOG(FLUID_WARN,
-              "\n\n"
-              "================= OSS audio driver has been deprecated! 
==================\n"
-              "You're using the OSS driver. This driver is old, unmaintained 
and believed\n"
-              "to be unused. If you still need it, pls. let us know by posting 
to our\n"
-              "mailing list at fluid-...@nongnu.org - otherwise this driver 
might be removed\n"
-              "in a future release of FluidSynth!\n"
-              "================= OSS audio driver has been deprecated! 
==================\n"
-              "\n"
-    );
-
     dev = FLUID_NEW(fluid_oss_audio_driver_t);
 
     if(dev == NULL)
@@ -198,24 +187,24 @@
         }
     }
 
-    if(stat(devname, &devstat) == -1)
+    dev->dspfd = open(devname, O_WRONLY, 0);
+
+    if(dev->dspfd == -1)
     {
-        FLUID_LOG(FLUID_ERR, "Device <%s> does not exists", devname);
+        FLUID_LOG(FLUID_ERR, "Device <%s> could not be opened for writing: %s",
+                  devname, g_strerror(errno));
         goto error_recovery;
     }
 
-    if((devstat.st_mode & S_IFCHR) != S_IFCHR)
+    if(fstat(dev->dspfd, &devstat) == -1)
     {
-        FLUID_LOG(FLUID_ERR, "Device <%s> is not a device file", devname);
+        FLUID_LOG(FLUID_ERR, "fstat failed on device <%s>: %s", devname, 
g_strerror(errno));
         goto error_recovery;
     }
 
-    dev->dspfd = open(devname, O_WRONLY, 0);
-
-    if(dev->dspfd == -1)
+    if((devstat.st_mode & S_IFCHR) != S_IFCHR)
     {
-        FLUID_LOG(FLUID_ERR, "Device <%s> could not be opened for writing: %s",
-                  devname, strerror(errno));
+        FLUID_LOG(FLUID_ERR, "Device <%s> is not a device file", devname);
         goto error_recovery;
     }
 
@@ -307,17 +296,6 @@
     int realtime_prio = 0;
     int format;
 
-    FLUID_LOG(FLUID_WARN,
-              "\n\n"
-              "================= OSS audio driver has been deprecated! 
==================\n"
-              "You're using the OSS driver. This driver is old, unmaintained 
and believed\n"
-              "to be unused. If you still need it, pls. let us know by posting 
to our\n"
-              "mailing list at fluid-...@nongnu.org - otherwise this driver 
might be removed\n"
-              "in a future release of FluidSynth!\n"
-              "================= OSS audio driver has been deprecated! 
==================\n"
-              "\n"
-    );
-
     dev = FLUID_NEW(fluid_oss_audio_driver_t);
 
     if(dev == NULL)
@@ -355,28 +333,27 @@
         }
     }
 
-    if(stat(devname, &devstat) == -1)
+    dev->dspfd = open(devname, O_WRONLY, 0);
+
+    if(dev->dspfd == -1)
     {
-        FLUID_LOG(FLUID_ERR, "Device <%s> does not exists", devname);
+        FLUID_LOG(FLUID_ERR, "Device <%s> could not be opened for writing: %s",
+                  devname, g_strerror(errno));
         goto error_recovery;
     }
 
-    if((devstat.st_mode & S_IFCHR) != S_IFCHR)
+    if(fstat(dev->dspfd, &devstat) == -1)
     {
-        FLUID_LOG(FLUID_ERR, "Device <%s> is not a device file", devname);
+        FLUID_LOG(FLUID_ERR, "fstat failed on device <%s>: %s", devname, 
g_strerror(errno));
         goto error_recovery;
     }
 
-    dev->dspfd = open(devname, O_WRONLY, 0);
-
-    if(dev->dspfd == -1)
+    if((devstat.st_mode & S_IFCHR) != S_IFCHR)
     {
-        FLUID_LOG(FLUID_ERR, "Device <%s> could not be opened for writing: %s",
-                  devname, strerror(errno));
+        FLUID_LOG(FLUID_ERR, "Device <%s> is not a device file", devname);
         goto error_recovery;
     }
 
-
     if(fluid_oss_set_queue_size(dev, 16, 2, queuesize, period_size) < 0)
     {
         FLUID_LOG(FLUID_ERR, "Can't set device buffer size");
@@ -426,7 +403,7 @@
         goto error_recovery;
     }
 
-    /* allocate the buffers. FIXME!!! don't use interleaved samples */
+    /* allocate the buffers. */
     dev->buffer = FLUID_MALLOC(dev->buffer_byte_size);
     dev->buffers[0] = FLUID_ARRAY(float, dev->buffer_size);
     dev->buffers[1] = FLUID_ARRAY(float, dev->buffer_size);
@@ -486,6 +463,8 @@
     }
 
     FLUID_FREE(dev->buffer);
+    FLUID_FREE(dev->buffers[0]);
+    FLUID_FREE(dev->buffers[1]);
     FLUID_FREE(dev);
 }
 
@@ -629,17 +608,6 @@
     int realtime_prio = 0;
     char *device = NULL;
 
-    FLUID_LOG(FLUID_WARN,
-              "\n\n"
-              "================= OSS MIDI driver has been deprecated! 
==================\n"
-              "You're using the OSS driver. This driver is old, unmaintained 
and believed\n"
-              "to be unused. If you still need it, pls. let us know by posting 
to our\n"
-              "mailing list at fluid-...@nongnu.org - otherwise this driver 
might be removed\n"
-              "in a future release of FluidSynth!\n"
-              "================= OSS MIDI driver has been deprecated! 
==================\n"
-              "\n"
-    );
-
     /* not much use doing anything */
     if(handler == NULL)
     {
@@ -699,7 +667,7 @@
     if(fcntl(dev->fd, F_SETFL, O_NONBLOCK) == -1)
     {
         FLUID_LOG(FLUID_ERR, "Failed to set OSS MIDI device to non-blocking: 
%s",
-                  strerror(errno));
+                  g_strerror(errno));
         goto error_recovery;
     }
 
@@ -788,7 +756,7 @@
 
         if(n < 0)
         {
-            FLUID_LOG(FLUID_ERR, "Error waiting for MIDI input: %s", 
strerror(errno));
+            FLUID_LOG(FLUID_ERR, "Error waiting for MIDI input: %s", 
g_strerror(errno));
             break;
         }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/rvoice/fluid_adsr_env.h 
new/fluidsynth-2.2.6/src/rvoice/fluid_adsr_env.h
--- old/fluidsynth-2.2.5/src/rvoice/fluid_adsr_env.h    2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/rvoice/fluid_adsr_env.h    2022-03-19 
12:49:15.000000000 +0100
@@ -37,7 +37,7 @@
 };
 
 /* Indices for envelope tables */
-enum fluid_voice_envelope_index_t
+enum fluid_voice_envelope_index
 {
     FLUID_VOICE_ENVDELAY,
     FLUID_VOICE_ENVATTACK,
@@ -49,7 +49,7 @@
     FLUID_VOICE_ENVLAST
 };
 
-typedef enum fluid_voice_envelope_index_t fluid_adsr_env_section_t;
+typedef enum fluid_voice_envelope_index fluid_adsr_env_section_t;
 
 typedef struct _fluid_adsr_env_t fluid_adsr_env_t;
 
@@ -57,14 +57,14 @@
 {
     fluid_env_data_t data[FLUID_VOICE_ENVLAST];
     unsigned int count;
-    int section;
     fluid_real_t val;         /* the current value of the envelope */
+    fluid_adsr_env_section_t section;
 };
 
 /* For performance, all functions are inlined */
 
 static FLUID_INLINE void
-fluid_adsr_env_calc(fluid_adsr_env_t *env, int is_volenv)
+fluid_adsr_env_calc(fluid_adsr_env_t *env)
 {
     fluid_env_data_t *env_data;
     fluid_real_t x;
@@ -76,7 +76,8 @@
     {
         // If we're switching envelope stages from decay to sustain, force the 
value to be the end value of the previous stage
         // Hmm, should this only apply to volenv? It was so before 
refactoring, so keep it for now. [DH]
-        if(env->section == FLUID_VOICE_ENVDECAY && is_volenv)
+        // No, must apply to both, otherwise some voices may sound detuned. 
[TM] (https://github.com/FluidSynth/fluidsynth/issues/1059)
+        if(env->section == FLUID_VOICE_ENVDECAY)
         {
             env->val = env_data->min * env_data->coeff;
         }
@@ -106,8 +107,6 @@
     }
 
     env->val = x;
-
-
 }
 
 /* This one cannot be inlined since it is referenced in
@@ -118,7 +117,7 @@
 fluid_adsr_env_reset(fluid_adsr_env_t *env)
 {
     env->count = 0;
-    env->section = 0;
+    env->section = FLUID_VOICE_ENVDELAY;
     env->val = 0.0f;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/rvoice/fluid_rvoice.c 
new/fluidsynth-2.2.6/src/rvoice/fluid_rvoice.c
--- old/fluidsynth-2.2.5/src/rvoice/fluid_rvoice.c      2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/rvoice/fluid_rvoice.c      2022-03-19 
12:49:15.000000000 +0100
@@ -331,7 +331,7 @@
 
     /******************* vol env **********************/
 
-    fluid_adsr_env_calc(&voice->envlfo.volenv, 1);
+    fluid_adsr_env_calc(&voice->envlfo.volenv);
     fluid_check_fpe("voice_write vol env");
 
     if(fluid_adsr_env_get_section(&voice->envlfo.volenv) == 
FLUID_VOICE_ENVFINISHED)
@@ -341,7 +341,7 @@
 
     /******************* mod env **********************/
 
-    fluid_adsr_env_calc(&voice->envlfo.modenv, 0);
+    fluid_adsr_env_calc(&voice->envlfo.modenv);
     fluid_check_fpe("voice_write mod env");
 
     /******************* lfo **********************/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/synth/fluid_chan.c 
new/fluidsynth-2.2.6/src/synth/fluid_chan.c
--- old/fluidsynth-2.2.5/src/synth/fluid_chan.c 2022-01-23 15:33:33.000000000 
+0100
+++ new/fluidsynth-2.2.6/src/synth/fluid_chan.c 2022-03-19 12:49:15.000000000 
+0100
@@ -162,9 +162,10 @@
             fluid_channel_set_cc(chan, i, 0);
         }
 
-        fluid_channel_clear_portamento(chan); /* Clear PTC receive */
         chan->previous_cc_breath = 0;/* Reset previous breath */
     }
+    /* Unconditionally clear PTC receive (issue #1050) */
+    fluid_channel_clear_portamento(chan);
 
     /* Reset polyphonic key pressure on all voices */
     for(i = 0; i < 128; i++)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/synth/fluid_mod.c 
new/fluidsynth-2.2.6/src/synth/fluid_mod.c
--- old/fluidsynth-2.2.5/src/synth/fluid_mod.c  2022-01-23 15:33:33.000000000 
+0100
+++ new/fluidsynth-2.2.6/src/synth/fluid_mod.c  2022-03-19 12:49:15.000000000 
+0100
@@ -184,6 +184,8 @@
 
     if(mod_flags & FLUID_MOD_CC)
     {
+        val = fluid_channel_get_cc(chan, mod_src);
+
         /* From MIDI Recommended Practice (RP-036) Default Pan Formula:
          * "Since MIDI controller values range from 0 to 127, the exact center
          * of the range, 63.5, cannot be represented. Therefore, the effective
@@ -197,16 +199,20 @@
         if(mod_src == PAN_MSB || mod_src == BALANCE_MSB)
         {
             *range = 126;
-            val = fluid_channel_get_cc(chan, mod_src) - 1;
+            val -= 1;
 
             if(val < 0)
             {
                 val = 0;
             }
         }
-        else
+        else if(mod_src == PORTAMENTO_CTRL)
         {
-            val = fluid_channel_get_cc(chan, mod_src);
+            // an invalid portamento fromkey should be treated as 0 when it's 
actually used for moulating
+            if(!fluid_channel_is_valid_note(val))
+            {
+                val = 0;
+            }
         }
     }
     else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/synth/fluid_synth.c 
new/fluidsynth-2.2.6/src/synth/fluid_synth.c
--- old/fluidsynth-2.2.5/src/synth/fluid_synth.c        2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/synth/fluid_synth.c        2022-03-19 
12:49:15.000000000 +0100
@@ -1557,6 +1557,10 @@
 
 /**
  * Send a MIDI controller event on a MIDI channel.
+ * 
+ * Most CCs are 7-bits wide in FluidSynth. There are a few exceptions which 
may be 14-bits wide as are documented here:
+ * 
https://github.com/FluidSynth/fluidsynth/wiki/FluidFeatures#midi-control-change-implementation-chart
+ * 
  * @param synth FluidSynth instance
  * @param chan MIDI channel number (0 to MIDI channel count - 1)
  * @param num MIDI controller number (0-127)
@@ -1571,6 +1575,8 @@
  *    could be used as CC global for all channels belonging to basic channel 7.
  * - Let a basic channel 0 in mode 3. If MIDI channel 15  is disabled it could 
be used
  *   as CC global for all channels belonging to basic channel 0.
+ * @warning Contrary to the MIDI Standard, this function does not clear LSB 
controllers,
+ * when MSB controllers are received.
  */
 int
 fluid_synth_cc(fluid_synth_t *synth, int chan, int num, int val)
@@ -1794,6 +1800,9 @@
 
     case ALL_CTRL_OFF: /* not allowed to modulate (spec SF 2.01 - 8.2.1) */
         fluid_channel_init_ctrl(chan, 1);
+        // the hold pedals have been reset, we maybe need to release voices
+        fluid_synth_damp_voices_by_sustain_LOCAL(synth, channum);
+        fluid_synth_damp_voices_by_sostenuto_LOCAL(synth, channum);
         fluid_synth_modulate_voices_all_LOCAL(synth, channum);
         break;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/synth/fluid_voice.c 
new/fluidsynth-2.2.6/src/synth/fluid_voice.c
--- old/fluidsynth-2.2.5/src/synth/fluid_voice.c        2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/synth/fluid_voice.c        2022-03-19 
12:49:15.000000000 +0100
@@ -1110,8 +1110,9 @@
     /* Modulation envelope */
     case GEN_MODENVDELAY:               /* SF2.01 section 8.1.3 # 25 */
         fluid_clip(x, -12000.0f, 5000.0f);
+        count = NUM_BUFFERS_DELAY(x);
         fluid_voice_update_modenv(voice, TRUE, FLUID_VOICE_ENVDELAY,
-                                  NUM_BUFFERS_DELAY(x), 0.0f, 0.0f, -1.0f, 
1.0f);
+                                  count, 0.0f, 0.0f, -1.0f, 1.0f);
         break;
 
     case GEN_MODENVATTACK:               /* SF2.01 section 8.1.3 # 26 */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/utils/fluid_settings.h 
new/fluidsynth-2.2.6/src/utils/fluid_settings.h
--- old/fluidsynth-2.2.5/src/utils/fluid_settings.h     2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/utils/fluid_settings.h     2022-03-19 
12:49:15.000000000 +0100
@@ -22,6 +22,10 @@
 #ifndef _FLUID_SETTINGS_H
 #define _FLUID_SETTINGS_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int fluid_settings_add_option(fluid_settings_t *settings, const char *name, 
const char *s);
 int fluid_settings_remove_option(fluid_settings_t *settings, const char *name, 
const char *s);
 
@@ -54,4 +58,8 @@
 
 void* fluid_settings_get_user_data(fluid_settings_t * settings, const char 
*name);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _FLUID_SETTINGS_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/src/utils/fluidsynth_priv.h 
new/fluidsynth-2.2.6/src/utils/fluidsynth_priv.h
--- old/fluidsynth-2.2.5/src/utils/fluidsynth_priv.h    2022-01-23 
15:33:33.000000000 +0100
+++ new/fluidsynth-2.2.6/src/utils/fluidsynth_priv.h    2022-03-19 
12:49:15.000000000 +0100
@@ -48,6 +48,9 @@
 
 #include "fluidsynth.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /***************************************************************
  *
@@ -318,5 +321,8 @@
 #define fluid_return_val_if_fail(cond, val) \
  fluid_return_if_fail(cond) (val)
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _FLUIDSYNTH_PRIV_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/test/CMakeLists.txt 
new/fluidsynth-2.2.6/test/CMakeLists.txt
--- old/fluidsynth-2.2.5/test/CMakeLists.txt    2022-01-23 15:33:33.000000000 
+0100
+++ new/fluidsynth-2.2.6/test/CMakeLists.txt    2022-03-19 12:49:15.000000000 
+0100
@@ -7,6 +7,7 @@
 
 
 ## add unit tests here ##
+ADD_FLUID_TEST(test_synth_reset_cc)
 ADD_FLUID_TEST(test_sample_cache)
 ADD_FLUID_TEST(test_sfont_loading)
 ADD_FLUID_TEST(test_sample_rate_change)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fluidsynth-2.2.5/test/test_synth_reset_cc.c 
new/fluidsynth-2.2.6/test/test_synth_reset_cc.c
--- old/fluidsynth-2.2.5/test/test_synth_reset_cc.c     1970-01-01 
01:00:00.000000000 +0100
+++ new/fluidsynth-2.2.6/test/test_synth_reset_cc.c     2022-03-19 
12:49:15.000000000 +0100
@@ -0,0 +1,146 @@
+
+#include "test.h"
+#include "fluidsynth.h"
+#include "fluidsynth_priv.h"
+#include "fluid_synth.h"
+#include "fluid_midi.h"
+#include "fluid_chan.h"
+#include <string.h>
+
+// render enough samples to go past the release phase of the voice
+enum { SAMPLES=100*1024 };
+
+static void test_sustain(fluid_synth_t* synth, int chan)
+{
+    // depress sustain pedal
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, SUSTAIN_SWITCH, 127));
+    TEST_SUCCESS(fluid_synth_process(synth, SAMPLES, 0, NULL, 0, NULL));
+
+    // hit a note, after some (render-)time has passed
+    TEST_SUCCESS(fluid_synth_noteon(synth, chan, 60, 127));
+
+    // trigger the dsp loop to force rvoice creation
+    TEST_SUCCESS(fluid_synth_process(synth, SAMPLES, 0, NULL, 0, NULL));
+
+    // one voice must be playing by now
+    TEST_ASSERT(fluid_synth_get_active_voice_count(synth) == 2);
+
+    // send noteoff
+    TEST_SUCCESS(fluid_synth_noteoff(synth, chan, 60));
+
+    // voice stays on
+    TEST_SUCCESS(fluid_synth_process(synth, SAMPLES, 0, NULL, 0, NULL));
+    TEST_ASSERT(fluid_synth_get_active_voice_count(synth) == 2);
+
+    // reset controllers
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, ALL_CTRL_OFF, 0));
+
+    // voice should be off now
+    TEST_SUCCESS(fluid_synth_process(synth, SAMPLES, 0, NULL, 0, NULL));
+    TEST_ASSERT(fluid_synth_get_active_voice_count(synth) == 0);
+}
+
+static void test_sostenuto(fluid_synth_t *synth, int chan)
+{
+    // play a note
+    TEST_SUCCESS(fluid_synth_noteon(synth, chan, 60, 127));
+    TEST_SUCCESS(fluid_synth_process(synth, SAMPLES, 0, NULL, 0, NULL));
+
+    // depress sostenuto pedal
+    TEST_ASSERT(fluid_synth_get_active_voice_count(synth) == 2);
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, SOSTENUTO_SWITCH, 127));
+
+    // send noteoff right afterwards
+    TEST_SUCCESS(fluid_synth_noteoff(synth, chan, 60));
+
+    // voice stays on after rendering
+    TEST_SUCCESS(fluid_synth_process(synth, SAMPLES, 0, NULL, 0, NULL));
+    TEST_ASSERT(fluid_synth_get_active_voice_count(synth) == 2);
+
+    // reset controllers
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, ALL_CTRL_OFF, 0));
+
+    // voice should be off now
+    TEST_SUCCESS(fluid_synth_process(synth, SAMPLES, 0, NULL, 0, NULL));
+    TEST_ASSERT(fluid_synth_get_active_voice_count(synth) == 0);
+}
+
+static void test_portamento_fromkey(fluid_synth_t* synth, int chan)
+{
+    int ptc;
+
+    // Portamento is disabled
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, PORTAMENTO_CTRL, 127));
+    TEST_SUCCESS(fluid_synth_get_cc(synth, chan, PORTAMENTO_CTRL, &ptc));
+    TEST_ASSERT(ptc == 127);
+    
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, ALL_CTRL_OFF, 0));
+    
+    // Because PTC is used for modulating, it should be reset to zero
+    TEST_SUCCESS(fluid_synth_get_cc(synth, chan, PORTAMENTO_CTRL, &ptc));
+    TEST_ASSERT(!fluid_channel_is_valid_note(ptc));
+    
+    // Enable Portamento
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, PORTAMENTO_SWITCH, 64));
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, PORTAMENTO_TIME_MSB, 10));
+    TEST_SUCCESS(fluid_synth_get_cc(synth, chan, PORTAMENTO_SWITCH, &ptc));
+    TEST_ASSERT(ptc == 64);
+    TEST_SUCCESS(fluid_synth_get_cc(synth, chan, PORTAMENTO_TIME_MSB, &ptc));
+    TEST_ASSERT(ptc == 10);
+    
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, ALL_CTRL_OFF, 0));
+    TEST_SUCCESS(fluid_synth_get_cc(synth, chan, PORTAMENTO_CTRL, &ptc));
+    TEST_ASSERT(!fluid_channel_is_valid_note(ptc));
+    TEST_SUCCESS(fluid_synth_get_cc(synth, chan, PORTAMENTO_SWITCH, &ptc));
+    TEST_ASSERT(ptc == 0);
+    TEST_SUCCESS(fluid_synth_get_cc(synth, chan, PORTAMENTO_TIME_MSB, &ptc));
+    TEST_ASSERT(ptc == 0);
+    
+    // Portamento is disabled
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, PORTAMENTO_CTRL, 127));
+    TEST_SUCCESS(fluid_synth_get_cc(synth, chan, PORTAMENTO_CTRL, &ptc));
+    TEST_ASSERT(ptc == 127);
+    
+    TEST_SUCCESS(fluid_synth_cc(synth, chan, ALL_CTRL_OFF, 0));
+    
+    // Because PTC is used for modulating, it should be reset to zero
+    TEST_SUCCESS(fluid_synth_get_cc(synth, chan, PORTAMENTO_CTRL, &ptc));
+    TEST_ASSERT(!fluid_channel_is_valid_note(ptc));
+}
+
+// this test should make sure that sample rate changed are handled correctly
+int main(void)
+{
+    int chan;
+    fluid_synth_t *synth;
+    fluid_settings_t *settings = new_fluid_settings();
+    TEST_ASSERT(settings != NULL);
+
+    synth = new_fluid_synth(settings);
+    TEST_ASSERT(synth != NULL);
+    TEST_SUCCESS(fluid_synth_sfload(synth, TEST_SOUNDFONT, 1));
+
+    for (chan = 0; chan < fluid_synth_count_midi_channels(synth); chan++)
+    {
+        const fluid_channel_t* channel = synth->channel[chan];
+        if(channel->channel_type == CHANNEL_TYPE_DRUM)
+        {
+            // drum channels won't spawn voices
+            continue;
+        }
+
+        test_portamento_fromkey(synth, chan);
+        fluid_synth_system_reset(synth);
+        
+        test_sustain(synth, chan);
+        fluid_synth_system_reset(synth);
+        
+        test_sostenuto(synth, chan);
+        fluid_synth_system_reset(synth);
+    }
+    
+    delete_fluid_synth(synth);
+    delete_fluid_settings(settings);
+
+    return EXIT_SUCCESS;
+}

Reply via email to