Hi Christian

I was missing some changes from my linuxsampler patch earlier. I've attached an updated one.

All the best,
Ivan

diff -Naur linuxsampler_orig/src/engines/common/AbstractVoice.cpp linuxsampler_mod/src/engines/common/AbstractVoice.cpp
--- linuxsampler_orig/src/engines/common/AbstractVoice.cpp	2019-10-03 16:44:03.484547000 +0100
+++ linuxsampler_mod/src/engines/common/AbstractVoice.cpp	2019-10-08 04:47:03.067579768 +0100
@@ -29,8 +29,8 @@
 
     AbstractVoice::AbstractVoice(SignalUnitRack* pRack): pSignalUnitRack(pRack) {
         pEngineChannel = NULL;
-        pLFO1 = new LFOClusterUnsigned(1.0f);  // amplitude LFO (0..1 range)
-        pLFO2 = new LFOClusterUnsigned(1.0f);  // filter LFO (0..1 range)
+        pLFO1 = new LFOClusterSigned(4800.0f); // amplitude LFO (-4800..4800 range)
+        pLFO2 = new LFOClusterSigned(4800.0f); // filter LFO (-4800..4800 range)
         pLFO3 = new LFOClusterSigned(1200.0f); // pitch LFO (-1200..+1200 range)
         PlaybackState = playback_state_end;
         SynthesisMode = 0; // set all mode bits to 0 first
@@ -551,8 +551,8 @@
                 if (EG3.active()) fModPitch *= EG3.render();
 
                 // process low frequency oscillators
-                if (bLFO1Enabled) fModVolume   *= (1.0f - pLFO1->render());
-                if (bLFO2Enabled) fFinalCutoff *= (1.0f - pLFO2->render());
+                if (bLFO1Enabled) fModVolume   *= (1.0f - (pLFO1->render() + 4800.0f) / 9600.0f);
+                if (bLFO2Enabled) fFinalCutoff *= (1.0f - (pLFO2->render() + 4800.0f) / 9600.0f);
                 if (bLFO3Enabled) fModPitch *= RTMath::CentsToFreqRatio(pLFO3->render());
             } else {
                 // if the voice was killed in this subfragment, enter fade out stage
diff -Naur linuxsampler_orig/src/engines/common/AbstractVoice.h linuxsampler_mod/src/engines/common/AbstractVoice.h
--- linuxsampler_orig/src/engines/common/AbstractVoice.h	2019-10-03 16:44:03.890547000 +0100
+++ linuxsampler_mod/src/engines/common/AbstractVoice.h	2019-10-07 23:38:35.810832458 +0100
@@ -136,8 +136,8 @@
             gig::EGDecay                EG3;                ///< Envelope Generator 3 (Pitch) TODO: use common EG instead?
             midi_ctrl                   VCFCutoffCtrl;
             midi_ctrl                   VCFResonanceCtrl;
-            LFOClusterUnsigned*         pLFO1;               ///< Low Frequency Oscillator 1 (Amplification)
-            LFOClusterUnsigned*         pLFO2;               ///< Low Frequency Oscillator 2 (Filter cutoff frequency)
+            LFOClusterSigned*           pLFO1;               ///< Low Frequency Oscillator 1 (Amplification)
+            LFOClusterSigned*           pLFO2;               ///< Low Frequency Oscillator 2 (Filter cutoff frequency)
             LFOClusterSigned*           pLFO3;               ///< Low Frequency Oscillator 3 (Pitch)
             bool                        bLFO1Enabled;        ///< Should we use the Amplitude LFO for this voice?
             bool                        bLFO2Enabled;        ///< Should we use the Filter Cutoff LFO for this voice?
diff -Naur linuxsampler_orig/src/engines/common/AbstractVoice.lo linuxsampler_mod/src/engines/common/AbstractVoice.lo
--- linuxsampler_orig/src/engines/common/AbstractVoice.lo	1970-01-01 01:00:00.000000000 +0100
+++ linuxsampler_mod/src/engines/common/AbstractVoice.lo	2019-10-07 23:38:35.810832458 +0100
@@ -0,0 +1,12 @@
+# AbstractVoice.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.6
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/AbstractVoice.o'
+
+# Name of the non-PIC object
+non_pic_object='AbstractVoice.o'
+
diff -Naur linuxsampler_orig/src/engines/gig/Voice.cpp linuxsampler_mod/src/engines/gig/Voice.cpp
--- linuxsampler_orig/src/engines/gig/Voice.cpp	2019-10-07 23:35:45.656696933 +0100
+++ linuxsampler_mod/src/engines/gig/Voice.cpp	2019-10-07 23:38:41.024836541 +0100
@@ -261,27 +261,27 @@
             case ::gig::lfo1_ctrl_internal:
                 lfo1_internal_depth  = pRegion->LFO1InternalDepth;
                 pLFO1->ExtController = 0; // no external controller
-                bLFO1Enabled         = (lfo1_internal_depth > 0);
+                bLFO1Enabled         = (lfo1_internal_depth != 0);
                 break;
             case ::gig::lfo1_ctrl_modwheel:
                 lfo1_internal_depth  = 0;
                 pLFO1->ExtController = 1; // MIDI controller 1
-                bLFO1Enabled         = (pRegion->LFO1ControlDepth > 0);
+                bLFO1Enabled         = (pRegion->LFO1ControlDepth != 0);
                 break;
             case ::gig::lfo1_ctrl_breath:
                 lfo1_internal_depth  = 0;
                 pLFO1->ExtController = 2; // MIDI controller 2
-                bLFO1Enabled         = (pRegion->LFO1ControlDepth > 0);
+                bLFO1Enabled         = (pRegion->LFO1ControlDepth != 0);
                 break;
             case ::gig::lfo1_ctrl_internal_modwheel:
                 lfo1_internal_depth  = pRegion->LFO1InternalDepth;
                 pLFO1->ExtController = 1; // MIDI controller 1
-                bLFO1Enabled         = (lfo1_internal_depth > 0 || pRegion->LFO1ControlDepth > 0);
+                bLFO1Enabled         = (lfo1_internal_depth != 0 || pRegion->LFO1ControlDepth != 0);
                 break;
             case ::gig::lfo1_ctrl_internal_breath:
                 lfo1_internal_depth  = pRegion->LFO1InternalDepth;
                 pLFO1->ExtController = 2; // MIDI controller 2
-                bLFO1Enabled         = (lfo1_internal_depth > 0 || pRegion->LFO1ControlDepth > 0);
+                bLFO1Enabled         = (lfo1_internal_depth != 0 || pRegion->LFO1ControlDepth != 0);
                 break;
             default:
                 lfo1_internal_depth  = 0;
@@ -319,27 +319,27 @@
             case ::gig::lfo2_ctrl_internal:
                 lfo2_internal_depth  = pRegion->LFO2InternalDepth;
                 pLFO2->ExtController = 0; // no external controller
-                bLFO2Enabled         = (lfo2_internal_depth > 0);
+                bLFO2Enabled         = (lfo2_internal_depth != 0);
                 break;
             case ::gig::lfo2_ctrl_modwheel:
                 lfo2_internal_depth  = 0;
                 pLFO2->ExtController = 1; // MIDI controller 1
-                bLFO2Enabled         = (pRegion->LFO2ControlDepth > 0);
+                bLFO2Enabled         = (pRegion->LFO2ControlDepth != 0);
                 break;
             case ::gig::lfo2_ctrl_foot:
                 lfo2_internal_depth  = 0;
                 pLFO2->ExtController = 4; // MIDI controller 4
-                bLFO2Enabled         = (pRegion->LFO2ControlDepth > 0);
+                bLFO2Enabled         = (pRegion->LFO2ControlDepth != 0);
                 break;
             case ::gig::lfo2_ctrl_internal_modwheel:
                 lfo2_internal_depth  = pRegion->LFO2InternalDepth;
                 pLFO2->ExtController = 1; // MIDI controller 1
-                bLFO2Enabled         = (lfo2_internal_depth > 0 || pRegion->LFO2ControlDepth > 0);
+                bLFO2Enabled         = (lfo2_internal_depth != 0 || pRegion->LFO2ControlDepth != 0);
                 break;
             case ::gig::lfo2_ctrl_internal_foot:
                 lfo2_internal_depth  = pRegion->LFO2InternalDepth;
                 pLFO2->ExtController = 4; // MIDI controller 4
-                bLFO2Enabled         = (lfo2_internal_depth > 0 || pRegion->LFO2ControlDepth > 0);
+                bLFO2Enabled         = (lfo2_internal_depth != 0 || pRegion->LFO2ControlDepth != 0);
                 break;
             default:
                 lfo2_internal_depth  = 0;
@@ -373,12 +373,12 @@
             case ::gig::lfo3_ctrl_internal:
                 lfo3_internal_depth  = pRegion->LFO3InternalDepth;
                 pLFO3->ExtController = 0; // no external controller
-                bLFO3Enabled         = (lfo3_internal_depth > 0);
+                bLFO3Enabled         = (lfo3_internal_depth != 0);
                 break;
             case ::gig::lfo3_ctrl_modwheel:
                 lfo3_internal_depth  = 0;
                 pLFO3->ExtController = 1; // MIDI controller 1
-                bLFO3Enabled         = (pRegion->LFO3ControlDepth > 0);
+                bLFO3Enabled         = (pRegion->LFO3ControlDepth != 0);
                 break;
             case ::gig::lfo3_ctrl_aftertouch:
                 lfo3_internal_depth  = 0;
@@ -388,12 +388,12 @@
             case ::gig::lfo3_ctrl_internal_modwheel:
                 lfo3_internal_depth  = pRegion->LFO3InternalDepth;
                 pLFO3->ExtController = 1; // MIDI controller 1
-                bLFO3Enabled         = (lfo3_internal_depth > 0 || pRegion->LFO3ControlDepth > 0);
+                bLFO3Enabled         = (lfo3_internal_depth != 0 || pRegion->LFO3ControlDepth != 0);
                 break;
             case ::gig::lfo3_ctrl_internal_aftertouch:
                 lfo3_internal_depth  = pRegion->LFO3InternalDepth;
                 pLFO3->ExtController = CTRL_TABLE_IDX_AFTERTOUCH;
-                bLFO3Enabled         = (lfo3_internal_depth > 0 || pRegion->LFO3ControlDepth > 0);
+                bLFO3Enabled         = (lfo3_internal_depth != 0 || pRegion->LFO3ControlDepth != 0);
                 break;
             default:
                 lfo3_internal_depth  = 0;
_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel

Reply via email to