Changing instrument with MIDI pads

Forums

Hi everyone!

For a live setup using Qsynth, my need should be as following...

I have a midi controller which sends on MIDI channel 2 the notes played on keyboard. On channel 1, it sends the "notes" coming from the pads. (this is a factory setting which I cannot change.)

I'd like Qsynth to change instrument when I press the pads. Let's take as example the FluidR3_GM soundfont: I'd like to assign a piano preset to a pad, an organ to another pad, a trumpet on a third pad... and so on. "instrument" changes should be read by Qsynth on channel 1. Channel 2 is receiving the played notes. Is there a way to do this?

thanks,
greetings
Manu

Permalink

theoretically yes, if you can assign arbitrary Program Change messages (PC) to the pad or button on the MIDI controller you have...
but you also said that it's a factory setting which I cannot change., so probably you can't in practice ;)
more like a limitation of the MIDI controller and not one of Qsynth(fluidsynth) I'm afraid!

Permalink

Hi,

x42-midimap should be able to do it, once properly configured; discover what those "notes" exactly are with the help of tools like gmidimonitor and midisnoop, and then map them as the desired program changes to the channel you need.
Debian has it in the x42-plugins package.

Cheeers,
copyc4t

Permalink

I wanted this for my Akai MPK mini. It sends Prog Changes messages only for the pads (on channel 9) and not for the keys (on channel 0). However you can remap the Prog Change messages. FluidSynth has a built-in midi router, however it is not (yet!) exposed by Qsynth. I added code to the qsynthMainForm.cpp to do the remapping:

$ git diff
diff --git a/src/qsynthMainForm.cpp b/src/qsynthMainForm.cpp
index 6e40f67..6549d98 100644
--- a/src/qsynthMainForm.cpp
+++ b/src/qsynthMainForm.cpp
@@ -2109,6 +2109,26 @@ bool qsynthMainForm::startEngine ( qsynthEngine *pEngine )
                }
        }
 
+   fluid_midi_router_clear_rules(pEngine->pMidiRouter);
+   fluid_midi_router_rule_t* rule;
+
+   // pass thru notes unmodified
+   rule = new_fluid_midi_router_rule();
+   fluid_midi_router_rule_set_chan(rule, 0, 16, 1.0, 0);
+   fluid_midi_router_rule_set_param1(rule, 0, 255, 1.0, 0);
+   fluid_midi_router_add_rule(pEngine->pMidiRouter, rule, FLUID_MIDI_ROUTER_RULE_NOTE);
+
+   rule = new_fluid_midi_router_rule();
+   fluid_midi_router_rule_set_chan(rule, 0, 16, 1.0, 0);
+   fluid_midi_router_rule_set_param1(rule, 0, 255, 1.0, 0);
+   fluid_midi_router_add_rule(pEngine->pMidiRouter, rule, FLUID_MIDI_ROUTER_RULE_CC);
+
+   // map pads (ch9) prog change over to channel 0
+   rule = new_fluid_midi_router_rule();
+   fluid_midi_router_rule_set_chan(rule, 9, 9, 0.0, 0);      /* Map all on channel 9 to 0 */
+   fluid_midi_router_rule_set_param1(rule, 0, 255, 1.0, 0);    /* Match all commands */
+   fluid_midi_router_add_rule(pEngine->pMidiRouter, rule, FLUID_MIDI_ROUTER_RULE_PROG_CHANGE);
+
        // Run the server, if requested.
        if (pSetup->bServer) {
        #ifdef CONFIG_FLUID_SERVER

Add new comment

The content of this field is kept private and will not be shown publicly.

Markdown

  • Parses markdown and converts it to HTML.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id> <img src alt height width> <strike> <pre> <p> <br>
  • Lines and paragraphs break automatically.

Filtered HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <b> <i> <pre> <img src alt height width> <strike>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
File attachments
Unlimited number of files can be uploaded to this field.
2 MB limit.
Allowed types: jpg jpeg gif png txt doc docx xls xlsx pdf ppt pps odt ods odp zip gz bz2 xz patch diff wav ogg flac ogv mp4 qtz.