summaryrefslogtreecommitdiff
path: root/muse2/synti/fluidsynth
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2012-11-13 08:36:20 +0000
committerTim E. Real <termtech@rogers.com>2012-11-13 08:36:20 +0000
commita247e60904516800a3874688e368979b9b1e7bf8 (patch)
tree0df00fdfbc69e919234a4ad65369c4787c934d9c /muse2/synti/fluidsynth
parent33250e6a085d51efab1b061e13bd635c804209d0 (diff)
Added aftertouch controller to fluidsynth, and aftertouch/poly-aftertouch to DSSI.
Diffstat (limited to 'muse2/synti/fluidsynth')
-rw-r--r--muse2/synti/fluidsynth/fluidsynti.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/muse2/synti/fluidsynth/fluidsynti.cpp b/muse2/synti/fluidsynth/fluidsynti.cpp
index 46f20156..3dd45105 100644
--- a/muse2/synti/fluidsynth/fluidsynti.cpp
+++ b/muse2/synti/fluidsynth/fluidsynti.cpp
@@ -76,6 +76,7 @@ FluidCtrl FluidSynth::fluidCtrl[] = {
{ "Channel reverb send", MusECore::CTRL_REVERB_SEND, 0, 127, 40},
{ "Channel chorus send", MusECore::CTRL_CHORUS_SEND, 0, 127, 0},
{ "Pitch", MusECore::CTRL_PITCH, -8192, 8191, 0},
+ { "Channel pressure", MusECore::CTRL_AFTERTOUCH, 0, 127, 0},
// Added by T356
{ "Pitch bend sensitivity", FS_PITCHWHEELSENS, 0, 24, 2}
};
@@ -508,7 +509,9 @@ bool FluidSynth::processEvent(const MusECore::MidiPlayEvent& ev)
case MusECore::ME_PITCHBEND:
setController(ev.channel(), MusECore::CTRL_PITCH, ev.dataA(), false);
break;
-
+ case MusECore::ME_AFTERTOUCH:
+ setController(ev.channel(), MusECore::CTRL_AFTERTOUCH, ev.dataA(), false);
+ break;
case MusECore::ME_PROGRAM:
setController(ev.channel(), MusECore::CTRL_PROGRAM, ev.dataA(), false);
break;
@@ -983,15 +986,20 @@ void FluidSynth::setController(int channel, int id, int val, bool fromGui)
//
case MusECore::CTRL_PITCH:
// MusE's range is from -8192 to +8191, fluidsynth seems to be [0, 16384]
- val +=8192;
- err = fluid_synth_pitch_bend (fluidsynth, channel, val);
+ if(val != MusECore::CTRL_VAL_UNKNOWN)
+ {
+ val +=8192;
+ err = fluid_synth_pitch_bend (fluidsynth, channel, val);
+ }
+ break;
+ case MusECore::CTRL_AFTERTOUCH:
+ if(val != MusECore::CTRL_VAL_UNKNOWN)
+ err = fluid_synth_channel_pressure (fluidsynth, channel, val);
break;
-
- // Added by T356
case FS_PITCHWHEELSENS:
- err = fluid_synth_pitch_wheel_sens(fluidsynth, channel, val);
+ if(val != MusECore::CTRL_VAL_UNKNOWN)
+ err = fluid_synth_pitch_wheel_sens(fluidsynth, channel, val);
break;
-
case MusECore::CTRL_PROGRAM: {
//Check if MusE is trying to set a preset on an unspecified font. If so, ignore.
if (FS_DEBUG)