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

Free Ekanayaka free-guest at alioth.debian.org
Mon Feb 12 11:16:43 CET 2007


Author: free-guest
Date: 2007-02-12 11:16:37 +0100 (Mon, 12 Feb 2007)
New Revision: 1065

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

Modified: linuxsampler/trunk/debian/changelog
===================================================================
--- linuxsampler/trunk/debian/changelog	2007-02-09 10:39:58 UTC (rev 1064)
+++ linuxsampler/trunk/debian/changelog	2007-02-12 10:16:37 UTC (rev 1065)
@@ -1,3 +1,9 @@
+linuxsampler (0.4.0-1+cvs070208) UNRELEASED; urgency=low
+
+  * New cvs snapshot
+
+ -- Free Ekanayaka <free at 64studio.com>  Thu,  8 Feb 2007 13:11:03 +0000
+
 linuxsampler (0.4.0-1+cvs070205) UNRELEASED; urgency=low
 
   * New cvs snapshot

Modified: linuxsampler/trunk/debian/patches/10_cvs-snapshot.dpatch
===================================================================
--- linuxsampler/trunk/debian/patches/10_cvs-snapshot.dpatch	2007-02-09 10:39:58 UTC (rev 1064)
+++ linuxsampler/trunk/debian/patches/10_cvs-snapshot.dpatch	2007-02-12 10:16:37 UTC (rev 1065)
@@ -24,10 +24,10 @@
 
 @DPATCH@
 Index: linuxsampler/ChangeLog
-diff -u linuxsampler/ChangeLog:1.59 linuxsampler/ChangeLog:1.69
+diff -u linuxsampler/ChangeLog:1.59 linuxsampler/ChangeLog:1.70
 --- linuxsampler/ChangeLog:1.59	Fri Nov 24 18:43:08 2006
-+++ linuxsampler/ChangeLog	Sat Feb  3 21:46:43 2007
-@@ -1,3 +1,51 @@
++++ linuxsampler/ChangeLog	Wed Feb  7 18:45:18 2007
+@@ -1,3 +1,52 @@
 +Version CVS HEAD (?)
 +
 +  * general changes:
@@ -70,6 +70,7 @@
 +      playing with the old instrument until they get a note off
 +      command
 +    - EG fix: a release value of zero could cause noises or crash
++    - handle MIDI coarse tuning messages (MIDI RPN #0 MSB #2 LSB)
 +
 +  * Bug fixes:
 +    - fixed crash occurring on certain LSCP scripts (Bug 39)
@@ -106,15 +107,15 @@
  
  License
 Index: linuxsampler/configure.in
-diff -u linuxsampler/configure.in:1.54 linuxsampler/configure.in:1.57
+diff -u linuxsampler/configure.in:1.54 linuxsampler/configure.in:1.58
 --- linuxsampler/configure.in:1.54	Fri Nov 24 18:43:08 2006
-+++ linuxsampler/configure.in	Sun Jan  7 16:52:36 2007
++++ linuxsampler/configure.in	Wed Feb  7 16:41:29 2007
 @@ -5,7 +5,7 @@
  
  LINUXSAMPLER_RELEASE_MAJOR=0
  LINUXSAMPLER_RELEASE_MINOR=4
 -LINUXSAMPLER_RELEASE_BUILD=0
-+LINUXSAMPLER_RELEASE_BUILD=0.2cvs
++LINUXSAMPLER_RELEASE_BUILD=0.3cvs
  
  #------------------------------------------------------------------------------------
  # The following is the libtool / shared library version. This doesn't have to
@@ -2603,9 +2604,18 @@
  	optional.cpp \
  	Pool.h \
 Index: linuxsampler/src/common/ResourceManager.h
-diff -u linuxsampler/src/common/ResourceManager.h:1.7 linuxsampler/src/common/ResourceManager.h:1.10
+diff -u linuxsampler/src/common/ResourceManager.h:1.7 linuxsampler/src/common/ResourceManager.h:1.11
 --- 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
++++ linuxsampler/src/common/ResourceManager.h	Wed Feb  7 16:41:30 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  *
 @@ -26,10 +26,19 @@
  
  #include <set>
@@ -2875,7 +2885,7 @@
 +         * @param bLock - use thread safety mechanisms
 +         * @throws Exception in case an invalid Mode was given
 +         */
-+        void SetAvailabilityMode(T_key Key, mode_t Mode, bool bLock = true) throw (Exception) {
++        void SetAvailabilityMode(T_key Key, mode_t Mode, bool bLock = true) {
 +            if (Mode != ON_DEMAND && Mode != ON_DEMAND_HOLD && Mode != PERSISTENT)
 +                throw Exception("ResourceManager::SetAvailabilityMode(): invalid mode");
 +
@@ -3290,7 +3300,7 @@
       */
 Index: linuxsampler/src/common/global.cpp
 diff -u /dev/null linuxsampler/src/common/global.cpp:1.1
---- /dev/null	Mon Feb  5 11:42:55 2007
+--- /dev/null	Thu Feb  8 15:27:32 2007
 +++ linuxsampler/src/common/global.cpp	Fri Dec 29 21:06:13 2006
 @@ -0,0 +1,36 @@
 +/***************************************************************************
@@ -3792,13 +3802,13 @@
      };
  
 Index: linuxsampler/src/drivers/midi/MidiInstrumentMapper.cpp
-diff -u /dev/null linuxsampler/src/drivers/midi/MidiInstrumentMapper.cpp:1.6
---- /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 @@
+diff -u /dev/null linuxsampler/src/drivers/midi/MidiInstrumentMapper.cpp:1.7
+--- /dev/null	Thu Feb  8 15:27:32 2007
++++ linuxsampler/src/drivers/midi/MidiInstrumentMapper.cpp	Wed Feb  7 16:41:30 2007
+@@ -0,0 +1,308 @@
 +/***************************************************************************
 + *                                                                         *
-+ *   Copyright (C) 2006 Christian Schoenebeck                              *
++ *   Copyright (C) 2006 - 2007 Christian Schoenebeck                       *
 + *                                                                         *
 + *   This library is free software; you can redistribute it and/or modify  *
 + *   it under the terms of the GNU General Public License as published by  *
@@ -3871,6 +3881,7 @@
 +        midiMapsMutex.Unlock();
 +        if (!Entry.InstrumentFile.size())
 +            throw Exception("No instrument file name given");
++        // TODO: an easy one - we should check here if given file exists and throw an exception if it doesn't
 +        if (Entry.Volume < 0.0)
 +            throw Exception("Volume may not be a negative value");
 +        Engine* pEngine = EngineFactory::Create(Entry.EngineName);
@@ -4105,7 +4116,7 @@
 +} // namespace LinuxSampler
 Index: linuxsampler/src/drivers/midi/MidiInstrumentMapper.h
 diff -u /dev/null linuxsampler/src/drivers/midi/MidiInstrumentMapper.h:1.2
---- /dev/null	Mon Feb  5 11:42:55 2007
+--- /dev/null	Thu Feb  8 15:27:32 2007
 +++ linuxsampler/src/drivers/midi/MidiInstrumentMapper.h	Fri Dec 15 22:40:27 2006
 @@ -0,0 +1,178 @@
 +/***************************************************************************
@@ -4329,7 +4340,7 @@
  #endif // __LS_MIDI_H__
 Index: linuxsampler/src/engines/Engine.cpp
 diff -u /dev/null linuxsampler/src/engines/Engine.cpp:1.1
---- /dev/null	Mon Feb  5 11:42:55 2007
+--- /dev/null	Thu Feb  8 15:27:32 2007
 +++ linuxsampler/src/engines/Engine.cpp	Sun Jan  7 16:52:36 2007
 @@ -0,0 +1,30 @@
 +/***************************************************************************
@@ -4407,10 +4418,19 @@
      };
  
 Index: linuxsampler/src/engines/EngineChannel.cpp
-diff -u linuxsampler/src/engines/EngineChannel.cpp:1.3 linuxsampler/src/engines/EngineChannel.cpp:1.5
+diff -u linuxsampler/src/engines/EngineChannel.cpp:1.3 linuxsampler/src/engines/EngineChannel.cpp:1.7
 --- 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 @@
++++ linuxsampler/src/engines/EngineChannel.cpp	Wed Feb  7 22:51:18 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  *
+@@ -23,11 +23,24 @@
  
  #include "EngineChannel.h"
  
@@ -4431,10 +4451,11 @@
 +        uiMidiProgram = 0;
 +        bProgramChangeReceived = bMidiBankMsbReceived = bMidiBankLsbReceived = false;
 +        iMidiInstrumentMap = NO_MIDI_INSTRUMENT_MAP;
++        ResetMidiRpnController();
      }
  
      void EngineChannel::SetMute(int state) throw (Exception) {
-@@ -54,4 +66,96 @@
+@@ -54,4 +67,115 @@
          return bSolo;
      }
  
@@ -4530,11 +4551,38 @@
 +        iMidiInstrumentMap = MidiMap; // assign the new map ID
 +    }
 +
++    void EngineChannel::SetMidiRpnControllerMsb(uint8_t CtrlMSB) {
++        uiMidiRpnMsb = CtrlMSB;
++        bMidiRpnReceived = true;
++    }
++
++    void EngineChannel::SetMidiRpnControllerLsb(uint8_t CtrlLSB) {
++        uiMidiRpnLsb = CtrlLSB;
++        bMidiRpnReceived = true;
++    }
++
++    void EngineChannel::ResetMidiRpnController() {
++        uiMidiRpnMsb = uiMidiRpnLsb = 0;
++        bMidiRpnReceived = false;
++    }
++
++    int EngineChannel::GetMidiRpnController() {
++        return (bMidiRpnReceived) ? (uiMidiRpnMsb << 8) | uiMidiRpnLsb : -1;
++    }
++
  } // namespace LinuxSampler
 Index: linuxsampler/src/engines/EngineChannel.h
-diff -u linuxsampler/src/engines/EngineChannel.h:1.11 linuxsampler/src/engines/EngineChannel.h:1.14
+diff -u linuxsampler/src/engines/EngineChannel.h:1.11 linuxsampler/src/engines/EngineChannel.h:1.16
 --- 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
++++ linuxsampler/src/engines/EngineChannel.h	Wed Feb  7 22:51:18 2007
+@@ -1,6 +1,6 @@
+ /***************************************************************************
+  *                                                                         *
+- *   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  *
 @@ -26,12 +26,15 @@
  #include "../drivers/midi/MidiInputDevice.h"
  #include "../drivers/midi/MidiInputPort.h"
@@ -4575,7 +4623,7 @@
  
              /**
               * Sets the mute state of this channel.
-@@ -113,6 +126,105 @@
+@@ -113,6 +126,137 @@
               */
              bool GetSolo();
  
@@ -4678,10 +4726,42 @@
 +             */
 +            void SetMidiInstrumentMap(int MidiMap) throw (Exception);
 +
++            /**
++             * Set MIDI Registered Parameter Number (RPN) Controller
++             * (upper 8 bits / coarse).
++             */
++            void SetMidiRpnControllerMsb(uint8_t CtrlMSB);
++
++            /**
++             * Set MIDI Registered Parameter Number (RPN) Controller
++             * (lower 8 bits / fine).
++             */
++            void SetMidiRpnControllerLsb(uint8_t CtrlLSB);
++
++            /**
++             * Reset to no RPN controller currently selected.
++             */
++            void ResetMidiRpnController();
++
++            /**
++             * Get currently selected MIDI Registered Parameter Number
++             * (RPN) Controller, this method will return the already merged
++             * value (MSB and LSB value).
++             *
++             * @e WARNING: you have to call @c ResetMidiRpnController()
++             * after using this value, otherwise all subsequent MIDI CC #6
++             * (Data) messages are interpreted as RPN controller value
++             * messages.
++             *
++             * @returns currently selected RPN controller number, a negative
++             *          value if no RPN controller currently selected
++             */
++            int GetMidiRpnController();
++
              int iSamplerChannelIndex; ///< FIXME: nasty hack, might be removed (should be 'virtual EngineChannel* EngineChannel() = 0;', but due to cyclic dependencies only a void* solution would be possible ATM)
  
          protected:
-@@ -121,8 +233,15 @@
+@@ -121,8 +265,18 @@
              friend class EngineChannelFactory;
  
          private:
@@ -4692,9 +4772,12 @@
 +            uint8_t uiMidiProgram;
 +            uint8_t uiMidiBankMsb;
 +            uint8_t uiMidiBankLsb;
++            uint8_t uiMidiRpnMsb; ///< MIDI Registered Parameter Number (upper 8 bits / coarse)
++            uint8_t uiMidiRpnLsb; ///< MIDI Registered Parameter Number (lower 8 bits / fine)
 +            bool    bMidiBankMsbReceived;
 +            bool    bMidiBankLsbReceived;
 +            bool    bProgramChangeReceived;
++            bool    bMidiRpnReceived;
 +            int     iMidiInstrumentMap;
      };
  
@@ -4750,10 +4833,10 @@
  
  } // namespace LinuxSampler
 Index: linuxsampler/src/engines/FxSend.cpp
-diff -u /dev/null linuxsampler/src/engines/FxSend.cpp:1.3
---- /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 @@
+diff -u /dev/null linuxsampler/src/engines/FxSend.cpp:1.4
+--- /dev/null	Thu Feb  8 15:27:32 2007
++++ linuxsampler/src/engines/FxSend.cpp	Wed Feb  7 16:41:30 2007
+@@ -0,0 +1,150 @@
 +/***************************************************************************
 + *                                                                         *
 + *   LinuxSampler - modular, streaming capable sampler                     *
@@ -4784,6 +4867,8 @@
 +
 +#include <map>
 +
++#define DEFAULT_FX_SEND_LEVEL	0.0f
++
 +namespace LinuxSampler {
 +
 +    FxSend::FxSend(EngineChannel* pEngineChannel, uint8_t MidiCtrl, String Name) throw (Exception) {
@@ -4826,7 +4911,7 @@
 +        }
 +        __done:
 +
-+        fLevel = 0.3f; // default FX send level
++        fLevel = DEFAULT_FX_SEND_LEVEL;
 +    }
 +
 +    int FxSend::DestinationChannel(int SrcChan) {
@@ -4879,6 +4964,10 @@
 +        fLevel = float(iMidiValue & 0x7f) / 127.0f;
 +    }
 +
++    void FxSend::Reset() {
++        fLevel = DEFAULT_FX_SEND_LEVEL;
++    }
++
 +    uint8_t FxSend::MidiController() {
 +        return MidiFxSendController;
 +    }
@@ -4899,10 +4988,10 @@
 +
 +} // namespace LinuxSampler
 Index: linuxsampler/src/engines/FxSend.h
-diff -u /dev/null linuxsampler/src/engines/FxSend.h:1.3
---- /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 @@
+diff -u /dev/null linuxsampler/src/engines/FxSend.h:1.4
+--- /dev/null	Thu Feb  8 15:27:32 2007
++++ linuxsampler/src/engines/FxSend.h	Wed Feb  7 16:41:30 2007
+@@ -0,0 +1,156 @@
 +/***************************************************************************
 + *                                                                         *
 + *   LinuxSampler - modular, streaming capable sampler                     *
@@ -5014,6 +5103,12 @@
 +            void SetLevel(uint8_t iMidiValue);
 +
 +            /**
++             * Reset send level to the default send level (i.e. due to a
++             * MIDI "reset all controllers" message).
++             */
++            void Reset();
++
++            /**
 +             * Returns the MIDI controller number which can alter the effect
 +             * send's send level.
 +             */
@@ -5055,7 +5150,7 @@
 +#endif // LS_FXSEND_H
 Index: linuxsampler/src/engines/InstrumentManager.cpp
 diff -u /dev/null linuxsampler/src/engines/InstrumentManager.cpp:1.1
---- /dev/null	Mon Feb  5 11:42:55 2007
+--- /dev/null	Thu Feb  8 15:27:32 2007
 +++ linuxsampler/src/engines/InstrumentManager.cpp	Mon Nov 27 22:34:54 2006
 @@ -0,0 +1,49 @@
 +/***************************************************************************
@@ -5109,7 +5204,7 @@
 +} // namespace LinuxSampler
 Index: linuxsampler/src/engines/InstrumentManager.h
 diff -u /dev/null linuxsampler/src/engines/InstrumentManager.h:1.2
---- /dev/null	Mon Feb  5 11:42:55 2007
+--- /dev/null	Thu Feb  8 15:27:32 2007
 +++ linuxsampler/src/engines/InstrumentManager.h	Wed Nov 29 20:48:38 2006
 @@ -0,0 +1,117 @@
 +/***************************************************************************
@@ -5230,13 +5325,13 @@
 +
 +#endif // __LS_INSTRUMENTMANAGER_H__
 Index: linuxsampler/src/engines/InstrumentManagerThread.cpp
-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 @@
+diff -u /dev/null linuxsampler/src/engines/InstrumentManagerThread.cpp:1.5
+--- /dev/null	Thu Feb  8 15:27:32 2007
++++ linuxsampler/src/engines/InstrumentManagerThread.cpp	Wed Feb  7 16:41:30 2007
+@@ -0,0 +1,129 @@
 +/***************************************************************************
 + *                                                                         *
-+ *   Copyright (C) 2005, 2006 Christian Schoenebeck                        *
++ *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *
 + *                                                                         *
 + *   This library is free software; you can redistribute it and/or modify  *
 + *   it under the terms of the GNU General Public License as published by  *
@@ -5341,9 +5436,10 @@
 +                        default:
 +                            std::cerr << "InstrumentManagerThread: unknown command - BUG!\n" << std::flush;
 +                    }
-+                }
-+                catch (Exception e) {
++                } catch (Exception e) {
 +                    e.PrintMessage();
++                } catch (...) {
++                    std::cerr << "InstrumentManagerThread: some exception occured, could not finish task\n" << std::flush;
 +                }
 +
 +                // remove processed command from queue
@@ -5364,7 +5460,7 @@
 +} // namespace LinuxSampler
 Index: linuxsampler/src/engines/InstrumentManagerThread.h
 diff -u /dev/null linuxsampler/src/engines/InstrumentManagerThread.h:1.3
---- /dev/null	Mon Feb  5 11:42:55 2007
+--- /dev/null	Thu Feb  8 15:27:32 2007
 +++ linuxsampler/src/engines/InstrumentManagerThread.h	Tue Dec 19 20:34:08 2006
 @@ -0,0 +1,70 @@
 +/***************************************************************************
@@ -5625,9 +5721,9 @@
  
      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.72
+diff -u linuxsampler/src/engines/gig/Engine.cpp:1.65 linuxsampler/src/engines/gig/Engine.cpp:1.75
 --- 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
++++ linuxsampler/src/engines/gig/Engine.cpp	Wed Feb  7 22:51:19 2007
 @@ -2,8 +2,8 @@
   *                                                                         *
   *   LinuxSampler - modular, streaming capable sampler                     *
@@ -5838,16 +5934,29 @@
       * 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.
-@@ -608,6 +707,8 @@
+@@ -608,6 +707,11 @@
          if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted
          #endif
  
 +        if (!pEngineChannel->pInstrument) return; // ignore if no instrument loaded
 +
++        //HACK: we should better add the transpose value only to the most mandatory places (like for retrieving the region and calculating the tuning), because otherwise voices will unintendedly survive when changing transpose while playing
++        itNoteOnEvent->Param.Note.Key += pEngineChannel->GlobalTranspose;
++
          const int key = itNoteOnEvent->Param.Note.Key;
          midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[key];
  
-@@ -705,7 +806,7 @@
+@@ -695,6 +799,9 @@
+         if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted
+         #endif
+ 
++        //HACK: we should better add the transpose value only to the most mandatory places (like for retrieving the region and calculating the tuning), because otherwise voices will unintendedly survive when changing transpose while playing
++        itNoteOffEvent->Param.Note.Key += pEngineChannel->GlobalTranspose;
++
+         const int iKey = itNoteOffEvent->Param.Note.Key;
+         midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[iKey];
+         pKey->KeyPressed = false; // the MIDI key was now released
+@@ -705,7 +812,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)
@@ -5856,7 +5965,7 @@
              bool bOtherKeysPressed = false;
              if (iKey == pEngineChannel->SoloKey) {
                  pEngineChannel->SoloKey = -1;
-@@ -768,7 +869,7 @@
+@@ -768,7 +875,7 @@
              itNoteOffEventOnKeyList->Type = Event::type_release; // transform event type
  
              // spawn release triggered voice(s) if needed
@@ -5865,7 +5974,7 @@
                  // 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 @@
+@@ -963,6 +1070,12 @@
                      std::cerr << "gig::Engine::LaunchVoice() Error: Unknown dimension\n" << std::flush;
              }
          }
@@ -5878,7 +5987,7 @@
          ::gig::DimensionRegion* pDimRgn = pRegion->GetDimensionRegionByValue(DimValues);
  
          // no need to continue if sample is silent
-@@ -1192,6 +1299,13 @@
+@@ -1192,6 +1305,13 @@
  
              uint keygroup = itVoice->KeyGroup;
  
@@ -5892,7 +6001,7 @@
              // free the voice object
              pVoicePool->free(itVoice);
  
-@@ -1236,6 +1350,7 @@
+@@ -1236,14 +1356,29 @@
          // update controller value in the engine channel's controller table
          pEngineChannel->ControllerTable[itControlChangeEvent->Param.CC.Controller] = itControlChangeEvent->Param.CC.Value;
  
@@ -5900,8 +6009,22 @@
          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 +1358,7 @@
+                 break;
              }
++            case 6: { // data entry (currently only used for RPN controllers)
++                if (pEngineChannel->GetMidiRpnController() == 2) { // coarse tuning in half tones
++                    int transpose = (int) itControlChangeEvent->Param.CC.Value - 64;
++                    // limit to +- two octaves for now
++                    transpose = RTMath::Min(transpose,  24);
++                    transpose = RTMath::Max(transpose, -24);
++                    pEngineChannel->GlobalTranspose = transpose;
++                    // workaround, so we won't have hanging notes
++                    ReleaseAllVoices(pEngineChannel, itControlChangeEvent);
++                }
++                // to avoid other MIDI CC #6 messages to be misenterpreted as RPN controller data
++                pEngineChannel->ResetMidiRpnController();
++                break;
++            }
              case 7: { // volume
                  //TODO: not sample accurate yet
 -                pEngineChannel->GlobalVolume = VolumeCurve[itControlChangeEvent->Param.CC.Value] *  CONFIG_GLOBAL_ATTENUATION;
@@ -5909,9 +6032,24 @@
                  pEngineChannel->bStatusChanged = true; // engine channel status has changed, so set notify flag
                  break;
              }
-@@ -1374,6 +1489,15 @@
+@@ -1345,6 +1480,14 @@
+                 }
                  break;
              }
++            case 100: { // RPN controller LSB
++                pEngineChannel->SetMidiRpnControllerLsb(itControlChangeEvent->Param.CC.Value);
++                break;
++            }
++            case 101: { // RPN controller MSB
++                pEngineChannel->SetMidiRpnControllerMsb(itControlChangeEvent->Param.CC.Value);
++                break;
++            }
+ 
+ 
+             // Channel Mode Messages
+@@ -1374,6 +1517,15 @@
+                 break;
+             }
          }
 +
 +        // handle FX send controllers
@@ -5925,7 +6063,7 @@
      }
  
      /**
-@@ -1382,7 +1506,7 @@
+@@ -1382,7 +1534,7 @@
       *  @param itSysexEvent - sysex data size and time stamp of the sysex event
       */
      void Engine::ProcessSysex(Pool<Event>::Iterator& itSysexEvent) {
@@ -5934,7 +6072,7 @@
  
          uint8_t exclusive_status, id;
          if (!reader.pop(&exclusive_status)) goto free_sysex_data;
-@@ -1401,7 +1525,7 @@
+@@ -1401,7 +1553,7 @@
  
                  // command address
                  uint8_t addr[3]; // 2 byte addr MSB, followed by 1 byte addr LSB)
@@ -5943,7 +6081,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 +1572,8 @@
+@@ -1448,8 +1600,8 @@
       *                     question
       * @param DataSize   - size of the GS message data (in bytes)
       */
@@ -5954,12 +6092,12 @@
          uint bytes = 3 /*addr*/ + DataSize;
          uint8_t addr_and_data[bytes];
          reader.read(&addr_and_data[0], bytes);
-@@ -1568,10 +1692,14 @@
+@@ -1568,10 +1720,14 @@
      }
  
      String Engine::Version() {
 -        String s = "$Revision: 1.65 $";
-+        String s = "$Revision: 1.72 $";
++        String s = "$Revision: 1.75 $";
          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword
      }
  
@@ -5970,7 +6108,7 @@
      // static constant initializers
      const float* Engine::VolumeCurve(InitVolumeCurve());
      const float* Engine::PanCurve(InitPanCurve());
-@@ -1614,4 +1742,28 @@
+@@ -1614,4 +1770,28 @@
          return y;
      }
  
@@ -6085,9 +6223,18 @@
              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.27
+diff -u linuxsampler/src/engines/gig/EngineChannel.cpp:1.21 linuxsampler/src/engines/gig/EngineChannel.cpp:1.29
 --- 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
++++ linuxsampler/src/engines/gig/EngineChannel.cpp	Wed Feb  7 18:45:19 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  *
 @@ -30,7 +30,7 @@
          pEngine      = NULL;
          pInstrument  = NULL;
@@ -6114,7 +6261,7 @@
      }
  
      /**
-@@ -160,27 +163,35 @@
+@@ -160,30 +163,36 @@
       * @see PrepareLoadInstrument()
       */
      void EngineChannel::LoadInstrument() {
@@ -6154,16 +6301,20 @@
 -            instrid.iInstrument = InstrumentIdx;
 -            pInstrument = Engine::instruments.Borrow(instrid, this);
 -            if (!pInstrument) {
+-                InstrumentStat = -1;
+-                dmsg(1,("no instrument loaded!!!\n"));
+-                exit(EXIT_FAILURE);
 +            InstrumentManager::instrument_id_t instrid;
 +            instrid.FileName  = InstrumentFile;
 +            instrid.Index     = InstrumentIdx;
 +            newInstrument = Engine::instruments.Borrow(instrid, this);
 +            if (!newInstrument) {
-                 InstrumentStat = -1;
-                 dmsg(1,("no instrument loaded!!!\n"));
-                 exit(EXIT_FAILURE);
-@@ -202,23 +213,14 @@
++                throw InstrumentResourceManagerException("resource was not created");
+             }
          }
+         catch (RIFF::Exception e) {
+@@ -202,23 +211,14 @@
+         }
  
          // rebuild ActiveKeyGroups map with key groups of current instrument
 -        for (::gig::Region* pRegion = pInstrument->GetFirstRegion(); pRegion; pRegion = pInstrument->GetNextRegion())
@@ -6190,7 +6341,7 @@
      }
  
      /**
-@@ -269,8 +271,17 @@
+@@ -269,8 +269,17 @@
          }
          AudioDeviceChannelLeft  = 0;
          AudioDeviceChannelRight = 1;
@@ -6210,7 +6361,7 @@
          MidiInputPort::AddSysexListener(pEngine);
      }
  
-@@ -297,9 +308,19 @@
+@@ -297,9 +306,19 @@
              Engine::FreeEngine(this, oldAudioDevice);
              AudioDeviceChannelLeft  = -1;
              AudioDeviceChannelRight = -1;
@@ -6230,7 +6381,7 @@
      void EngineChannel::SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) {
          if (!pEngine || !pEngine->pAudioOutputDevice) throw AudioOutputException("No audio output device connected yet.");
  
-@@ -307,11 +328,11 @@
+@@ -307,11 +326,11 @@
          if (!pChannel) throw AudioOutputException("Invalid audio output device channel " + ToString(AudioDeviceChannel));
          switch (EngineAudioChannel) {
              case 0: // left output channel
@@ -6244,7 +6395,7 @@
                  AudioDeviceChannelRight = AudioDeviceChannel;
                  break;
              default:
-@@ -352,6 +373,62 @@
+@@ -352,6 +371,62 @@
          return midiChannel;
      }
  
@@ -6307,7 +6458,7 @@
      /**
       *  Will be called by the MIDIIn Thread to let the audio thread trigger a new
       *  voice for the given key. This method is meant for real time rendering,
-@@ -552,7 +629,8 @@
+@@ -552,11 +627,20 @@
          Pitch          = 0;
          SustainPedal   = false;
          SostenutoPedal = false;
@@ -6316,8 +6467,20 @@
 +        MidiVolume     = 1.0;
          GlobalPanLeft  = 1.0f;
          GlobalPanRight = 1.0f;
++        GlobalTranspose = 0;
          // set all MIDI controller values to zero
-@@ -573,7 +651,7 @@
+         memset(ControllerTable, 0x00, 129);
++        // reset all FX Send levels
++        for (
++            std::vector<FxSend*>::iterator iter = fxSends.begin();
++            iter != fxSends.end(); iter++
++        ) {
++            (*iter)->Reset();
++        }
+     }
+ 
+     /**
+@@ -573,7 +657,7 @@
       *                  current audio cycle
       */
      void EngineChannel::ImportEvents(uint Samples) {
@@ -6326,7 +6489,7 @@
          Event* pEvent;
          while (true) {
              // get next event from input event queue
-@@ -595,6 +673,29 @@
+@@ -595,6 +679,29 @@
          eventQueueReader.free(); // free all copied events from input queue
      }
  
@@ -6357,9 +6520,18 @@
          return GlobalVolume;
      }
 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
+diff -u linuxsampler/src/engines/gig/EngineChannel.h:1.19 linuxsampler/src/engines/gig/EngineChannel.h:1.23
 --- 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
++++ linuxsampler/src/engines/gig/EngineChannel.h	Wed Feb  7 18:45:19 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  *
 @@ -24,13 +24,10 @@
  #ifndef __LS_GIG_ENGINECHANNEL_H__
  #define __LS_GIG_ENGINECHANNEL_H__
@@ -6421,15 +6593,16 @@
              float                   GlobalPanLeft;
              float                   GlobalPanRight;
              int                     Pitch;                    ///< Current (absolute) MIDI pitch value.
-@@ -121,6 +124,7 @@
+@@ -121,6 +124,8 @@
              int                     InstrumentStat;
              int                     iEngineIndexSelf;         ///< Reflects the index of this EngineChannel in the Engine's ArrayList.
              bool                    bStatusChanged;           ///< true in case an engine parameter has changed (e.g. new instrument, another volumet)
 +            std::vector<FxSend*>    fxSends;
++            int                     GlobalTranspose;          ///< amount of semi tones all notes should be transposed
  
              void ResetControllers();
              void ClearEventLists();
-@@ -132,6 +136,7 @@
+@@ -132,6 +137,7 @@
  
          private:
              void ResetInternal();
@@ -7379,7 +7552,7 @@
 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	Wed Jun 28 00:57:37 2006
-+++ linuxsampler/src/network/lscpinstrumentloader.cpp	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/network/lscpinstrumentloader.cpp	Thu Feb  8 15:27:32 2007
 @@ -1,73 +0,0 @@
 -/***************************************************************************
 - *                                                                         *
@@ -7457,7 +7630,7 @@
 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 03:01:14 2005
-+++ linuxsampler/src/network/lscpinstrumentloader.h	Mon Feb  5 11:42:55 2007
++++ linuxsampler/src/network/lscpinstrumentloader.h	Thu Feb  8 15:27:32 2007
 @@ -1,60 +0,0 @@
 -/***************************************************************************
 - *                                                                         *




More information about the Demudi-commits mailing list