summaryrefslogtreecommitdiff
path: root/muse2/synti
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/synti')
-rw-r--r--muse2/synti/deicsonze/deicsonze.cpp2
-rw-r--r--muse2/synti/deicsonze/deicsonze.h2
-rw-r--r--muse2/synti/fluid/fluid.cpp2
-rw-r--r--muse2/synti/fluid/fluid.h2
-rw-r--r--muse2/synti/fluidsynth/fluidsynti.cpp20
-rw-r--r--muse2/synti/fluidsynth/fluidsynti.h2
-rw-r--r--muse2/synti/libsynti/mess.h2
-rw-r--r--muse2/synti/simpledrums2/simpledrums.cpp2
-rw-r--r--muse2/synti/simpledrums2/simpledrums.h2
9 files changed, 22 insertions, 14 deletions
diff --git a/muse2/synti/deicsonze/deicsonze.cpp b/muse2/synti/deicsonze/deicsonze.cpp
index 7d3f8995..7ca0deed 100644
--- a/muse2/synti/deicsonze/deicsonze.cpp
+++ b/muse2/synti/deicsonze/deicsonze.cpp
@@ -3708,7 +3708,7 @@ bool DeicsOnze::setController(int ch, int ctrl, int val, bool fromGui) {
// getPatchName
//---------------------------------------------------------
-const char* DeicsOnze::getPatchName(int ch, int val, int) const {
+const char* DeicsOnze::getPatchName(int ch, int val, bool) const {
if(_global.channel[ch].isEnable) {
Preset* p_preset;
int hbank = (val & 0xff0000) >> 16;
diff --git a/muse2/synti/deicsonze/deicsonze.h b/muse2/synti/deicsonze/deicsonze.h
index 124c8d46..06e29fa7 100644
--- a/muse2/synti/deicsonze/deicsonze.h
+++ b/muse2/synti/deicsonze/deicsonze.h
@@ -585,7 +585,7 @@ class DeicsOnze : public Mess {
bool sysex(int length, const unsigned char* data, bool fromGui);
virtual bool sysex(int l, const unsigned char* d);
- virtual const char* getPatchName(int ch, int number, int) const;
+ virtual const char* getPatchName(int ch, int number, bool) const;
virtual const MidiPatch* getPatchInfo(int, const MidiPatch *) const;
virtual int getControllerInfo(int arg1, const char** arg2,
diff --git a/muse2/synti/fluid/fluid.cpp b/muse2/synti/fluid/fluid.cpp
index 8a2fd13b..fa34d67e 100644
--- a/muse2/synti/fluid/fluid.cpp
+++ b/muse2/synti/fluid/fluid.cpp
@@ -405,7 +405,7 @@ bool ISynth::processEvent(const MusECore::MidiPlayEvent& ev)
// getPatchName
//---------------------------------------------------------
-const char* ISynth::getPatchName(int /*ch*/, int val, int, bool /*drum*/) const
+const char* ISynth::getPatchName(int /*ch*/, int val, bool /*drum*/) const
{
int prog = val & 0xff;
if(val == MusECore::CTRL_VAL_UNKNOWN || prog == 0xff)
diff --git a/muse2/synti/fluid/fluid.h b/muse2/synti/fluid/fluid.h
index 658be687..60449568 100644
--- a/muse2/synti/fluid/fluid.h
+++ b/muse2/synti/fluid/fluid.h
@@ -76,7 +76,7 @@ class ISynth : public Mess {
virtual bool sysex(int len, const unsigned char* p);
virtual bool processEvent(const MusECore::MidiPlayEvent&);
- virtual const char* getPatchName (int, int, int, bool) const;
+ virtual const char* getPatchName (int, int, bool) const;
virtual const MidiPatch* getPatchInfo(int, const MidiPatch *) const;
virtual void getInitData(int*, const unsigned char**);
diff --git a/muse2/synti/fluidsynth/fluidsynti.cpp b/muse2/synti/fluidsynth/fluidsynti.cpp
index 0fca4122..46f20156 100644
--- a/muse2/synti/fluidsynth/fluidsynti.cpp
+++ b/muse2/synti/fluidsynth/fluidsynti.cpp
@@ -1005,6 +1005,13 @@ void FluidSynth::setController(int channel, int id, int val, bool fromGui)
byte patch = (val & 0xff);
//printf("val: %d banknum: %x patch: %d\n", val, banknum, patch);
+ if(val == MusECore::CTRL_VAL_UNKNOWN || patch == 0xff)
+ return;
+ if(channels[channel].drumchannel)
+ banknum = 128;
+ else if(banknum == 0xff)
+ banknum = 0; // Is wise? Else try to keep a previous value when 'off' (0xff) like the HW values?
+
err = fluid_synth_program_select(fluidsynth, channel, font_intid , banknum, patch);
if (err)
printf("FluidSynth::setController() - Error changing program on soundfont %s, channel: %d\n", fluid_synth_error(fluidsynth), channel);
@@ -1205,18 +1212,15 @@ void FluidSynth::rewriteChannelSettings()
//---------------------------------------------------------
// getPatchName
//---------------------------------------------------------
-const char* FluidSynth::getPatchName(int i, int, int, bool /*drum*/) const
+const char* FluidSynth::getPatchName(int i, int, bool /*drum*/) const
{
if (channels[i].font_intid == FS_UNSPECIFIED_FONT ||
channels[i].font_intid == FS_UNSPECIFIED_ID)
- //return "no preset";
return "<unknown>";
else if (channels[i].preset == FS_UNSPECIFIED_PRESET)
- //return "no preset";
return "<unknown>";
else {
fluid_preset_t *preset = fluid_synth_get_channel_preset(fluidsynth, i);
- //if (!preset) return "no preset";
if (!preset) return "<unknown>";
return preset->get_name(preset);
}
@@ -1267,6 +1271,7 @@ const MidiPatch* FluidSynth::getFirstPatch (int channel) const
preset = sfont->get_preset (sfont, bank, patch);
if (preset) {
midiPatch.hbank = bank;
+ midiPatch.lbank = 0xff; // Off
midiPatch.prog = patch;
midiPatch.name = preset->get_name (preset);
return &midiPatch;
@@ -1280,7 +1285,8 @@ const MidiPatch* FluidSynth::getFirstPatch (int channel) const
for (unsigned patch = 0; patch < 128; ++patch) {
preset = sfont->get_preset (sfont, bank, patch);
if (preset) {
- midiPatch.hbank = bank;
+ midiPatch.hbank = 0xff; // Off
+ midiPatch.lbank = 0xff; // Off
midiPatch.prog = patch;
midiPatch.name = preset->get_name(preset);
return &midiPatch;
@@ -1318,6 +1324,7 @@ const MidiPatch* FluidSynth::getNextPatch (int channel, const MidiPatch* patch)
if (preset) {
//printf("Preset info: bank: %d prog: %d name: %s\n", bank, prog, preset->get_name(preset));
midiPatch.hbank = bank;
+ midiPatch.lbank = 0xff; // Off
midiPatch.prog = prog;
midiPatch.name = preset->get_name (preset);
return &midiPatch;
@@ -1333,7 +1340,8 @@ const MidiPatch* FluidSynth::getNextPatch (int channel, const MidiPatch* patch)
preset = sfont->get_preset (sfont, bank, prog);
if (preset) {
//printf("Preset info: bank: %d prog: %d name: %s\n",bank, prog, preset->get_name(preset));
- midiPatch.hbank = bank;
+ midiPatch.hbank = 0xff; // Off
+ midiPatch.lbank = 0xff; // Off
midiPatch.prog = prog;
midiPatch.name = preset->get_name (preset);
return &midiPatch;
diff --git a/muse2/synti/fluidsynth/fluidsynti.h b/muse2/synti/fluidsynth/fluidsynti.h
index 0628a385..7e448536 100644
--- a/muse2/synti/fluidsynth/fluidsynti.h
+++ b/muse2/synti/fluidsynth/fluidsynti.h
@@ -138,7 +138,7 @@ public:
virtual bool setController(int, int, int);
void setController(int, int , int, bool);
virtual void getInitData(int*, const unsigned char**);
- virtual const char* getPatchName(int, int, int, bool) const;
+ virtual const char* getPatchName(int, int, bool) const;
virtual const MidiPatch* getPatchInfo(int i, const MidiPatch* patch) const;
virtual int getControllerInfo(int, const char**, int*, int*, int*, int*) const;
virtual bool processEvent(const MusECore::MidiPlayEvent&);
diff --git a/muse2/synti/libsynti/mess.h b/muse2/synti/libsynti/mess.h
index f9853330..79d3d7e7 100644
--- a/muse2/synti/libsynti/mess.h
+++ b/muse2/synti/libsynti/mess.h
@@ -88,7 +88,7 @@ class Mess {
virtual void getInitData(int* n, const unsigned char**) /*const*/ { *n = 0; } // No const: Synths may need to allocate member pointers. p4.0.27 Tim
virtual int getControllerInfo(int, const char**, int*, int*, int*, int*) const {return 0;}
- virtual const char* getPatchName(int, int, int, bool) const { return "?"; }
+ virtual const char* getPatchName(int, int, bool) const { return "?"; }
virtual const MidiPatch* getPatchInfo(int, const MidiPatch*) const { return 0; }
// synthesizer -> host communication
diff --git a/muse2/synti/simpledrums2/simpledrums.cpp b/muse2/synti/simpledrums2/simpledrums.cpp
index 4265c33c..8b3ea69c 100644
--- a/muse2/synti/simpledrums2/simpledrums.cpp
+++ b/muse2/synti/simpledrums2/simpledrums.cpp
@@ -647,7 +647,7 @@ bool SimpleSynth::sysex(int len, const unsigned char* d)
\return const char* with patchname
*/
//---------------------------------------------------------
-const char* SimpleSynth::getPatchName(int /*index*/, int, int) const
+const char* SimpleSynth::getPatchName(int /*index*/, int, bool) const
{
SS_TRACE_IN
SS_TRACE_OUT
diff --git a/muse2/synti/simpledrums2/simpledrums.h b/muse2/synti/simpledrums2/simpledrums.h
index f76a3237..8de202ea 100644
--- a/muse2/synti/simpledrums2/simpledrums.h
+++ b/muse2/synti/simpledrums2/simpledrums.h
@@ -137,7 +137,7 @@ class SimpleSynth : public Mess
virtual bool processEvent(const MusECore::MidiPlayEvent& arg1);
virtual bool setController(int arg1, int arg2, int arg3);
virtual bool sysex(int arg1, const unsigned char* arg2);
- virtual const char* getPatchName(int arg1, int arg2, int arg3) const;
+ virtual const char* getPatchName(int arg1, int arg2, bool arg3) const;
virtual const MidiPatch* getPatchInfo(int arg1, const MidiPatch* arg2) const;
virtual int getControllerInfo(int arg1, const char** arg2, int* arg3, int* arg4, int* arg5, int* arg6) const;
virtual void processMessages();