[Demudi-commits] r1057 - in linuxsampler/trunk/debian: . patches

Free Ekanayaka free-guest at alioth.debian.org
Mon Feb 5 10:30:38 CET 2007


Author: free-guest
Date: 2007-02-05 10:30:35 +0100 (Mon, 05 Feb 2007)
New Revision: 1057

Modified:
   linuxsampler/trunk/debian/changelog
   linuxsampler/trunk/debian/patches/10_cvs-snapshot.dpatch
Log:
New snapshot

Modified: linuxsampler/trunk/debian/changelog
===================================================================
--- linuxsampler/trunk/debian/changelog	2007-02-03 10:48:01 UTC (rev 1056)
+++ linuxsampler/trunk/debian/changelog	2007-02-05 09:30:35 UTC (rev 1057)
@@ -1,8 +1,8 @@
-linuxsampler (0.4.0-1+cvs070120) UNRELEASED; urgency=low
+linuxsampler (0.4.0-1+cvs070205) UNRELEASED; urgency=low
 
   * New cvs snapshot
 
- -- Free Ekanayaka <free at 64studio.com>  Sat, 20 Jan 2007 13:10:22 +0100
+ -- Free Ekanayaka <free at 64studio.com>  Mon,  5 Feb 2007 10:35:43 +0100
 
 linuxsampler (0.4.0-1) UNRELEASED; urgency=low
 

Modified: linuxsampler/trunk/debian/patches/10_cvs-snapshot.dpatch
===================================================================
--- linuxsampler/trunk/debian/patches/10_cvs-snapshot.dpatch	2007-02-03 10:48:01 UTC (rev 1056)
+++ linuxsampler/trunk/debian/patches/10_cvs-snapshot.dpatch	2007-02-05 09:30:35 UTC (rev 1057)
@@ -24,10 +24,10 @@
 
 @DPATCH@
 Index: linuxsampler/ChangeLog
-diff -u linuxsampler/ChangeLog:1.59 linuxsampler/ChangeLog:1.67
---- linuxsampler/ChangeLog:1.59	Fri Nov 24 17:43:08 2006
-+++ linuxsampler/ChangeLog	Fri Dec 29 20:06:12 2006
-@@ -1,3 +1,44 @@
+diff -u linuxsampler/ChangeLog:1.59 linuxsampler/ChangeLog:1.69
+--- linuxsampler/ChangeLog:1.59	Fri Nov 24 18:43:08 2006
++++ linuxsampler/ChangeLog	Sat Feb  3 21:46:43 2007
+@@ -1,3 +1,51 @@
 +Version CVS HEAD (?)
 +
 +  * general changes:
@@ -65,17 +65,37 @@
 +    - if a filter is used and EG2 finishes before EG1, let the voice
 +      die when EG2 has finished (this fixes a problem with clicks and
 +      voice starvation for some gigs)
++    - playback is no longer disabled during instrument loading
++    - all notes playing on a channel that changes its instrument keep
++      playing with the old instrument until they get a note off
++      command
++    - EG fix: a release value of zero could cause noises or crash
 +
 +  * Bug fixes:
 +    - fixed crash occurring on certain LSCP scripts (Bug 39)
++    - another thread safety fix for lscp "load engine" and "set
++      channel audio output device"
 +
  Version 0.4.0 (24 November 2006)
  
    * packaging changes:
+Index: linuxsampler/Makefile.cvs
+diff -u linuxsampler/Makefile.cvs:1.4 linuxsampler/Makefile.cvs:1.5
+--- linuxsampler/Makefile.cvs:1.4	Tue Jul 19 17:43:40 2005
++++ linuxsampler/Makefile.cvs	Tue Jan 23 21:03:22 2007
+@@ -3,7 +3,7 @@
+ all: configure
+ 
+ configure: configure.in
+-	@aclocal
++	@aclocal -I m4
+ 	@libtoolize --force --copy
+ 	@autoheader
+ 	@automake --add-missing --copy
 Index: linuxsampler/README
 diff -u linuxsampler/README:1.9 linuxsampler/README:1.10
---- linuxsampler/README:1.9	Fri Nov 24 17:43:08 2006
-+++ linuxsampler/README	Wed Jan  3 17:49:44 2007
+--- linuxsampler/README:1.9	Fri Nov 24 18:43:08 2006
++++ linuxsampler/README	Wed Jan  3 18:49:44 2007
 @@ -2,7 +2,7 @@
  
  Copyright (C) 2003, 2004 by Benno Senoner (benno at gardena.net)
@@ -87,8 +107,8 @@
  License
 Index: linuxsampler/configure.in
 diff -u linuxsampler/configure.in:1.54 linuxsampler/configure.in:1.57
---- linuxsampler/configure.in:1.54	Fri Nov 24 17:43:08 2006
-+++ linuxsampler/configure.in	Sun Jan  7 15:52:36 2007
+--- linuxsampler/configure.in:1.54	Fri Nov 24 18:43:08 2006
++++ linuxsampler/configure.in	Sun Jan  7 16:52:36 2007
 @@ -5,7 +5,7 @@
  
  LINUXSAMPLER_RELEASE_MAJOR=0
@@ -166,8 +186,8 @@
  echo "# Unsigned Triangular Oscillator Algorithm: ${config_unsigned_triang_algo}"
 Index: linuxsampler/linuxsampler.spec.in
 diff -u linuxsampler/linuxsampler.spec.in:1.5 linuxsampler/linuxsampler.spec.in:1.6
---- linuxsampler/linuxsampler.spec.in:1.5	Fri Nov 24 17:43:08 2006
-+++ linuxsampler/linuxsampler.spec.in	Sat Jan  6 16:54:03 2007
+--- linuxsampler/linuxsampler.spec.in:1.5	Fri Nov 24 18:43:08 2006
++++ linuxsampler/linuxsampler.spec.in	Sat Jan  6 17:54:03 2007
 @@ -71,11 +71,12 @@
  %doc AUTHORS COPYING ChangeLog README
  %{prefix}/bin/linuxsampler
@@ -184,8 +204,8 @@
  %{prefix}/lib/pkgconfig/linuxsampler.pc
 Index: linuxsampler/Documentation/lscp.xml
 diff -u linuxsampler/Documentation/lscp.xml:1.22 linuxsampler/Documentation/lscp.xml:1.31
---- linuxsampler/Documentation/lscp.xml:1.22	Fri Nov 24 17:43:08 2006
-+++ linuxsampler/Documentation/lscp.xml	Sun Jan 14 17:31:48 2007
+--- linuxsampler/Documentation/lscp.xml:1.22	Fri Nov 24 18:43:08 2006
++++ linuxsampler/Documentation/lscp.xml	Sun Jan 14 18:31:48 2007
 @@ -11,9 +11,12 @@
  <?rfc symrefs="yes" ?>
  <?rfc sortrefs="yes"?>
@@ -2438,8 +2458,8 @@
 diff -u linuxsampler/debian/rules:1.4 linuxsampler/debian/rules:1.5
 Index: linuxsampler/osx/version.h
 diff -u linuxsampler/osx/version.h:1.11 linuxsampler/osx/version.h:1.12
---- linuxsampler/osx/version.h:1.11	Wed Jun 28 19:32:20 2006
-+++ linuxsampler/osx/version.h	Fri Dec 29 20:06:13 2006
+--- linuxsampler/osx/version.h:1.11	Wed Jun 28 21:32:20 2006
++++ linuxsampler/osx/version.h	Fri Dec 29 21:06:13 2006
 @@ -32,6 +32,9 @@
  /* Define to 1 to force filter usage. */
  /* #undef CONFIG_FORCE_FILTER */
@@ -2452,8 +2472,8 @@
  
 Index: linuxsampler/src/Sampler.cpp
 diff -u linuxsampler/src/Sampler.cpp:1.29 linuxsampler/src/Sampler.cpp:1.32
---- linuxsampler/src/Sampler.cpp:1.29	Wed Jul  5 17:53:22 2006
-+++ linuxsampler/src/Sampler.cpp	Wed Jan  3 17:49:44 2007
+--- linuxsampler/src/Sampler.cpp:1.29	Wed Jul  5 19:53:22 2006
++++ linuxsampler/src/Sampler.cpp	Wed Jan  3 18:49:44 2007
 @@ -3,20 +3,20 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -2546,8 +2566,8 @@
  } // namespace LinuxSampler
 Index: linuxsampler/src/linuxsampler.cpp
 diff -u linuxsampler/src/linuxsampler.cpp:1.35 linuxsampler/src/linuxsampler.cpp:1.36
---- linuxsampler/src/linuxsampler.cpp:1.35	Wed Jul  5 17:53:22 2006
-+++ linuxsampler/src/linuxsampler.cpp	Sun Jan  7 15:52:36 2007
+--- linuxsampler/src/linuxsampler.cpp:1.35	Wed Jul  5 19:53:22 2006
++++ linuxsampler/src/linuxsampler.cpp	Sun Jan  7 16:52:36 2007
 @@ -2,8 +2,8 @@
   *                                                                         *
   *   LinuxSampler - modular, streaming capable sampler                     *
@@ -2572,8 +2592,8 @@
          // detect and print system / CPU specific features
 Index: linuxsampler/src/common/Makefile.am
 diff -u linuxsampler/src/common/Makefile.am:1.16 linuxsampler/src/common/Makefile.am:1.17
---- linuxsampler/src/common/Makefile.am:1.16	Wed Jun 28 19:32:21 2006
-+++ linuxsampler/src/common/Makefile.am	Fri Dec 29 20:06:13 2006
+--- linuxsampler/src/common/Makefile.am:1.16	Wed Jun 28 21:32:21 2006
++++ linuxsampler/src/common/Makefile.am	Fri Dec 29 21:06:13 2006
 @@ -18,6 +18,7 @@
  	Condition.cpp Condition.h \
  	ConditionServer.cpp ConditionServer.h \
@@ -2584,8 +2604,8 @@
  	Pool.h \
 Index: linuxsampler/src/common/ResourceManager.h
 diff -u linuxsampler/src/common/ResourceManager.h:1.7 linuxsampler/src/common/ResourceManager.h:1.10
---- linuxsampler/src/common/ResourceManager.h:1.7	Sat Oct 21 14:50:32 2006
-+++ linuxsampler/src/common/ResourceManager.h	Wed Dec  6 22:28:16 2006
+--- linuxsampler/src/common/ResourceManager.h:1.7	Sat Oct 21 16:50:32 2006
++++ linuxsampler/src/common/ResourceManager.h	Wed Dec  6 23:28:16 2006
 @@ -26,10 +26,19 @@
  
  #include <set>
@@ -3048,8 +3068,8 @@
  #endif // __RESOURCE_MANAGER__
 Index: linuxsampler/src/common/RingBuffer.h
 diff -u linuxsampler/src/common/RingBuffer.h:1.6 linuxsampler/src/common/RingBuffer.h:1.7
---- linuxsampler/src/common/RingBuffer.h:1.6	Wed Feb  9 01:22:17 2005
-+++ linuxsampler/src/common/RingBuffer.h	Wed Dec  6 22:28:16 2006
+--- linuxsampler/src/common/RingBuffer.h:1.6	Wed Feb  9 02:22:17 2005
++++ linuxsampler/src/common/RingBuffer.h	Wed Dec  6 23:28:16 2006
 @@ -3,6 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -3251,10 +3271,27 @@
 +}
  
  #endif /* RINGBUFFER_H */
+Index: linuxsampler/src/common/SynchronizedConfig.h
+diff -u linuxsampler/src/common/SynchronizedConfig.h:1.2 linuxsampler/src/common/SynchronizedConfig.h:1.3
+--- linuxsampler/src/common/SynchronizedConfig.h:1.2	Sun Mar 19 17:38:22 2006
++++ linuxsampler/src/common/SynchronizedConfig.h	Sat Feb  3 16:32:59 2007
+@@ -40,9 +40,9 @@
+      * safe to modify the other instance.
+      *
+      * The real time threads need one Reader object each to access the
+-     * confuration data. This object must be created outside the real
+-     * time thread. The Lock() function returns a reference to the
+-     * data to be read, and Unlock() must be called when finished
++     * configuration data. This object must be created outside the
++     * real time thread. The Lock() function returns a reference to
++     * the data to be read, and Unlock() must be called when finished
+      * reading the data. (Neither Lock nor Unlock will block the real
+      * time thread, or use any system calls.)
+      */
 Index: linuxsampler/src/common/global.cpp
 diff -u /dev/null linuxsampler/src/common/global.cpp:1.1
---- /dev/null	Sat Jan 20 12:11:30 2007
-+++ linuxsampler/src/common/global.cpp	Fri Dec 29 20:06:13 2006
+--- /dev/null	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/common/global.cpp	Fri Dec 29 21:06:13 2006
 @@ -0,0 +1,36 @@
 +/***************************************************************************
 + *                                                                         *
@@ -3294,8 +3331,8 @@
 +double GLOBAL_VOLUME = CONFIG_GLOBAL_ATTENUATION_DEFAULT;
 Index: linuxsampler/src/common/global.h
 diff -u linuxsampler/src/common/global.h:1.12 linuxsampler/src/common/global.h:1.13
---- linuxsampler/src/common/global.h:1.12	Wed Jun 28 19:32:21 2006
-+++ linuxsampler/src/common/global.h	Fri Dec 29 20:06:13 2006
+--- linuxsampler/src/common/global.h:1.12	Wed Jun 28 21:32:21 2006
++++ linuxsampler/src/common/global.h	Fri Dec 29 21:06:13 2006
 @@ -135,4 +135,6 @@
  	return ss.str();
  }
@@ -3304,18 +3341,18 @@
 +
  #endif // __LS_GLOBAL_H__
 Index: linuxsampler/src/drivers/audio/AudioChannel.cpp
-diff -u linuxsampler/src/drivers/audio/AudioChannel.cpp:1.11 linuxsampler/src/drivers/audio/AudioChannel.cpp:1.13
---- linuxsampler/src/drivers/audio/AudioChannel.cpp:1.11	Wed Feb  9 01:22:18 2005
-+++ linuxsampler/src/drivers/audio/AudioChannel.cpp	Thu Dec 28 18:05:14 2006
+diff -u linuxsampler/src/drivers/audio/AudioChannel.cpp:1.11 linuxsampler/src/drivers/audio/AudioChannel.cpp:1.14
+--- linuxsampler/src/drivers/audio/AudioChannel.cpp:1.11	Wed Feb  9 02:22:18 2005
++++ linuxsampler/src/drivers/audio/AudioChannel.cpp	Tue Jan 23 21:03:22 2007
 @@ -3,6 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
-+ *   Copyright (C) 2005, 2006 Christian Schoenebeck                        *
++ *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *
   *                                                                         *
   *   This program is free software; you can redistribute it and/or modify  *
   *   it under the terms of the GNU General Public License as published by  *
-@@ -104,6 +105,36 @@
+@@ -104,6 +105,76 @@
          if (!UsesExternalBuffer) free(pBuffer);
      }
  
@@ -3323,6 +3360,9 @@
 +     * Copies audio data (unmodified) from this AudioChannel to the given
 +     * destination AudioChannel.
 +     *
++     * @e Caution: This method will overwrite the content in the destination
++     * channel buffer.
++     *
 +     * @param pDst    - destination channel
 +     * @param Samples - amount of sample points to be copied
 +     */
@@ -3335,6 +3375,9 @@
 +     * AudioChannel and applies the given volume coefficient to the
 +     * destination audio signal.
 +     *
++     * @e Caution: This method will overwrite the content in the destination
++     * channel buffer.
++     *
 +     * @param pDst    - destination channel
 +     * @param Samples - amount of sample points to be copied
 +     * @param fLevel  - volume coefficient to be applied
@@ -3349,13 +3392,56 @@
 +        }
 +    }
 +
++    /**
++     * Copies audio data (unmodified) from this AudioChannel and mixes it to the
++     * given destination AudioChannel.
++     *
++     * @param pDst    - destination channel
++     * @param Samples - amount of sample points to be mixed over
++     */
++    void AudioChannel::MixTo(AudioChannel* pDst, const uint Samples) {
++        //TODO: there's probably a more efficient way to do this ...
++        float* pSrcBuf = Buffer();
++        float* pDstBuf = pDst->Buffer();
++        for (int i = 0; i < Samples; i++)
++            pDstBuf[i] += pSrcBuf[i];
++    }
++
++    /**
++     * Copies audio data from this AudioChannel, applies the given volume
++     * coefficient to the audio signal and mixes it to the given destination
++     * channel.
++     *
++     * @param pDst    - destination channel
++     * @param Samples - amount of sample points to be mixed over
++     * @param fLevel  - volume coefficient to be applied
++     */
++    void AudioChannel::MixTo(AudioChannel* pDst, const uint Samples, const float fLevel) {
++        if (fLevel == 1.0f) MixTo(pDst, Samples);
++        else {
++            float* pSrcBuf = Buffer();
++            float* pDstBuf = pDst->Buffer();
++            for (int i = 0; i < Samples; i++)
++                pDstBuf[i] += pSrcBuf[i] * fLevel;
++        }
++    }
++
      std::map<String,DeviceRuntimeParameter*> AudioChannel::ChannelParameters() {
          return Parameters;
      }
 Index: linuxsampler/src/drivers/audio/AudioChannel.h
-diff -u linuxsampler/src/drivers/audio/AudioChannel.h:1.7 linuxsampler/src/drivers/audio/AudioChannel.h:1.8
---- linuxsampler/src/drivers/audio/AudioChannel.h:1.7	Tue Jun 27 22:57:36 2006
-+++ linuxsampler/src/drivers/audio/AudioChannel.h	Wed Dec 27 16:17:07 2006
+diff -u linuxsampler/src/drivers/audio/AudioChannel.h:1.7 linuxsampler/src/drivers/audio/AudioChannel.h:1.9
+--- linuxsampler/src/drivers/audio/AudioChannel.h:1.7	Wed Jun 28 00:57:36 2006
++++ linuxsampler/src/drivers/audio/AudioChannel.h	Tue Jan 23 21:03:22 2007
+@@ -3,7 +3,7 @@
+  *   LinuxSampler - modular, streaming capable sampler                     *
+  *                                                                         *
+  *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
+- *   Copyright (C) 2005, 2006 Christian Schoenebeck                        *
++ *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *
+  *                                                                         *
+  *   This program is free software; you can redistribute it and/or modify  *
+  *   it under the terms of the GNU General Public License as published by  *
 @@ -37,17 +37,17 @@
       *
       * This class is used for routing audio signals between arbitrary sources
@@ -3378,19 +3464,21 @@
       * So in the last example, when writing to 'mix_chan' the signal will
       * actually be mixed to the 'mono_chan' channel, so this is an easy way
       * to downmix a signal source which has more audio channels than the
-@@ -90,6 +90,8 @@
+@@ -90,6 +90,10 @@
              inline float*        Buffer()     { return pBuffer;      } ///< Audio signal buffer
              inline AudioChannel* MixChannel() { return pMixChannel;  } ///< In case this channel is a mix channel, then it will return a pointer to the real channel this channel refers to, NULL otherwise.
              inline void          Clear()      { memset(pBuffer, 0, uiBufferSize * sizeof(float)); } ///< Reset audio buffer with silence
 +            void CopyTo(AudioChannel* pDst, const uint Samples);
 +            void CopyTo(AudioChannel* pDst, const uint Samples, const float fLevel);
++            void MixTo(AudioChannel* pDst, const uint Samples);
++            void MixTo(AudioChannel* pDst, const uint Samples, const float fLevel);
              std::map<String,DeviceRuntimeParameter*> ChannelParameters();
  
              // constructors / destructor
 Index: linuxsampler/src/drivers/audio/AudioOutputDevice.cpp
 diff -u linuxsampler/src/drivers/audio/AudioOutputDevice.cpp:1.19 linuxsampler/src/drivers/audio/AudioOutputDevice.cpp:1.20
---- linuxsampler/src/drivers/audio/AudioOutputDevice.cpp:1.19	Tue Jun 27 22:57:36 2006
-+++ linuxsampler/src/drivers/audio/AudioOutputDevice.cpp	Wed Dec 27 16:17:07 2006
+--- linuxsampler/src/drivers/audio/AudioOutputDevice.cpp:1.19	Wed Jun 28 00:57:36 2006
++++ linuxsampler/src/drivers/audio/AudioOutputDevice.cpp	Wed Dec 27 17:17:07 2006
 @@ -233,6 +233,10 @@
          }
      }
@@ -3404,8 +3492,8 @@
      }
 Index: linuxsampler/src/drivers/audio/AudioOutputDevice.h
 diff -u linuxsampler/src/drivers/audio/AudioOutputDevice.h:1.18 linuxsampler/src/drivers/audio/AudioOutputDevice.h:1.19
---- linuxsampler/src/drivers/audio/AudioOutputDevice.h:1.18	Sat Jul  1 13:43:03 2006
-+++ linuxsampler/src/drivers/audio/AudioOutputDevice.h	Wed Dec 27 16:17:07 2006
+--- linuxsampler/src/drivers/audio/AudioOutputDevice.h:1.18	Sat Jul  1 15:43:03 2006
++++ linuxsampler/src/drivers/audio/AudioOutputDevice.h	Wed Dec 27 17:17:07 2006
 @@ -230,6 +230,12 @@
              void AcquireChannels(uint Channels);
  
@@ -3421,8 +3509,8 @@
              std::map<String,DeviceCreationParameter*> DeviceParameters();
 Index: linuxsampler/src/drivers/midi/Makefile.am
 diff -u linuxsampler/src/drivers/midi/Makefile.am:1.9 linuxsampler/src/drivers/midi/Makefile.am:1.10
---- linuxsampler/src/drivers/midi/Makefile.am:1.9	Wed Jun 28 19:32:21 2006
-+++ linuxsampler/src/drivers/midi/Makefile.am	Mon Nov 27 21:34:54 2006
+--- linuxsampler/src/drivers/midi/Makefile.am:1.9	Wed Jun 28 21:32:21 2006
++++ linuxsampler/src/drivers/midi/Makefile.am	Mon Nov 27 22:34:54 2006
 @@ -31,16 +31,19 @@
  liblinuxsamplermididriverinclude_HEADERS = \
  	midi.h \
@@ -3453,8 +3541,8 @@
  liblinuxsamplermididriver_la_LDFLAGS = $(coremidi_ldflags)
 Index: linuxsampler/src/drivers/midi/MidiInputDeviceAlsa.cpp
 diff -u linuxsampler/src/drivers/midi/MidiInputDeviceAlsa.cpp:1.17 linuxsampler/src/drivers/midi/MidiInputDeviceAlsa.cpp:1.18
---- linuxsampler/src/drivers/midi/MidiInputDeviceAlsa.cpp:1.17	Sat Jul 22 14:22:52 2006
-+++ linuxsampler/src/drivers/midi/MidiInputDeviceAlsa.cpp	Mon Nov 27 21:34:54 2006
+--- linuxsampler/src/drivers/midi/MidiInputDeviceAlsa.cpp:1.17	Sat Jul 22 16:22:52 2006
++++ linuxsampler/src/drivers/midi/MidiInputDeviceAlsa.cpp	Mon Nov 27 22:34:54 2006
 @@ -212,7 +212,7 @@
      }
  
@@ -3480,8 +3568,8 @@
                          case SND_SEQ_EVENT_CHANPRESS:
 Index: linuxsampler/src/drivers/midi/MidiInputDeviceCoreMidi.cpp
 diff -u linuxsampler/src/drivers/midi/MidiInputDeviceCoreMidi.cpp:1.7 linuxsampler/src/drivers/midi/MidiInputDeviceCoreMidi.cpp:1.8
---- linuxsampler/src/drivers/midi/MidiInputDeviceCoreMidi.cpp:1.7	Sat Jul 22 14:22:52 2006
-+++ linuxsampler/src/drivers/midi/MidiInputDeviceCoreMidi.cpp	Mon Nov 27 21:34:54 2006
+--- linuxsampler/src/drivers/midi/MidiInputDeviceCoreMidi.cpp:1.7	Sat Jul 22 16:22:52 2006
++++ linuxsampler/src/drivers/midi/MidiInputDeviceCoreMidi.cpp	Mon Nov 27 22:34:54 2006
 @@ -90,7 +90,12 @@
  			switch(cin) { // status byte
  
@@ -3507,8 +3595,8 @@
  
 Index: linuxsampler/src/drivers/midi/MidiInputDeviceMidiShare.cpp
 diff -u linuxsampler/src/drivers/midi/MidiInputDeviceMidiShare.cpp:1.2 linuxsampler/src/drivers/midi/MidiInputDeviceMidiShare.cpp:1.3
---- linuxsampler/src/drivers/midi/MidiInputDeviceMidiShare.cpp:1.2	Tue Jul 13 22:09:12 2004
-+++ linuxsampler/src/drivers/midi/MidiInputDeviceMidiShare.cpp	Mon Nov 27 21:34:54 2006
+--- linuxsampler/src/drivers/midi/MidiInputDeviceMidiShare.cpp:1.2	Wed Jul 14 00:09:12 2004
++++ linuxsampler/src/drivers/midi/MidiInputDeviceMidiShare.cpp	Mon Nov 27 22:34:54 2006
 @@ -162,7 +162,12 @@
  			switch(EvType(ev)) { 
  			
@@ -3525,8 +3613,8 @@
  					
 Index: linuxsampler/src/drivers/midi/MidiInputPort.cpp
 diff -u linuxsampler/src/drivers/midi/MidiInputPort.cpp:1.14 linuxsampler/src/drivers/midi/MidiInputPort.cpp:1.16
---- linuxsampler/src/drivers/midi/MidiInputPort.cpp:1.14	Mon Oct  2 18:40:10 2006
-+++ linuxsampler/src/drivers/midi/MidiInputPort.cpp	Fri Dec 15 21:40:27 2006
+--- linuxsampler/src/drivers/midi/MidiInputPort.cpp:1.14	Mon Oct  2 20:40:10 2006
++++ linuxsampler/src/drivers/midi/MidiInputPort.cpp	Fri Dec 15 22:40:27 2006
 @@ -23,6 +23,7 @@
  
  #include "MidiInputPort.h"
@@ -3682,8 +3770,8 @@
      void MidiInputPort::Connect(EngineChannel* pEngineChannel, midi_chan_t MidiChannel) {
 Index: linuxsampler/src/drivers/midi/MidiInputPort.h
 diff -u linuxsampler/src/drivers/midi/MidiInputPort.h:1.11 linuxsampler/src/drivers/midi/MidiInputPort.h:1.12
---- linuxsampler/src/drivers/midi/MidiInputPort.h:1.11	Sun Jul 23 16:44:08 2006
-+++ linuxsampler/src/drivers/midi/MidiInputPort.h	Mon Nov 27 21:34:54 2006
+--- linuxsampler/src/drivers/midi/MidiInputPort.h:1.11	Sun Jul 23 18:44:08 2006
++++ linuxsampler/src/drivers/midi/MidiInputPort.h	Mon Nov 27 22:34:54 2006
 @@ -283,6 +283,10 @@
               */
              void DispatchProgramChange(uint8_t Program, uint MidiChannel);
@@ -3705,8 +3793,8 @@
  
 Index: linuxsampler/src/drivers/midi/MidiInstrumentMapper.cpp
 diff -u /dev/null linuxsampler/src/drivers/midi/MidiInstrumentMapper.cpp:1.6
---- /dev/null	Sat Jan 20 12:11:30 2007
-+++ linuxsampler/src/drivers/midi/MidiInstrumentMapper.cpp	Sun Dec 17 22:35:01 2006
+--- /dev/null	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/drivers/midi/MidiInstrumentMapper.cpp	Sun Dec 17 23:35:01 2006
 @@ -0,0 +1,307 @@
 +/***************************************************************************
 + *                                                                         *
@@ -4017,8 +4105,8 @@
 +} // namespace LinuxSampler
 Index: linuxsampler/src/drivers/midi/MidiInstrumentMapper.h
 diff -u /dev/null linuxsampler/src/drivers/midi/MidiInstrumentMapper.h:1.2
---- /dev/null	Sat Jan 20 12:11:30 2007
-+++ linuxsampler/src/drivers/midi/MidiInstrumentMapper.h	Fri Dec 15 21:40:27 2006
+--- /dev/null	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/drivers/midi/MidiInstrumentMapper.h	Fri Dec 15 22:40:27 2006
 @@ -0,0 +1,178 @@
 +/***************************************************************************
 + *                                                                         *
@@ -4200,8 +4288,8 @@
 +#endif // __LS_MIDIINSTRUMENTMAPPER_H__
 Index: linuxsampler/src/drivers/midi/midi.h
 diff -u linuxsampler/src/drivers/midi/midi.h:1.1 linuxsampler/src/drivers/midi/midi.h:1.2
---- linuxsampler/src/drivers/midi/midi.h:1.1	Wed Jun 22 22:09:27 2005
-+++ linuxsampler/src/drivers/midi/midi.h	Mon Nov 27 21:34:54 2006
+--- linuxsampler/src/drivers/midi/midi.h:1.1	Thu Jun 23 00:09:27 2005
++++ linuxsampler/src/drivers/midi/midi.h	Mon Nov 27 22:34:54 2006
 @@ -1,6 +1,6 @@
  /***************************************************************************
   *                                                                         *
@@ -4241,8 +4329,8 @@
  #endif // __LS_MIDI_H__
 Index: linuxsampler/src/engines/Engine.cpp
 diff -u /dev/null linuxsampler/src/engines/Engine.cpp:1.1
---- /dev/null	Sat Jan 20 12:11:30 2007
-+++ linuxsampler/src/engines/Engine.cpp	Sun Jan  7 15:52:36 2007
+--- /dev/null	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/engines/Engine.cpp	Sun Jan  7 16:52:36 2007
 @@ -0,0 +1,30 @@
 +/***************************************************************************
 + *                                                                         *
@@ -4276,8 +4364,8 @@
 +} // namespace LinuxSampler
 Index: linuxsampler/src/engines/Engine.h
 diff -u linuxsampler/src/engines/Engine.h:1.15 linuxsampler/src/engines/Engine.h:1.17
---- linuxsampler/src/engines/Engine.h:1.15	Sat Jul  1 13:30:52 2006
-+++ linuxsampler/src/engines/Engine.h	Sun Jan  7 15:52:36 2007
+--- linuxsampler/src/engines/Engine.h:1.15	Sat Jul  1 15:30:52 2006
++++ linuxsampler/src/engines/Engine.h	Sun Jan  7 16:52:36 2007
 @@ -2,8 +2,8 @@
   *                                                                         *
   *   LinuxSampler - modular, streaming capable sampler                     *
@@ -4320,8 +4408,8 @@
  
 Index: linuxsampler/src/engines/EngineChannel.cpp
 diff -u linuxsampler/src/engines/EngineChannel.cpp:1.3 linuxsampler/src/engines/EngineChannel.cpp:1.5
---- linuxsampler/src/engines/EngineChannel.cpp:1.3	Sat Jul  1 13:33:21 2006
-+++ linuxsampler/src/engines/EngineChannel.cpp	Fri Dec 15 21:40:27 2006
+--- linuxsampler/src/engines/EngineChannel.cpp:1.3	Sat Jul  1 15:33:21 2006
++++ linuxsampler/src/engines/EngineChannel.cpp	Fri Dec 15 22:40:27 2006
 @@ -23,11 +23,23 @@
  
  #include "EngineChannel.h"
@@ -4445,8 +4533,8 @@
  } // namespace LinuxSampler
 Index: linuxsampler/src/engines/EngineChannel.h
 diff -u linuxsampler/src/engines/EngineChannel.h:1.11 linuxsampler/src/engines/EngineChannel.h:1.14
---- linuxsampler/src/engines/EngineChannel.h:1.11	Sun Jul 23 16:44:08 2006
-+++ linuxsampler/src/engines/EngineChannel.h	Wed Dec 27 16:17:07 2006
+--- linuxsampler/src/engines/EngineChannel.h:1.11	Sun Jul 23 18:44:08 2006
++++ linuxsampler/src/engines/EngineChannel.h	Wed Dec 27 17:17:07 2006
 @@ -26,12 +26,15 @@
  #include "../drivers/midi/MidiInputDevice.h"
  #include "../drivers/midi/MidiInputPort.h"
@@ -4613,8 +4701,8 @@
  } // namespace LinuxSampler
 Index: linuxsampler/src/engines/EngineFactory.cpp
 diff -u linuxsampler/src/engines/EngineFactory.cpp:1.6 linuxsampler/src/engines/EngineFactory.cpp:1.7
---- linuxsampler/src/engines/EngineFactory.cpp:1.6	Fri Jul 28 21:47:23 2006
-+++ linuxsampler/src/engines/EngineFactory.cpp	Sun Jan  7 15:52:36 2007
+--- linuxsampler/src/engines/EngineFactory.cpp:1.6	Fri Jul 28 23:47:23 2006
++++ linuxsampler/src/engines/EngineFactory.cpp	Sun Jan  7 16:52:36 2007
 @@ -1,6 +1,6 @@
  /***************************************************************************
   *                                                                         *
@@ -4641,8 +4729,8 @@
      }
 Index: linuxsampler/src/engines/EngineFactory.h
 diff -u linuxsampler/src/engines/EngineFactory.h:1.6 linuxsampler/src/engines/EngineFactory.h:1.7
---- linuxsampler/src/engines/EngineFactory.h:1.6	Wed Jul  5 17:53:22 2006
-+++ linuxsampler/src/engines/EngineFactory.h	Sun Jan  7 15:52:36 2007
+--- linuxsampler/src/engines/EngineFactory.h:1.6	Wed Jul  5 19:53:22 2006
++++ linuxsampler/src/engines/EngineFactory.h	Sun Jan  7 16:52:36 2007
 @@ -1,6 +1,6 @@
  /***************************************************************************
   *                                                                         *
@@ -4663,8 +4751,8 @@
  } // namespace LinuxSampler
 Index: linuxsampler/src/engines/FxSend.cpp
 diff -u /dev/null linuxsampler/src/engines/FxSend.cpp:1.3
---- /dev/null	Sat Jan 20 12:11:30 2007
-+++ linuxsampler/src/engines/FxSend.cpp	Sun Jan 14 17:10:58 2007
+--- /dev/null	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/engines/FxSend.cpp	Sun Jan 14 18:10:58 2007
 @@ -0,0 +1,144 @@
 +/***************************************************************************
 + *                                                                         *
@@ -4812,8 +4900,8 @@
 +} // namespace LinuxSampler
 Index: linuxsampler/src/engines/FxSend.h
 diff -u /dev/null linuxsampler/src/engines/FxSend.h:1.3
---- /dev/null	Sat Jan 20 12:11:30 2007
-+++ linuxsampler/src/engines/FxSend.h	Sun Jan 14 17:10:58 2007
+--- /dev/null	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/engines/FxSend.h	Sun Jan 14 18:10:58 2007
 @@ -0,0 +1,150 @@
 +/***************************************************************************
 + *                                                                         *
@@ -4967,8 +5055,8 @@
 +#endif // LS_FXSEND_H
 Index: linuxsampler/src/engines/InstrumentManager.cpp
 diff -u /dev/null linuxsampler/src/engines/InstrumentManager.cpp:1.1
---- /dev/null	Sat Jan 20 12:11:30 2007
-+++ linuxsampler/src/engines/InstrumentManager.cpp	Mon Nov 27 21:34:54 2006
+--- /dev/null	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/engines/InstrumentManager.cpp	Mon Nov 27 22:34:54 2006
 @@ -0,0 +1,49 @@
 +/***************************************************************************
 + *                                                                         *
@@ -5021,8 +5109,8 @@
 +} // namespace LinuxSampler
 Index: linuxsampler/src/engines/InstrumentManager.h
 diff -u /dev/null linuxsampler/src/engines/InstrumentManager.h:1.2
---- /dev/null	Sat Jan 20 12:11:30 2007
-+++ linuxsampler/src/engines/InstrumentManager.h	Wed Nov 29 19:48:38 2006
+--- /dev/null	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/engines/InstrumentManager.h	Wed Nov 29 20:48:38 2006
 @@ -0,0 +1,117 @@
 +/***************************************************************************
 + *                                                                         *
@@ -5142,9 +5230,9 @@
 +
 +#endif // __LS_INSTRUMENTMANAGER_H__
 Index: linuxsampler/src/engines/InstrumentManagerThread.cpp
-diff -u /dev/null linuxsampler/src/engines/InstrumentManagerThread.cpp:1.3
---- /dev/null	Sat Jan 20 12:11:30 2007
-+++ linuxsampler/src/engines/InstrumentManagerThread.cpp	Tue Dec 19 19:34:08 2006
+diff -u /dev/null linuxsampler/src/engines/InstrumentManagerThread.cpp:1.4
+--- /dev/null	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/engines/InstrumentManagerThread.cpp	Sat Feb  3 16:33:00 2007
 @@ -0,0 +1,128 @@
 +/***************************************************************************
 + *                                                                         *
@@ -5188,7 +5276,7 @@
 +     * @param pEngineChannel - engine channel on which the instrument should be loaded
 +     */
 +    void InstrumentManagerThread::StartNewLoad(String Filename, uint uiInstrumentIndex, EngineChannel* pEngineChannel) {
-+        dmsg(1,("Scheduling '%s' (Index=%d) to be loaded in background (if not loaded yet).",Filename.c_str(),uiInstrumentIndex));
++        dmsg(1,("Scheduling '%s' (Index=%d) to be loaded in background (if not loaded yet).\n",Filename.c_str(),uiInstrumentIndex));
 +        // already tell the engine which instrument to load
 +        pEngineChannel->PrepareLoadInstrument(Filename.c_str(), uiInstrumentIndex);
 +
@@ -5276,8 +5364,8 @@
 +} // namespace LinuxSampler
 Index: linuxsampler/src/engines/InstrumentManagerThread.h
 diff -u /dev/null linuxsampler/src/engines/InstrumentManagerThread.h:1.3
---- /dev/null	Sat Jan 20 12:11:30 2007
-+++ linuxsampler/src/engines/InstrumentManagerThread.h	Tue Dec 19 19:34:08 2006
+--- /dev/null	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/engines/InstrumentManagerThread.h	Tue Dec 19 20:34:08 2006
 @@ -0,0 +1,70 @@
 +/***************************************************************************
 + *                                                                         *
@@ -5351,8 +5439,8 @@
 +#endif // __LS_INSTRUMENTLOADER_H__
 Index: linuxsampler/src/engines/Makefile.am
 diff -u linuxsampler/src/engines/Makefile.am:1.6 linuxsampler/src/engines/Makefile.am:1.9
---- linuxsampler/src/engines/Makefile.am:1.6	Sat Jul  1 13:43:03 2006
-+++ linuxsampler/src/engines/Makefile.am	Sun Jan  7 15:52:36 2007
+--- linuxsampler/src/engines/Makefile.am:1.6	Sat Jul  1 15:43:03 2006
++++ linuxsampler/src/engines/Makefile.am	Sun Jan  7 16:52:36 2007
 @@ -6,11 +6,16 @@
  liblinuxsamplerengineincludedir = $(includedir)/linuxsampler/engines
  liblinuxsamplerengineinclude_HEADERS = \
@@ -5374,9 +5462,9 @@
 +	InstrumentManager.cpp InstrumentManager.h \
 +	InstrumentManagerThread.cpp InstrumentManagerThread.h
 Index: linuxsampler/src/engines/gig/DiskThread.cpp
-diff -u linuxsampler/src/engines/gig/DiskThread.cpp:1.11 linuxsampler/src/engines/gig/DiskThread.cpp:1.12
---- linuxsampler/src/engines/gig/DiskThread.cpp:1.11	Sun May 14 07:15:52 2006
-+++ linuxsampler/src/engines/gig/DiskThread.cpp	Wed Dec  6 22:28:16 2006
+diff -u linuxsampler/src/engines/gig/DiskThread.cpp:1.11 linuxsampler/src/engines/gig/DiskThread.cpp:1.13
+--- linuxsampler/src/engines/gig/DiskThread.cpp:1.11	Sun May 14 09:15:52 2006
++++ linuxsampler/src/engines/gig/DiskThread.cpp	Sat Feb  3 16:32:59 2007
 @@ -3,7 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -5386,9 +5474,46 @@
   *                                                                         *
   *   This program is free software; you can redistribute it and/or modify  *
   *   it under the terms of the GNU General Public License as published by  *
-@@ -187,9 +187,9 @@
+@@ -58,6 +58,7 @@
+         GhostQueue->init();
+         CreationQueue->init();
+         DeletionQueue->init();
++        DeleteDimregQueue->init();
+         ActiveStreamCount = 0;
+         ActiveStreamCountMax = 0;
+         if (running) this->StartThread(); // start thread only if it was running before
+@@ -154,6 +155,23 @@
+     }
  
-     DiskThread::DiskThread(uint BufferWrapElements) : Thread(true, false, 1, -2) {
+     /**
++     * Tell the disk thread to release a dimension region that belong
++     * to an instrument which isn't loaded anymore. The disk thread
++     * will hand back the dimension region to the instrument resource
++     * manager. (OrderDeletionOfDimreg is called from the audio thread
++     * when a voice dies.)
++     */
++    int DiskThread::OrderDeletionOfDimreg(::gig::DimensionRegion* dimreg) {
++        dmsg(4,("Disk Thread: dimreg deletion ordered\n"));
++        if (DeleteDimregQueue->write_space() < 1) {
++            dmsg(1,("DiskThread: DeleteDimreg queue full!\n"));
++            return -1;
++        }
++        DeleteDimregQueue->push(&dimreg);
++        return 0;
++    }
++
++    /**
+      * Returns the pointer to a disk stream if the ordered disk stream
+      * represented by the \a StreamOrderID was already activated by the disk
+      * thread, returns NULL otherwise. If the call was successful, thus if it
+@@ -185,11 +203,14 @@
+     // #         (following code should only be executed by the disk thread)
+ 
+ 
+-    DiskThread::DiskThread(uint BufferWrapElements) : Thread(true, false, 1, -2) {
++    DiskThread::DiskThread(uint BufferWrapElements, InstrumentResourceManager* pInstruments) :
++        Thread(true, false, 1, -2),
++        pInstruments(pInstruments) {
          DecompressionBuffer = ::gig::Sample::CreateDecompressionBuffer(CONFIG_STREAM_MAX_REFILL_SIZE);
 -        CreationQueue       = new RingBuffer<create_command_t>(1024);
 -        DeletionQueue       = new RingBuffer<delete_command_t>(1024);
@@ -5396,13 +5521,37 @@
 +        CreationQueue       = new RingBuffer<create_command_t,false>(1024);
 +        DeletionQueue       = new RingBuffer<delete_command_t,false>(1024);
 +        GhostQueue          = new RingBuffer<Stream::Handle,false>(CONFIG_MAX_STREAMS);
++        DeleteDimregQueue   = new RingBuffer< ::gig::DimensionRegion*,false>(1024);
          Streams             = CONFIG_MAX_STREAMS;
          RefillStreamsPerRun = CONFIG_REFILL_STREAMS_PER_RUN;
          for (int i = 0; i < CONFIG_MAX_STREAMS; i++) {
+@@ -208,6 +229,7 @@
+         if (CreationQueue) delete CreationQueue;
+         if (DeletionQueue) delete DeletionQueue;
+         if (GhostQueue)    delete GhostQueue;
++        if (DeleteDimregQueue) delete DeleteDimregQueue;
+         ::gig::Sample::DestroyDecompressionBuffer(DecompressionBuffer);
+     }
+ 
+@@ -246,6 +268,14 @@
+                 DeleteStream(command);
+             }
+ 
++            // release DimensionRegions that belong to instruments
++            // that are no longer loaded
++            while (DeleteDimregQueue->read_space() > 0) {
++                ::gig::DimensionRegion* dimreg;
++                DeleteDimregQueue->pop(&dimreg);
++                pInstruments->HandBackDimReg(dimreg);
++            }
++
+             RefillStreams(); // refill the most empty streams
+ 
+             // if nothing was done during this iteration (eg no streambuffer
 Index: linuxsampler/src/engines/gig/DiskThread.h
-diff -u linuxsampler/src/engines/gig/DiskThread.h:1.11 linuxsampler/src/engines/gig/DiskThread.h:1.12
---- linuxsampler/src/engines/gig/DiskThread.h:1.11	Sun May 14 07:15:52 2006
-+++ linuxsampler/src/engines/gig/DiskThread.h	Wed Dec  6 22:28:17 2006
+diff -u linuxsampler/src/engines/gig/DiskThread.h:1.11 linuxsampler/src/engines/gig/DiskThread.h:1.13
+--- linuxsampler/src/engines/gig/DiskThread.h:1.11	Sun May 14 09:15:52 2006
++++ linuxsampler/src/engines/gig/DiskThread.h	Sat Feb  3 16:32:59 2007
 @@ -3,7 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -5412,7 +5561,31 @@
   *                                                                         *
   *   This program is free software; you can redistribute it and/or modify  *
   *   it under the terms of the GNU General Public License as published by  *
-@@ -84,9 +84,9 @@
+@@ -41,17 +41,22 @@
+      *
+      * The disk reader thread is responsible for periodically refilling
+      * disk streams in parallel to the audio thread's rendering process.
++     *
++     * There is also a function for releasing parts of instruments not
++     * in use anymore (as this is not real time safe, the audio thread
++     * cannot do it directly).
+      */
+     class DiskThread : public Thread {
+         public:
+             // Methods
+-            DiskThread(uint BufferWrapElements);
++            DiskThread(uint BufferWrapElements, InstrumentResourceManager* pInstruments);
+             virtual ~DiskThread();
+             void    Reset();
+             String  GetBufferFillBytes();
+             String  GetBufferFillPercentage();
+             int     OrderNewStream(Stream::reference_t* pStreamRef, ::gig::DimensionRegion* pDimRgn, unsigned long SampleOffset, bool DoLoop);
+             int     OrderDeletionOfStream(Stream::reference_t* pStreamRef);
++            int     OrderDeletionOfDimreg(::gig::DimensionRegion* dimreg);
+             Stream* AskForCreatedStream(Stream::OrderID_t StreamOrderID);
+ 
+             // the number of streams currently in usage
+@@ -84,13 +89,15 @@
              // Attributes
              bool                           IsIdle;
              uint                           Streams;
@@ -5422,13 +5595,39 @@
 +            RingBuffer<create_command_t,false>* CreationQueue;                      ///< Contains commands to create streams
 +            RingBuffer<delete_command_t,false>* DeletionQueue;                      ///< Contains commands to delete streams
 +            RingBuffer<Stream::Handle,false>*   GhostQueue;                         ///< Contains handles to streams that are not used anymore and weren't deletable immediately
++            RingBuffer< ::gig::DimensionRegion*,false>* DeleteDimregQueue;          ///< Contains dimension regions that are not used anymore and should be handed back to the instrument resource manager
              unsigned int                   RefillStreamsPerRun;                    ///< How many streams should be refilled in each loop run
              Stream*                        pStreams[CONFIG_MAX_STREAMS];            ///< Contains all disk streams (whether used or unused)
              Stream*                        pCreatedStreams[CONFIG_MAX_STREAMS + 1]; ///< This is where the voice (audio thread) picks up it's meanwhile hopefully created disk stream.
+             static Stream*                 SLOT_RESERVED;                          ///< This value is used to mark an entry in pCreatedStreams[] as reserved.
++            InstrumentResourceManager*     pInstruments;                           ///< The instrument resource manager of the engine that is using this disk thread. Used by the dimension region deletion feature.
+ 
+             // Methods
+             void                           CreateStream(create_command_t& Command);
+Index: linuxsampler/src/engines/gig/EGADSR.cpp
+diff -u linuxsampler/src/engines/gig/EGADSR.cpp:1.21 linuxsampler/src/engines/gig/EGADSR.cpp:1.22
+--- linuxsampler/src/engines/gig/EGADSR.cpp:1.21	Sun Jan 15 19:23:10 2006
++++ linuxsampler/src/engines/gig/EGADSR.cpp	Sat Feb  3 21:46:44 2007
+@@ -286,6 +286,7 @@
+         Segment   = segment_lin;
+         StepsLeft = int((ReleaseLevel2 - Level) / ReleaseCoeff);
+         Coeff     = ReleaseCoeff;
++        if (StepsLeft == 0) enterReleasePart2Stage();
+     }
+ 
+     void EGADSR::enterReleasePart2Stage() {
+@@ -294,6 +295,7 @@
+         StepsLeft = int(log((CONFIG_EG_BOTTOM - ExpOffset) / (Level - ExpOffset)) / ReleaseSlope);
+         Coeff     = ReleaseCoeff2;
+         Offset    = ReleaseCoeff3;
++        if (StepsLeft == 0) enterFadeOutStage();
+     }
+ 
+     void EGADSR::enterFadeOutStage() {
 Index: linuxsampler/src/engines/gig/Engine.cpp
-diff -u linuxsampler/src/engines/gig/Engine.cpp:1.65 linuxsampler/src/engines/gig/Engine.cpp:1.69
---- linuxsampler/src/engines/gig/Engine.cpp:1.65	Sat Oct 21 14:13:09 2006
-+++ linuxsampler/src/engines/gig/Engine.cpp	Sun Jan  7 15:52:36 2007
+diff -u linuxsampler/src/engines/gig/Engine.cpp:1.65 linuxsampler/src/engines/gig/Engine.cpp:1.72
+--- linuxsampler/src/engines/gig/Engine.cpp:1.65	Sat Oct 21 16:13:09 2006
++++ linuxsampler/src/engines/gig/Engine.cpp	Sat Feb  3 21:46:44 2007
 @@ -2,8 +2,8 @@
   *                                                                         *
   *   LinuxSampler - modular, streaming capable sampler                     *
@@ -5440,7 +5639,19 @@
   *                                                                         *
   *   This program is free software; you can redistribute it and/or modify  *
   *   it under the terms of the GNU General Public License as published by  *
-@@ -97,8 +97,8 @@
+@@ -51,6 +51,11 @@
+         if (engines.count(pDevice)) {
+             dmsg(4,("Using existing gig::Engine.\n"));
+             pEngine = engines[pDevice];
++
++            // Disable the engine while the new engine channel is
++            // added and initialized. The engine will be enabled again
++            // in EngineChannel::Connect.
++            pEngine->DisableAndLock();
+         } else { // create a new engine (and disk thread) instance for the given audio output device
+             dmsg(4,("Creating new gig::Engine.\n"));
+             pEngine = (Engine*) EngineFactory::Create("gig");
+@@ -97,12 +102,16 @@
          pAudioOutputDevice = NULL;
          pDiskThread        = NULL;
          pEventGenerator    = NULL;
@@ -5450,8 +5661,16 @@
 +        pEventQueue        = new RingBuffer<Event,false>(CONFIG_MAX_EVENTS_PER_FRAGMENT, 0);
          pEventPool         = new Pool<Event>(CONFIG_MAX_EVENTS_PER_FRAGMENT);
          pVoicePool         = new Pool<Voice>(CONFIG_MAX_VOICES);
++        pDimRegionsInUse   = new ::gig::DimensionRegion*[CONFIG_MAX_VOICES + 1];
          pVoiceStealingQueue = new RTList<Event>(pEventPool);
-@@ -132,7 +132,7 @@
+         pGlobalEvents      = new RTList<Event>(pEventPool);
++        InstrumentChangeQueue      = new RingBuffer<instrument_change_command_t,false>(1, 0);
++        InstrumentChangeReplyQueue = new RingBuffer<instrument_change_reply_t,false>(1, 0);
++
+         for (RTList<Voice>::Iterator iterVoice = pVoicePool->allocAppend(); iterVoice == pVoicePool->last(); iterVoice = pVoicePool->allocAppend()) {
+             iterVoice->SetEngine(this);
+         }
+@@ -132,7 +141,7 @@
          if (pEventGenerator) delete pEventGenerator;
          if (pVoiceStealingQueue) delete pVoiceStealingQueue;
          if (pSysexBuffer) delete pSysexBuffer;
@@ -5460,7 +5679,17 @@
      }
  
      void Engine::Enable() {
-@@ -306,7 +306,7 @@
+@@ -257,7 +266,8 @@
+             delete this->pDiskThread;
+             dmsg(1,("OK\n"));
+         }
+-        this->pDiskThread = new DiskThread(((pAudioOut->MaxSamplesPerCycle() << CONFIG_MAX_PITCH) << 1) + 6); //FIXME: assuming stereo
++        this->pDiskThread = new DiskThread(((pAudioOut->MaxSamplesPerCycle() << CONFIG_MAX_PITCH) << 1) + 6, //FIXME: assuming stereo
++                                           &instruments);
+         if (!pDiskThread) {
+             dmsg(0,("gig::Engine  new diskthread = NULL\n"));
+             exit(EXIT_FAILURE);
+@@ -306,7 +316,7 @@
       *                  current audio cycle
       */
      void Engine::ImportEvents(uint Samples) {
@@ -5469,7 +5698,7 @@
          Event* pEvent;
          while (true) {
              // get next event from input event queue
-@@ -340,7 +340,7 @@
+@@ -340,7 +350,7 @@
       *  @returns       0 on success
       */
      int Engine::RenderAudio(uint Samples) {
@@ -5478,7 +5707,55 @@
  
          // return if engine disabled
          if (EngineDisabled.Pop()) {
-@@ -392,6 +392,12 @@
+@@ -377,24 +387,60 @@
+         // reset internal voice counter (just for statistic of active voices)
+         ActiveVoiceCountTemp = 0;
+ 
++        // handle instrument change commands
++        instrument_change_command_t command;
++        if (InstrumentChangeQueue->pop(&command) > 0) {
++            EngineChannel* pEngineChannel = command.pEngineChannel;
++            pEngineChannel->pInstrument = command.pInstrument;
++
++            // iterate through all active voices and mark their
++            // dimension regions as "in use". The instrument resource
++            // manager may delete all of the instrument except the
++            // dimension regions and samples that are in use.
++            int i = 0;
++            RTList<uint>::Iterator iuiKey = pEngineChannel->pActiveKeys->first();
++            RTList<uint>::Iterator end    = pEngineChannel->pActiveKeys->end();
++            while (iuiKey != end) { // iterate through all active keys
++                midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[*iuiKey];
++                ++iuiKey;
++
++                RTList<Voice>::Iterator itVoice     = pKey->pActiveVoices->first();
++                RTList<Voice>::Iterator itVoicesEnd = pKey->pActiveVoices->end();
++                for (; itVoice != itVoicesEnd; ++itVoice) { // iterate through all voices on this key
++                    if (!itVoice->Orphan) {
++                        itVoice->Orphan = true;
++                        pDimRegionsInUse[i++] = itVoice->pDimRgn;
++                    }
++                }
++            }
++            pDimRegionsInUse[i] = 0; // end of list
++
++            // send a reply to the calling thread, which is waiting
++            instrument_change_reply_t reply;
++            InstrumentChangeReplyQueue->push(&reply);
++        }
++
+         // handle events on all engine channels
+         for (int i = 0; i < engineChannels.size(); i++) {
+-            if (!engineChannels[i]->pInstrument) continue; // ignore if no instrument loaded
+             ProcessEvents(engineChannels[i], Samples);
+         }
+ 
+         // render all 'normal', active voices on all engine channels
+         for (int i = 0; i < engineChannels.size(); i++) {
+-            if (!engineChannels[i]->pInstrument) continue; // ignore if no instrument loaded
+             RenderActiveVoices(engineChannels[i], Samples);
+         }
+ 
          // now that all ordinary voices on ALL engine channels are rendered, render new stolen voices
          RenderStolenVoices(Samples);
  
@@ -5490,8 +5767,19 @@
 +
          // handle cleanup on all engine channels for the next audio fragment
          for (int i = 0; i < engineChannels.size(); i++) {
-             if (!engineChannels[i]->pInstrument) continue; // ignore if no instrument loaded
-@@ -532,6 +538,58 @@
+-            if (!engineChannels[i]->pInstrument) continue; // ignore if no instrument loaded
+             PostProcess(engineChannels[i]);
+         }
+ 
+@@ -513,6 +559,7 @@
+         RTList<Event>::Iterator end               = pVoiceStealingQueue->end();
+         for (; itVoiceStealEvent != end; ++itVoiceStealEvent) {
+             EngineChannel* pEngineChannel = (EngineChannel*) itVoiceStealEvent->pEngineChannel;
++            if (!pEngineChannel->pInstrument) continue; // ignore if no instrument loaded
+             Pool<Voice>::Iterator itNewVoice =
+                 LaunchVoice(pEngineChannel, itVoiceStealEvent, itVoiceStealEvent->Param.Note.Layer, itVoiceStealEvent->Param.Note.ReleaseTrigger, false, false);
+             if (itNewVoice) {
+@@ -532,6 +579,58 @@
      }
  
      /**
@@ -5512,8 +5800,8 @@
 +        {
 +            AudioChannel* pDstL = pAudioOutputDevice->Channel(pEngineChannel->AudioDeviceChannelLeft);
 +            AudioChannel* pDstR = pAudioOutputDevice->Channel(pEngineChannel->AudioDeviceChannelRight);
-+            pEngineChannel->pChannelLeft->CopyTo(pDstL, Samples);
-+            pEngineChannel->pChannelRight->CopyTo(pDstR, Samples);
++            pEngineChannel->pChannelLeft->MixTo(pDstL, Samples);
++            pEngineChannel->pChannelRight->MixTo(pDstR, Samples);
 +        }
 +        // route FX send signal
 +        {
@@ -5527,7 +5815,7 @@
 +                    AudioChannel* pDstL = pAudioOutputDevice->Channel(iDstL);
 +                    if (!pDstL) {
 +                        dmsg(1,("Engine::RouteAudio() Error: invalid FX send (L) destination channel"));
-+                    } else pEngineChannel->pChannelLeft->CopyTo(pDstL, Samples, pFxSend->Level());
++                    } else pEngineChannel->pChannelLeft->MixTo(pDstL, Samples, pFxSend->Level());
 +                }
 +                // right channel
 +                const int iDstR = pFxSend->DestinationChannel(1);
@@ -5537,7 +5825,7 @@
 +                    AudioChannel* pDstR = pAudioOutputDevice->Channel(iDstR);
 +                    if (!pDstR) {
 +                        dmsg(1,("Engine::RouteAudio() Error: invalid FX send (R) destination channel"));
-+                    } else pEngineChannel->pChannelRight->CopyTo(pDstR, Samples, pFxSend->Level());
++                    } else pEngineChannel->pChannelRight->MixTo(pDstR, Samples, pFxSend->Level());
 +                }
 +            }
 +        }
@@ -5550,7 +5838,61 @@
       * Free all keys which have turned inactive in this audio fragment, from
       * the list of active keys and clear all event lists on that engine
       * channel.
-@@ -1236,6 +1294,7 @@
+@@ -608,6 +707,8 @@
+         if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted
+         #endif
+ 
++        if (!pEngineChannel->pInstrument) return; // ignore if no instrument loaded
++
+         const int key = itNoteOnEvent->Param.Note.Key;
+         midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[key];
+ 
+@@ -705,7 +806,7 @@
+         bool bShouldRelease = pKey->Active && ShouldReleaseVoice(pEngineChannel, itNoteOffEventOnKeyList->Param.Note.Key);
+ 
+         // in case Solo Mode is enabled, kill all voices on this key and respawn a voice on the highest pressed key (if any)
+-        if (pEngineChannel->SoloMode) { //TODO: this feels like too much code just for handling solo mode :P
++        if (pEngineChannel->SoloMode && pEngineChannel->pInstrument) { //TODO: this feels like too much code just for handling solo mode :P
+             bool bOtherKeysPressed = false;
+             if (iKey == pEngineChannel->SoloKey) {
+                 pEngineChannel->SoloKey = -1;
+@@ -768,7 +869,7 @@
+             itNoteOffEventOnKeyList->Type = Event::type_release; // transform event type
+ 
+             // spawn release triggered voice(s) if needed
+-            if (pKey->ReleaseTrigger) {
++            if (pKey->ReleaseTrigger && pEngineChannel->pInstrument) {
+                 // first, get total amount of required voices (dependant on amount of layers)
+                 ::gig::Region* pRegion = pEngineChannel->pInstrument->GetRegion(itNoteOffEventOnKeyList->Param.Note.Key);
+                 if (pRegion) {
+@@ -963,6 +1064,12 @@
+                     std::cerr << "gig::Engine::LaunchVoice() Error: Unknown dimension\n" << std::flush;
+             }
+         }
++
++        // return if this is a release triggered voice and there is no
++        // releasetrigger dimension (could happen if an instrument
++        // change has occured between note on and off)
++        if (ReleaseTriggerVoice && VoiceType != Voice::type_release_trigger) return Pool<Voice>::Iterator();
++
+         ::gig::DimensionRegion* pDimRgn = pRegion->GetDimensionRegionByValue(DimValues);
+ 
+         // no need to continue if sample is silent
+@@ -1192,6 +1299,13 @@
+ 
+             uint keygroup = itVoice->KeyGroup;
+ 
++            // if the sample and dimension region belong to an
++            // instrument that is unloaded, tell the disk thread to
++            // release them
++            if (itVoice->Orphan) {
++                pDiskThread->OrderDeletionOfDimreg(itVoice->pDimRgn);
++            }
++
+             // free the voice object
+             pVoicePool->free(itVoice);
+ 
+@@ -1236,6 +1350,7 @@
          // update controller value in the engine channel's controller table
          pEngineChannel->ControllerTable[itControlChangeEvent->Param.CC.Controller] = itControlChangeEvent->Param.CC.Value;
  
@@ -5558,7 +5900,7 @@
          switch (itControlChangeEvent->Param.CC.Controller) {
              case 5: { // portamento time
                  pEngineChannel->PortamentoTime = (float) itControlChangeEvent->Param.CC.Value / 127.0f * (float) CONFIG_PORTAMENTO_TIME_MAX + (float) CONFIG_PORTAMENTO_TIME_MIN;
-@@ -1243,7 +1302,7 @@
+@@ -1243,7 +1358,7 @@
              }
              case 7: { // volume
                  //TODO: not sample accurate yet
@@ -5567,7 +5909,7 @@
                  pEngineChannel->bStatusChanged = true; // engine channel status has changed, so set notify flag
                  break;
              }
-@@ -1374,6 +1433,15 @@
+@@ -1374,6 +1489,15 @@
                  break;
              }
          }
@@ -5583,7 +5925,7 @@
      }
  
      /**
-@@ -1382,7 +1450,7 @@
+@@ -1382,7 +1506,7 @@
       *  @param itSysexEvent - sysex data size and time stamp of the sysex event
       */
      void Engine::ProcessSysex(Pool<Event>::Iterator& itSysexEvent) {
@@ -5592,7 +5934,7 @@
  
          uint8_t exclusive_status, id;
          if (!reader.pop(&exclusive_status)) goto free_sysex_data;
-@@ -1401,7 +1469,7 @@
+@@ -1401,7 +1525,7 @@
  
                  // command address
                  uint8_t addr[3]; // 2 byte addr MSB, followed by 1 byte addr LSB)
@@ -5601,7 +5943,7 @@
                  if (reader.read(&addr[0], 3) != 3) goto free_sysex_data;
                  if (addr[0] == 0x40 && addr[1] == 0x00) { // System Parameters
                      dmsg(3,("\tSystem Parameter\n"));
-@@ -1448,8 +1516,8 @@
+@@ -1448,8 +1572,8 @@
       *                     question
       * @param DataSize   - size of the GS message data (in bytes)
       */
@@ -5612,12 +5954,12 @@
          uint bytes = 3 /*addr*/ + DataSize;
          uint8_t addr_and_data[bytes];
          reader.read(&addr_and_data[0], bytes);
-@@ -1568,10 +1636,14 @@
+@@ -1568,10 +1692,14 @@
      }
  
      String Engine::Version() {
 -        String s = "$Revision: 1.65 $";
-+        String s = "$Revision: 1.69 $";
++        String s = "$Revision: 1.72 $";
          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword
      }
  
@@ -5628,10 +5970,39 @@
      // static constant initializers
      const float* Engine::VolumeCurve(InitVolumeCurve());
      const float* Engine::PanCurve(InitPanCurve());
+@@ -1614,4 +1742,28 @@
+         return y;
+     }
+ 
++    /**
++     * Changes the instrument for an engine channel.
++     *
++     * @param pEngineChannel - engine channel on which the instrument
++     *                         should be changed
++     * @param pInstrument - new instrument
++     * @returns a list of dimension regions from the old instrument
++     *          that are still in use
++     */
++    ::gig::DimensionRegion** Engine::ChangeInstrument(EngineChannel* pEngineChannel, ::gig::Instrument* pInstrument) {
++        instrument_change_command_t command;
++        command.pEngineChannel = pEngineChannel;
++        command.pInstrument = pInstrument;
++        InstrumentChangeQueue->push(&command);
++
++        // wait for the audio thread to confirm that the instrument
++        // change has been done
++        instrument_change_reply_t reply;
++        while (InstrumentChangeReplyQueue->pop(&reply) == 0) {
++            usleep(10000);
++        }
++        return pDimRegionsInUse;
++    }
++
+ }} // namespace LinuxSampler::gig
 Index: linuxsampler/src/engines/gig/Engine.h
-diff -u linuxsampler/src/engines/gig/Engine.h:1.40 linuxsampler/src/engines/gig/Engine.h:1.44
---- linuxsampler/src/engines/gig/Engine.h:1.40	Sat Jul  1 13:43:04 2006
-+++ linuxsampler/src/engines/gig/Engine.h	Sun Jan  7 15:52:36 2007
+diff -u linuxsampler/src/engines/gig/Engine.h:1.40 linuxsampler/src/engines/gig/Engine.h:1.45
+--- linuxsampler/src/engines/gig/Engine.h:1.40	Sat Jul  1 15:43:04 2006
++++ linuxsampler/src/engines/gig/Engine.h	Sat Feb  3 16:32:59 2007
 @@ -2,8 +2,8 @@
   *                                                                         *
   *   LinuxSampler - modular, streaming capable sampler                     *
@@ -5643,7 +6014,15 @@
   *                                                                         *
   *   This program is free software; you can redistribute it and/or modify  *
   *   it under the terms of the GNU General Public License as published by  *
-@@ -77,6 +77,7 @@
+@@ -60,6 +60,7 @@
+             Engine();
+             virtual ~Engine();
+             void Connect(AudioOutputDevice* pAudioOut);
++            ::gig::DimensionRegion** ChangeInstrument(EngineChannel* pEngineChannel, ::gig::Instrument* pInstrument);
+ 
+             // implementation of abstract methods derived from class 'LinuxSampler::Engine'
+             virtual int    RenderAudio(uint Samples);
+@@ -77,6 +78,7 @@
              virtual String Description();
              virtual String Version();
              virtual String EngineName();
@@ -5651,7 +6030,7 @@
  
              static const float* VolumeCurve;    ///< Table that maps volume control change values 0..127 to amplitude. Unity gain is at 90.
              static const float* PanCurve;       ///< Table that maps pan control change values 0..128 to right channel amplitude. Unity gain is at 64 (center).
-@@ -89,13 +90,13 @@
+@@ -89,13 +91,13 @@
              uint                    SampleRate;            ///< Sample rate of the engines output audio signal (in Hz)
              uint                    MaxSamplesPerCycle;    ///< Size of each audio output buffer
              DiskThread*             pDiskThread;
@@ -5667,7 +6046,7 @@
              int                     ActiveVoiceCount;      ///< number of currently active voices (this value will be returned for public calls)
              int                     ActiveVoiceCountTemp;  ///< number of currently active voices (for internal usage, will be used for incrementation)
              int                     ActiveVoiceCountMax;   ///< the maximum voice usage since application start
-@@ -115,6 +116,7 @@
+@@ -115,6 +117,7 @@
              void ProcessEvents(EngineChannel* pEngineChannel, uint Samples);
              void RenderActiveVoices(EngineChannel* pEngineChannel, uint Samples);
              void RenderStolenVoices(uint Samples);
@@ -5675,7 +6054,28 @@
              void PostProcess(EngineChannel* pEngineChannel);
              void ClearEventLists();
              void ImportEvents(uint Samples);
-@@ -144,7 +146,7 @@
+@@ -137,6 +140,20 @@
+ 
+             friend class Voice;
+         private:
++
++            /// Command used by the instrument loader thread to
++            /// request an instrument change on a channel.
++            struct instrument_change_command_t {
++                EngineChannel* pEngineChannel;
++                ::gig::Instrument* pInstrument;
++            };
++            struct instrument_change_reply_t {
++                int dummy;
++            };
++            RingBuffer<instrument_change_command_t,false>* InstrumentChangeQueue;      ///< Contains the instrument change command
++            RingBuffer<instrument_change_reply_t,false>*   InstrumentChangeReplyQueue; ///< Contains the acknowledge of an instrument change
++           ::gig::DimensionRegion** pDimRegionsInUse; ///< After an instrument change, this contains a list of dimension regions that are still in use by playing voices
++
+             ArrayList<EngineChannel*> engineChannels; ///< All engine channels of a gig::Engine instance.
+ 
+             static std::map<AudioOutputDevice*,Engine*> engines; ///< All instances of gig::Engine.
+@@ -144,7 +161,7 @@
              int SostenutoKeys[128];
              int SostenutoKeyCount;
  
@@ -5685,9 +6085,9 @@
              void    ReleaseAllVoices(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itReleaseEvent);
              void    KillAllVoices(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itKillEvent);
 Index: linuxsampler/src/engines/gig/EngineChannel.cpp
-diff -u linuxsampler/src/engines/gig/EngineChannel.cpp:1.21 linuxsampler/src/engines/gig/EngineChannel.cpp:1.25
---- linuxsampler/src/engines/gig/EngineChannel.cpp:1.21	Sun Jul 23 16:44:08 2006
-+++ linuxsampler/src/engines/gig/EngineChannel.cpp	Fri Dec 29 20:06:13 2006
+diff -u linuxsampler/src/engines/gig/EngineChannel.cpp:1.21 linuxsampler/src/engines/gig/EngineChannel.cpp:1.27
+--- linuxsampler/src/engines/gig/EngineChannel.cpp:1.21	Sun Jul 23 18:44:08 2006
++++ linuxsampler/src/engines/gig/EngineChannel.cpp	Sat Feb  3 21:46:44 2007
 @@ -30,7 +30,7 @@
          pEngine      = NULL;
          pInstrument  = NULL;
@@ -5714,21 +6114,84 @@
      }
  
      /**
-@@ -176,9 +179,9 @@
+@@ -160,27 +163,35 @@
+      * @see PrepareLoadInstrument()
+      */
+     void EngineChannel::LoadInstrument() {
+-
+-        if (pEngine) pEngine->DisableAndLock();
+-
+-        ResetInternal();
++        ::gig::Instrument* oldInstrument = pInstrument;
  
+         // free old instrument
+-        if (pInstrument) {
+-            // give old instrument back to instrument manager
+-            Engine::instruments.HandBack(pInstrument, this);
++        if (oldInstrument) {
++            if (pEngine) {
++                // make sure we don't trigger any new notes with the
++                // old instrument
++                ::gig::DimensionRegion** dimRegionsInUse = pEngine->ChangeInstrument(this, 0);
++
++                // give old instrument back to instrument manager, but
++                // keep the dimension regions and samples that are in
++                // use
++                Engine::instruments.HandBackInstrument(oldInstrument, this, dimRegionsInUse);
++            } else {
++                Engine::instruments.HandBack(oldInstrument, this);
++            }
+         }
+ 
+         // delete all key groups
+         ActiveKeyGroups.clear();
+ 
          // request gig instrument from instrument manager
++        ::gig::Instrument* newInstrument;
          try {
 -            instrument_id_t instrid;
 -            instrid.FileName    = InstrumentFile;
 -            instrid.iInstrument = InstrumentIdx;
+-            pInstrument = Engine::instruments.Borrow(instrid, this);
+-            if (!pInstrument) {
 +            InstrumentManager::instrument_id_t instrid;
 +            instrid.FileName  = InstrumentFile;
 +            instrid.Index     = InstrumentIdx;
-             pInstrument = Engine::instruments.Borrow(instrid, this);
-             if (!pInstrument) {
++            newInstrument = Engine::instruments.Borrow(instrid, this);
++            if (!newInstrument) {
                  InstrumentStat = -1;
-@@ -269,8 +272,16 @@
+                 dmsg(1,("no instrument loaded!!!\n"));
+                 exit(EXIT_FAILURE);
+@@ -202,23 +213,14 @@
          }
+ 
+         // rebuild ActiveKeyGroups map with key groups of current instrument
+-        for (::gig::Region* pRegion = pInstrument->GetFirstRegion(); pRegion; pRegion = pInstrument->GetNextRegion())
++        for (::gig::Region* pRegion = newInstrument->GetFirstRegion(); pRegion; pRegion = newInstrument->GetNextRegion())
+             if (pRegion->KeyGroup) ActiveKeyGroups[pRegion->KeyGroup] = NULL;
+ 
+-        InstrumentIdxName = pInstrument->pInfo->Name;
++        InstrumentIdxName = newInstrument->pInfo->Name;
+         InstrumentStat = 100;
+ 
+-        // inform audio driver for the need of two channels
+-        try {
+-            if (pEngine && pEngine->pAudioOutputDevice)
+-                pEngine->pAudioOutputDevice->AcquireChannels(2); // gig Engine only stereo
+-        }
+-        catch (AudioOutputException e) {
+-            String msg = "Audio output device unable to provide 2 audio channels, cause: " + e.Message();
+-            throw Exception(msg);
+-        }
+-
+-        if (pEngine) pEngine->Enable();
++        if (pEngine) pEngine->ChangeInstrument(this, newInstrument);
++        else pInstrument = newInstrument;
+     }
+ 
+     /**
+@@ -269,8 +271,17 @@
+         }
          AudioDeviceChannelLeft  = 0;
          AudioDeviceChannelRight = 1;
 -        pOutputLeft             = pAudioOut->Channel(0)->Buffer();
@@ -5743,6 +6206,7 @@
 +            pChannelLeft  = new AudioChannel(0, pAudioOut->MaxSamplesPerCycle());
 +            pChannelRight = new AudioChannel(1, pAudioOut->MaxSamplesPerCycle());
 +        }
++        if (pEngine->EngineDisabled.GetUnsafe()) pEngine->Enable();
          MidiInputPort::AddSysexListener(pEngine);
      }
  
@@ -5894,8 +6358,8 @@
      }
 Index: linuxsampler/src/engines/gig/EngineChannel.h
 diff -u linuxsampler/src/engines/gig/EngineChannel.h:1.19 linuxsampler/src/engines/gig/EngineChannel.h:1.22
---- linuxsampler/src/engines/gig/EngineChannel.h:1.19	Sun Jul 23 16:44:08 2006
-+++ linuxsampler/src/engines/gig/EngineChannel.h	Wed Dec 27 16:17:08 2006
+--- linuxsampler/src/engines/gig/EngineChannel.h:1.19	Sun Jul 23 18:44:08 2006
++++ linuxsampler/src/engines/gig/EngineChannel.h	Wed Dec 27 17:17:08 2006
 @@ -24,13 +24,10 @@
  #ifndef __LS_GIG_ENGINECHANNEL_H__
  #define __LS_GIG_ENGINECHANNEL_H__
@@ -5974,9 +6438,9 @@
  
  }} // namespace LinuxSampler::gig
 Index: linuxsampler/src/engines/gig/InstrumentResourceManager.cpp
-diff -u linuxsampler/src/engines/gig/InstrumentResourceManager.cpp:1.9 linuxsampler/src/engines/gig/InstrumentResourceManager.cpp:1.12
---- linuxsampler/src/engines/gig/InstrumentResourceManager.cpp:1.9	Thu May 19 19:25:14 2005
-+++ linuxsampler/src/engines/gig/InstrumentResourceManager.cpp	Wed Dec  6 22:28:17 2006
+diff -u linuxsampler/src/engines/gig/InstrumentResourceManager.cpp:1.9 linuxsampler/src/engines/gig/InstrumentResourceManager.cpp:1.13
+--- linuxsampler/src/engines/gig/InstrumentResourceManager.cpp:1.9	Thu May 19 21:25:14 2005
++++ linuxsampler/src/engines/gig/InstrumentResourceManager.cpp	Sat Feb  3 16:32:59 2007
 @@ -3,7 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -6100,7 +6564,64 @@
          delete pEntry;
      }
  
-@@ -158,7 +188,7 @@
+@@ -136,6 +166,56 @@
+     }
+ 
+     /**
++     * Give back an instrument. This should be used instead of
++     * HandBack if there are some dimension regions that are still in
++     * use. (When an instrument is changed, the voices currently
++     * playing is allowed to keep playing with the old instrument
++     * until note off arrives. New notes will use the new instrument.)
++     */
++    void InstrumentResourceManager::HandBackInstrument(::gig::Instrument* pResource, InstrumentConsumer* pConsumer,
++                                                       ::gig::DimensionRegion** dimRegionsInUse) {
++        DimRegInfoMutex.Lock();
++        for (int i = 0 ; dimRegionsInUse[i] ; i++) {
++            DimRegInfo[dimRegionsInUse[i]].refCount++;
++            SampleRefCount[dimRegionsInUse[i]->pSample]++;
++        }
++        HandBack(pResource, pConsumer, true);
++        DimRegInfoMutex.Unlock();
++    }
++
++    /**
++     * Give back a dimension region that belongs to an instrument that
++     * was previously handed back.
++     */
++    void InstrumentResourceManager::HandBackDimReg(::gig::DimensionRegion* pDimReg) {
++        DimRegInfoMutex.Lock();
++        dimreg_info_t& dimRegInfo = DimRegInfo[pDimReg];
++        int dimRegRefCount = --dimRegInfo.refCount;
++        int sampleRefCount = --SampleRefCount[pDimReg->pSample];
++        if (dimRegRefCount == 0) {
++            ::gig::File* gig = dimRegInfo.file;
++            ::RIFF::File* riff = dimRegInfo.riff;
++            DimRegInfo.erase(pDimReg);
++            // TODO: we could delete Region and Instrument here if
++            // they have become unused
++
++            if (sampleRefCount == 0) {
++                SampleRefCount.erase(pDimReg->pSample);
++
++                if (gig) {
++                    gig->DeleteSample(pDimReg->pSample);
++                    if (!gig->GetFirstSample()) {
++                        dmsg(2,("No more samples in use - freeing gig\n"));
++                        delete gig;
++                        delete riff;
++                    }
++                }
++            }
++        }
++        DimRegInfoMutex.Unlock();
++    }
++
++    /**
+      *  Caches a certain size at the beginning of the given sample in RAM. If the
+      *  sample is very short, the whole sample will be loaded into RAM and thus
+      *  no disk streaming is needed for this sample. Caching an initial part of
+@@ -158,7 +238,7 @@
              // border, to allow the interpolator do it's work even at the end of
              // the sample.
              const uint maxSamplesPerCycle =
@@ -6109,10 +6630,66 @@
                                                : GIG_RESOURCE_MANAGER_DEFAULT_MAX_SAMPLES_PER_CYCLE;
              const uint neededSilenceSamples = (maxSamplesPerCycle << CONFIG_MAX_PITCH) + 3;
              const uint currentlyCachedSilenceSamples = pSample->GetCache().NullExtensionSize / pSample->FrameSize;
+@@ -190,8 +270,53 @@
+ 
+     void InstrumentResourceManager::GigResourceManager::Destroy(::gig::File* pResource, void* pArg) {
+         dmsg(1,("Freeing gig file from memory..."));
+-        delete pResource;
+-        delete (::RIFF::File*) pArg;
++
++        // Delete as much as possible of the gig file. Some of the
++        // dimension regions and samples may still be in use - these
++        // will be deleted later by the HandBackDimReg function.
++        bool deleteFile = true;
++        ::gig::Instrument* nextInstrument;
++        for (::gig::Instrument* instrument = pResource->GetFirstInstrument() ;
++             instrument ;
++             instrument = nextInstrument) {
++            nextInstrument = pResource->GetNextInstrument();
++            bool deleteInstrument = true;
++            ::gig::Region* nextRegion;
++            for (::gig::Region *region = instrument->GetFirstRegion() ;
++                 region ;
++                 region = nextRegion) {
++                nextRegion = instrument->GetNextRegion();
++                bool deleteRegion = true;
++                for (int i = 0 ; i < region->DimensionRegions ; i++)
++                {
++                    ::gig::DimensionRegion *d = region->pDimensionRegions[i];
++                    std::map< ::gig::DimensionRegion*, dimreg_info_t>::iterator iter = parent->DimRegInfo.find(d);
++                    if (iter != parent->DimRegInfo.end()) {
++                        dimreg_info_t& dimRegInfo = (*iter).second;
++                        dimRegInfo.file = pResource;
++                        dimRegInfo.riff = (::RIFF::File*)pArg;
++                        deleteFile = deleteInstrument = deleteRegion = false;
++                    }
++                }
++                if (deleteRegion) instrument->DeleteRegion(region);
++            }
++            if (deleteInstrument) pResource->DeleteInstrument(instrument);
++        }
++        if (deleteFile) {
++            delete pResource;
++            delete (::RIFF::File*) pArg;
++        } else {
++            dmsg(2,("keeping some samples that are in use..."));
++            ::gig::Sample* nextSample;
++            for (::gig::Sample* sample = pResource->GetFirstSample() ;
++                 sample ;
++                 sample = nextSample) {
++                nextSample = pResource->GetNextSample();
++                if (parent->SampleRefCount.find(sample) == parent->SampleRefCount.end()) {
++                    pResource->DeleteSample(sample);
++                }
++            }
++        }
+         dmsg(1,("OK\n"));
+     }
+ 
 Index: linuxsampler/src/engines/gig/InstrumentResourceManager.h
-diff -u linuxsampler/src/engines/gig/InstrumentResourceManager.h:1.9 linuxsampler/src/engines/gig/InstrumentResourceManager.h:1.11
---- linuxsampler/src/engines/gig/InstrumentResourceManager.h:1.9	Tue Jun 27 22:57:37 2006
-+++ linuxsampler/src/engines/gig/InstrumentResourceManager.h	Wed Nov 29 19:48:38 2006
+diff -u linuxsampler/src/engines/gig/InstrumentResourceManager.h:1.9 linuxsampler/src/engines/gig/InstrumentResourceManager.h:1.12
+--- linuxsampler/src/engines/gig/InstrumentResourceManager.h:1.9	Wed Jun 28 00:57:37 2006
++++ linuxsampler/src/engines/gig/InstrumentResourceManager.h	Sat Feb  3 16:32:59 2007
 @@ -32,6 +32,7 @@
  #include "../../common/Exception.h"
  #include "../../common/ResourceManager.h"
@@ -6143,7 +6720,7 @@
       *
       * Manager to share gig instruments between multiple Gigasampler
       * engine channels. The engine channels Borrow() instruments when they
-@@ -70,24 +58,24 @@
+@@ -70,24 +58,30 @@
       * InstrumentResourceManager loads the corresponding gig file and gig
       * instrument if needed, if it's already in use by another engine
       * channel, then it just returns the same resource, if an gig
@@ -6155,6 +6732,7 @@
 -    class InstrumentResourceManager : public ResourceManager<instrument_id_t, ::gig::Instrument> {
 +    class InstrumentResourceManager : public InstrumentManager, public ResourceManager<InstrumentManager::instrument_id_t, ::gig::Instrument> {
          public:
++            InstrumentResourceManager() : Gigs(this) {}
              virtual ~InstrumentResourceManager() {}
              static void OnInstrumentLoadingProgress(::gig::progress_t* pProgress);
 +
@@ -6163,6 +6741,11 @@
 +            virtual InstrumentManager::mode_t GetMode(const instrument_id_t& ID);
 +            virtual void SetMode(const instrument_id_t& ID, InstrumentManager::mode_t Mode);
 +            virtual String GetInstrumentName(instrument_id_t ID);
++
++            void HandBackInstrument(::gig::Instrument* pResource, InstrumentConsumer* pConsumer,
++                                    ::gig::DimensionRegion** dimRegionsInUse);
++            void HandBackDimReg(::gig::DimensionRegion* pDimReg);
++
          protected:
              virtual ::gig::Instrument* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg);
              virtual void               Destroy(::gig::Instrument* pResource, void* pArg);
@@ -6177,10 +6760,33 @@
              typedef ResourceConsumer< ::gig::File> GigConsumer;
  
              class GigResourceManager : public ResourceManager<String, ::gig::File> {
+@@ -96,10 +90,22 @@
+                     virtual void         Destroy(::gig::File* pResource, void* pArg);
+                     virtual void         OnBorrow(::gig::File* pResource, GigConsumer* pConsumer, void*& pArg) {} // ignore
+                 public:
++                    GigResourceManager(InstrumentResourceManager* parent) : parent(parent) {}
+                     virtual ~GigResourceManager() {}
++                private:
++                    InstrumentResourceManager* parent;
+             } Gigs;
+ 
+             void CacheInitialSamples(::gig::Sample* pSample, gig::EngineChannel* pEngineChannel);
++
++            struct dimreg_info_t {
++                int           refCount;
++                ::gig::File*  file;
++                ::RIFF::File* riff;
++            };
++            Mutex DimRegInfoMutex; ///< protects the DimRegInfo and SampleRefCount maps from concurrent access by the instrument loader and disk threads
++            std::map< ::gig::DimensionRegion*, dimreg_info_t> DimRegInfo; ///< contains dimension regions that are still in use but belong to released instrument
++            std::map< ::gig::Sample*, int> SampleRefCount; ///< contains samples that are still in use but belong to a released instrument
+     };
+ 
+     /**
 Index: linuxsampler/src/engines/gig/Stream.cpp
 diff -u linuxsampler/src/engines/gig/Stream.cpp:1.9 linuxsampler/src/engines/gig/Stream.cpp:1.10
---- linuxsampler/src/engines/gig/Stream.cpp:1.9	Sat Jul 22 14:22:53 2006
-+++ linuxsampler/src/engines/gig/Stream.cpp	Wed Dec  6 22:28:17 2006
+--- linuxsampler/src/engines/gig/Stream.cpp:1.9	Sat Jul 22 16:22:53 2006
++++ linuxsampler/src/engines/gig/Stream.cpp	Wed Dec  6 23:28:17 2006
 @@ -3,7 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -6201,8 +6807,8 @@
  	TotalStreams++;
 Index: linuxsampler/src/engines/gig/Stream.h
 diff -u linuxsampler/src/engines/gig/Stream.h:1.10 linuxsampler/src/engines/gig/Stream.h:1.11
---- linuxsampler/src/engines/gig/Stream.h:1.10	Sat Jul 22 14:22:53 2006
-+++ linuxsampler/src/engines/gig/Stream.h	Wed Dec  6 22:28:17 2006
+--- linuxsampler/src/engines/gig/Stream.h:1.10	Sat Jul 22 16:22:53 2006
++++ linuxsampler/src/engines/gig/Stream.h	Wed Dec  6 23:28:17 2006
 @@ -3,7 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -6222,10 +6828,18 @@
              ::gig::buffer_t*         pDecompressionBuffer;
              int                      BytesPerSample;
 Index: linuxsampler/src/engines/gig/Voice.cpp
-diff -u linuxsampler/src/engines/gig/Voice.cpp:1.64 linuxsampler/src/engines/gig/Voice.cpp:1.69
---- linuxsampler/src/engines/gig/Voice.cpp:1.64	Mon Oct  2 18:40:10 2006
-+++ linuxsampler/src/engines/gig/Voice.cpp	Sat Jan  6 11:02:58 2007
-@@ -103,7 +103,7 @@
+diff -u linuxsampler/src/engines/gig/Voice.cpp:1.64 linuxsampler/src/engines/gig/Voice.cpp:1.70
+--- linuxsampler/src/engines/gig/Voice.cpp:1.64	Mon Oct  2 20:40:10 2006
++++ linuxsampler/src/engines/gig/Voice.cpp	Sat Feb  3 16:32:59 2007
+@@ -79,6 +79,7 @@
+     int Voice::Trigger(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent, int PitchBend, ::gig::DimensionRegion* pDimRgn, type_t VoiceType, int iKeyGroup) {
+         this->pEngineChannel = pEngineChannel;
+         this->pDimRgn        = pDimRgn;
++        Orphan = false;
+ 
+         #if CONFIG_DEVMODE
+         if (itNoteOnEvent->FragmentPos() > pEngine->MaxSamplesPerCycle) { // just a sanity check for debugging
+@@ -103,7 +104,7 @@
          // -1.0..1.0). For 24 bit, we downscale from int32.
          float volume = velocityAttenuation / (pSample->BitDepth == 16 ? 32768.0f : 32768.0f * 65536.0f);
  
@@ -6234,7 +6848,7 @@
  
          // the volume of release triggered samples depends on note length
          if (Type == type_release_trigger) {
-@@ -141,7 +141,7 @@
+@@ -141,7 +142,7 @@
  
          float subfragmentRate = pEngine->SampleRate / CONFIG_DEFAULT_SUBFRAGMENT_SIZE;
          CrossfadeSmoother.trigger(crossfadeVolume, subfragmentRate);
@@ -6243,7 +6857,7 @@
          PanLeftSmoother.trigger(pEngineChannel->GlobalPanLeft, subfragmentRate);
          PanRightSmoother.trigger(pEngineChannel->GlobalPanRight, subfragmentRate);
  
-@@ -241,7 +241,7 @@
+@@ -241,7 +242,7 @@
          else
  #else
          {
@@ -6252,7 +6866,7 @@
  
              finalSynthesisParameters.fFinalVolumeLeft  = finalVolume * VolumeLeft  * pEngineChannel->GlobalPanLeft;
              finalSynthesisParameters.fFinalVolumeRight = finalVolume * VolumeRight * pEngineChannel->GlobalPanRight;
-@@ -719,7 +719,7 @@
+@@ -719,7 +720,7 @@
                      CrossfadeSmoother.update(Engine::CrossfadeCurve[CrossfadeAttenuation(itEvent->Param.CC.Value)]);
                  }
                  if (itEvent->Param.CC.Controller == 7) { // volume
@@ -6261,7 +6875,7 @@
                  } else if (itEvent->Param.CC.Controller == 10) { // panpot
                      PanLeftSmoother.update(Engine::PanCurve[128 - itEvent->Param.CC.Value]);
                      PanRightSmoother.update(Engine::PanCurve[itEvent->Param.CC.Value]);
-@@ -768,8 +768,8 @@
+@@ -768,8 +769,8 @@
       *  @param Skip    - number of sample points to skip in output buffer
       */
      void Voice::Synthesize(uint Samples, sample_t* pSrc, uint Skip) {
@@ -6272,7 +6886,7 @@
          finalSynthesisParameters.pSrc      = pSrc;
  
          RTList<Event>::Iterator itCCEvent = pEngineChannel->pEvents->first();
-@@ -803,8 +803,11 @@
+@@ -803,8 +804,11 @@
              // process transition events (note on, note off & sustain pedal)
              processTransitionEvents(itNoteEvent, iSubFragmentEnd);
  
@@ -6286,10 +6900,22 @@
                  EG1.enterFadeOutStage();
                  itKillEvent = Pool<Event>::Iterator();
              }
+Index: linuxsampler/src/engines/gig/Voice.h
+diff -u linuxsampler/src/engines/gig/Voice.h:1.40 linuxsampler/src/engines/gig/Voice.h:1.41
+--- linuxsampler/src/engines/gig/Voice.h:1.40	Sun Jun 25 15:54:17 2006
++++ linuxsampler/src/engines/gig/Voice.h	Sat Feb  3 16:32:59 2007
+@@ -147,6 +147,7 @@
+             float                       CutoffBase;         ///< Cutoff frequency before control change, EG and LFO are applied
+             ::gig::Sample*              pSample;            ///< Pointer to the sample to be played back
+             ::gig::DimensionRegion*     pDimRgn;            ///< Pointer to the articulation information of current dimension region of this voice
++            bool                        Orphan;             ///< true if this voice is playing a sample from an instrument that is unloaded. When the voice dies, the sample (and dimension region) will be handed back to the instrument resource manager.
+             playback_state_t            PlaybackState;      ///< When a sample will be triggered, it will be first played from RAM cache and after a couple of sample points it will switch to disk streaming and at the end of a disk stream we have to add null samples, so the interpolator can do it's work correctly
+             bool                        DiskVoice;          ///< If the sample is very short it completely fits into the RAM cache and doesn't need to be streamed from disk, in that case this flag is set to false
+             Stream::reference_t         DiskStreamRef;      ///< Reference / link to the disk stream
 Index: linuxsampler/src/network/Makefile.am
 diff -u linuxsampler/src/network/Makefile.am:1.17 linuxsampler/src/network/Makefile.am:1.18
---- linuxsampler/src/network/Makefile.am:1.17	Thu Dec 22 19:28:36 2005
-+++ linuxsampler/src/network/Makefile.am	Mon Nov 27 21:34:55 2006
+--- linuxsampler/src/network/Makefile.am:1.17	Thu Dec 22 20:28:36 2005
++++ linuxsampler/src/network/Makefile.am	Mon Nov 27 22:34:55 2006
 @@ -18,8 +18,8 @@
  	lscpserver.cpp lscpserver.h \
  	lscpsymbols.h \
@@ -6303,8 +6929,8 @@
  liblinuxsamplernetwork_la_CXXFLAGS = $(sqlite3_cflags)
 Index: linuxsampler/src/network/lscp.y
 diff -u linuxsampler/src/network/lscp.y:1.35 linuxsampler/src/network/lscp.y:1.41
---- linuxsampler/src/network/lscp.y:1.35	Sun Jan  8 20:19:49 2006
-+++ linuxsampler/src/network/lscp.y	Sun Jan 14 17:10:59 2007
+--- linuxsampler/src/network/lscp.y:1.35	Sun Jan  8 21:19:49 2006
++++ linuxsampler/src/network/lscp.y	Sun Jan 14 18:10:59 2007
 @@ -21,8 +21,12 @@
   *   MA  02111-1307  USA                                                   *
   ***************************************************************************/
@@ -6701,8 +7327,8 @@
  
 Index: linuxsampler/src/network/lscpevent.cpp
 diff -u linuxsampler/src/network/lscpevent.cpp:1.3 linuxsampler/src/network/lscpevent.cpp:1.4
---- linuxsampler/src/network/lscpevent.cpp:1.3	Tue Jun 27 22:57:37 2006
-+++ linuxsampler/src/network/lscpevent.cpp	Sun Dec 17 22:35:01 2006
+--- linuxsampler/src/network/lscpevent.cpp:1.3	Wed Jun 28 00:57:37 2006
++++ linuxsampler/src/network/lscpevent.cpp	Sun Dec 17 23:35:01 2006
 @@ -69,6 +69,11 @@
  	this->storage = ToString(uiData) + " " + sData;
  }
@@ -6717,8 +7343,8 @@
  	String result = "NOTIFY:";
 Index: linuxsampler/src/network/lscpevent.h
 diff -u linuxsampler/src/network/lscpevent.h:1.4 linuxsampler/src/network/lscpevent.h:1.5
---- linuxsampler/src/network/lscpevent.h:1.4	Tue Jun 27 22:57:37 2006
-+++ linuxsampler/src/network/lscpevent.h	Sun Dec 17 22:35:01 2006
+--- linuxsampler/src/network/lscpevent.h:1.4	Wed Jun 28 00:57:37 2006
++++ linuxsampler/src/network/lscpevent.h	Sun Dec 17 23:35:01 2006
 @@ -43,13 +43,21 @@
  	     * Event types
  	     **/
@@ -6752,8 +7378,8 @@
  	    /* Returns event type */
 Index: linuxsampler/src/network/lscpinstrumentloader.cpp
 diff -u linuxsampler/src/network/lscpinstrumentloader.cpp:1.5 linuxsampler/src/network/lscpinstrumentloader.cpp:removed
---- linuxsampler/src/network/lscpinstrumentloader.cpp:1.5	Tue Jun 27 22:57:37 2006
-+++ linuxsampler/src/network/lscpinstrumentloader.cpp	Sat Jan 20 12:11:30 2007
+--- linuxsampler/src/network/lscpinstrumentloader.cpp:1.5	Wed Jun 28 00:57:37 2006
++++ linuxsampler/src/network/lscpinstrumentloader.cpp	Mon Feb  5 11:42:55 2007
 @@ -1,73 +0,0 @@
 -/***************************************************************************
 - *                                                                         *
@@ -6830,8 +7456,8 @@
 -}
 Index: linuxsampler/src/network/lscpinstrumentloader.h
 diff -u linuxsampler/src/network/lscpinstrumentloader.h:1.4 linuxsampler/src/network/lscpinstrumentloader.h:removed
---- linuxsampler/src/network/lscpinstrumentloader.h:1.4	Sat Feb 26 02:01:14 2005
-+++ linuxsampler/src/network/lscpinstrumentloader.h	Sat Jan 20 12:11:30 2007
+--- linuxsampler/src/network/lscpinstrumentloader.h:1.4	Sat Feb 26 03:01:14 2005
++++ linuxsampler/src/network/lscpinstrumentloader.h	Mon Feb  5 11:42:55 2007
 @@ -1,60 +0,0 @@
 -/***************************************************************************
 - *                                                                         *
@@ -6895,8 +7521,8 @@
 -#endif // __LSCPINSTRUMENTLOADER_H__
 Index: linuxsampler/src/network/lscpparser.cpp
 diff -u linuxsampler/src/network/lscpparser.cpp:1.34 linuxsampler/src/network/lscpparser.cpp:1.40
---- linuxsampler/src/network/lscpparser.cpp:1.34	Sun Jan  8 20:19:49 2006
-+++ linuxsampler/src/network/lscpparser.cpp	Sun Jan 14 17:10:59 2007
+--- linuxsampler/src/network/lscpparser.cpp:1.34	Sun Jan  8 21:19:49 2006
++++ linuxsampler/src/network/lscpparser.cpp	Sun Jan 14 18:10:59 2007
 @@ -1,7 +1,9 @@
 -/* A Bison parser, made by GNU Bison 2.1.  */
 +/* A Bison parser, made by GNU Bison 2.3.  */
@@ -14058,8 +14684,8 @@
 -
 Index: linuxsampler/src/network/lscpparser.h
 diff -u linuxsampler/src/network/lscpparser.h:1.9 linuxsampler/src/network/lscpparser.h:1.10
---- linuxsampler/src/network/lscpparser.h:1.9	Tue Aug 17 20:35:04 2004
-+++ linuxsampler/src/network/lscpparser.h	Mon Nov 27 21:34:55 2006
+--- linuxsampler/src/network/lscpparser.h:1.9	Tue Aug 17 22:35:04 2004
++++ linuxsampler/src/network/lscpparser.h	Mon Nov 27 22:34:55 2006
 @@ -3,6 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -14096,8 +14722,8 @@
      std::map<std::string,std::string> KeyValList;
 Index: linuxsampler/src/network/lscpresultset.cpp
 diff -u linuxsampler/src/network/lscpresultset.cpp:1.7 linuxsampler/src/network/lscpresultset.cpp:1.8
---- linuxsampler/src/network/lscpresultset.cpp:1.7	Tue Jun 27 22:57:37 2006
-+++ linuxsampler/src/network/lscpresultset.cpp	Thu Jan  4 14:43:02 2007
+--- linuxsampler/src/network/lscpresultset.cpp:1.7	Wed Jun 28 00:57:37 2006
++++ linuxsampler/src/network/lscpresultset.cpp	Thu Jan  4 15:43:02 2007
 @@ -3,7 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -14118,8 +14744,8 @@
  void LSCPResultSet::Add(String Label, const char* pValue) {
 Index: linuxsampler/src/network/lscpserver.cpp
 diff -u linuxsampler/src/network/lscpserver.cpp:1.68 linuxsampler/src/network/lscpserver.cpp:1.77
---- linuxsampler/src/network/lscpserver.cpp:1.68	Sat Nov 25 18:07:34 2006
-+++ linuxsampler/src/network/lscpserver.cpp	Sun Jan 14 17:10:59 2007
+--- linuxsampler/src/network/lscpserver.cpp:1.68	Sat Nov 25 19:07:34 2006
++++ linuxsampler/src/network/lscpserver.cpp	Sun Jan 14 18:10:59 2007
 @@ -3,7 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -14790,8 +15416,8 @@
   * server for receiving event messages.
 Index: linuxsampler/src/network/lscpserver.h
 diff -u linuxsampler/src/network/lscpserver.h:1.33 linuxsampler/src/network/lscpserver.h:1.38
---- linuxsampler/src/network/lscpserver.h:1.33	Fri Sep 23 06:58:26 2005
-+++ linuxsampler/src/network/lscpserver.h	Sun Jan 14 17:10:59 2007
+--- linuxsampler/src/network/lscpserver.h:1.33	Fri Sep 23 08:58:26 2005
++++ linuxsampler/src/network/lscpserver.h	Sun Jan 14 18:10:59 2007
 @@ -3,7 +3,7 @@
   *   LinuxSampler - modular, streaming capable sampler                     *
   *                                                                         *
@@ -14865,8 +15491,8 @@
  
 Index: linuxsampler/src/network/lscpsymbols.h
 diff -u linuxsampler/src/network/lscpsymbols.h:1.11 linuxsampler/src/network/lscpsymbols.h:1.13
---- linuxsampler/src/network/lscpsymbols.h:1.11	Fri Sep 23 06:58:26 2005
-+++ linuxsampler/src/network/lscpsymbols.h	Mon Dec 18 10:28:00 2006
+--- linuxsampler/src/network/lscpsymbols.h:1.11	Fri Sep 23 08:58:26 2005
++++ linuxsampler/src/network/lscpsymbols.h	Mon Dec 18 11:28:00 2006
 @@ -1,7 +1,9 @@
 -/* A Bison parser, made by GNU Bison 2.0.  */
 +/* A Bison parser, made by GNU Bison 2.3.  */




More information about the Demudi-commits mailing list