Hi Christian
I really like the graphical render of the LFO settings! The attached
gigedit patch connects all of the LFO controls to queue_draw() so that
the graphic gets redrawn while the user is making changes to any of them.
I noticed while I was using gigedit that the range for Control Depth and
Internal Depth of LFO1 and LFO2 is 0..1200. This should actually be
-4800..4800 according to GSEdit3. The same values are present in LS when
the LFO1 and LFO2 objects are being instantiated. Also the logic for
enabling all three LFOs tests if the Control Depth and Internal Depth
are > 0 instead of if they are != 0.
I've attached two patches to show you where I think changes need to be
made, these are tentative.
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-07 23:38:35.809832458 +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
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;
diff -Naur gigedit_orig/src/gigedit/dimregionedit.cpp gigedit_mod/src/gigedit/dimregionedit.cpp
--- gigedit_orig/src/gigedit/dimregionedit.cpp 2019-10-07 22:57:26.709352908 +0100
+++ gigedit_mod/src/gigedit/dimregionedit.cpp 2019-10-07 23:09:59.563723995 +0100
@@ -354,8 +354,8 @@
eLFO1Wave(_("Wave Form")),
eLFO1Frequency(_("Frequency"), 0.1, 10, 2),
eLFO1Phase(_("Phase"), 0.0, 360.0, 2),
- eLFO1InternalDepth(_("Internal depth"), 0, 1200),
- eLFO1ControlDepth(_("Control depth"), 0, 1200),
+ eLFO1InternalDepth(_("Internal depth"), -4800, 4800),
+ eLFO1ControlDepth(_("Control depth"), -4800, 4800),
eLFO1Controller(_("Controller")),
eLFO1FlipPhase(_("Flip phase")),
eLFO1Sync(_("Sync")),
@@ -374,8 +374,8 @@
eLFO2Wave(_("Wave Form")),
eLFO2Frequency(_("Frequency"), 0.1, 10, 2),
eLFO2Phase(_("Phase"), 0.0, 360.0, 2),
- eLFO2InternalDepth(_("Internal depth"), 0, 1200),
- eLFO2ControlDepth(_("Control depth"), 0, 1200),
+ eLFO2InternalDepth(_("Internal depth"), -4800, 4800),
+ eLFO2ControlDepth(_("Control depth"), -4800, 4800),
eLFO2Controller(_("Controller")),
eLFO2FlipPhase(_("Flip phase")),
eLFO2Sync(_("Sync")),
@@ -384,8 +384,8 @@
eLFO3Wave(_("Wave Form")),
eLFO3Frequency(_("Frequency"), 0.1, 10, 2),
eLFO3Phase(_("Phase"), 0.0, 360.0, 2),
- eLFO3InternalDepth(_("Internal depth"), 0, 1200),
- eLFO3ControlDepth(_("Control depth"), 0, 1200),
+ eLFO3InternalDepth(_("Internal depth"), -4800, 4800),
+ eLFO3ControlDepth(_("Control depth"), -4800, 4800),
eLFO3Controller(_("Controller")),
eLFO3FlipPhase(_("Flip phase")),
eLFO3Sync(_("Sync")),
@@ -799,9 +799,30 @@
#endif
rowno++;
}
+ eLFO1Wave.signal_value_changed().connect(
+ sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
+ );
+ eLFO1Frequency.signal_value_changed().connect(
+ sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
+ );
+ eLFO1Phase.signal_value_changed().connect(
+ sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
+ );
+ eLFO1InternalDepth.signal_value_changed().connect(
+ sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
+ );
+ eLFO1ControlDepth.signal_value_changed().connect(
+ sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
+ );
+ eLFO1Controller.signal_value_changed().connect(
+ sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
+ );
eLFO1FlipPhase.signal_value_changed().connect(
sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
);
+ eLFO1Sync.signal_value_changed().connect(
+ sigc::mem_fun(lfo1Graph, &LFOGraph::queue_draw)
+ );
nextPage();
@@ -987,9 +1008,30 @@
#endif
rowno++;
}
+ eLFO2Wave.signal_value_changed().connect(
+ sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
+ );
+ eLFO2Frequency.signal_value_changed().connect(
+ sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
+ );
+ eLFO2Phase.signal_value_changed().connect(
+ sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
+ );
+ eLFO2InternalDepth.signal_value_changed().connect(
+ sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
+ );
+ eLFO2ControlDepth.signal_value_changed().connect(
+ sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
+ );
+ eLFO2Controller.signal_value_changed().connect(
+ sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
+ );
eLFO2FlipPhase.signal_value_changed().connect(
sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
);
+ eLFO2Sync.signal_value_changed().connect(
+ sigc::mem_fun(lfo2Graph, &LFOGraph::queue_draw)
+ );
nextPage();
@@ -1036,9 +1078,30 @@
#endif
rowno++;
}
+ eLFO3Wave.signal_value_changed().connect(
+ sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
+ );
+ eLFO3Frequency.signal_value_changed().connect(
+ sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
+ );
+ eLFO3Phase.signal_value_changed().connect(
+ sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
+ );
+ eLFO3InternalDepth.signal_value_changed().connect(
+ sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
+ );
+ eLFO3ControlDepth.signal_value_changed().connect(
+ sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
+ );
+ eLFO3Controller.signal_value_changed().connect(
+ sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
+ );
eLFO3FlipPhase.signal_value_changed().connect(
sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
);
+ eLFO3Sync.signal_value_changed().connect(
+ sigc::mem_fun(lfo3Graph, &LFOGraph::queue_draw)
+ );
nextPage();
_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel