(portmidibackend.c:143-147): The PortMIDI backend was treating "no MIDI output 
device" as a fatal error and destroying the entire backend, even when an input 
device was successfully opened. 

This works on Windows apparently because windows has a default MIDI synth, but 
a Linux system doesn't, I guess.


Also, in audiointerface.c:229: The have_midi() function was checking the wrong 
condition.

The following allows MIDI input to work, independently of MIDI output device... 

This works (compiled) :

diff --git a/src/audio/portmidibackend.c b/src/audio/portmidibackend.c
index bc7b332..f69c8aa 100644
--- a/src/audio/portmidibackend.c
+++ b/src/audio/portmidibackend.c

@ -142,19 +142,19 @@ portmidi_initialize (DenemoPrefs * config)
       info = Pm_GetDeviceInfo (id);
       if (info == NULL)
         {
-          g_warning ("No output device");
-          portmidi_destroy ();
-          return -1;
+          g_message ("No MIDI output device available, continuing with input 
only");
+          output_stream = NULL;
         }
-
-      g_message ("Opening output device '%s: %s'", info->interf, info->name);
-
-      err = Pm_OpenOutput (&output_stream, id, NULL, OUTPUT_BUFFER_SIZE, NULL, 
NULL, 0);
-      if (err != pmNoError)
+      else
         {
-          g_warning ("Couldn't open output stream");
-          portmidi_destroy ();
-          return -1;
+          g_message ("Opening output device '%s: %s'", info->interf, 
info->name);
+
+          err = Pm_OpenOutput (&output_stream, id, NULL, OUTPUT_BUFFER_SIZE, 
NULL, NULL, 0);
+          if (err != pmNoError)
+            {
+              g_warning ("Couldn't open output stream, continuing with input 
only");
+              output_stream = NULL;
+            }
         }
     }
   else


-------- additionally ---------------------

diff --git a/src/audio/audiointerface.c b/src/audio/audiointerface.c
index 26e5415..9fa5b6f 100644
--- a/src/audio/audiointerface.c
+++ b/src/audio/audiointerface.c
@@ -226,7 +226,7 @@ initialize_midi (DenemoPrefs * config)
 gboolean
 have_midi (void)
 {
-  return strcmp (Denemo.prefs.portmidi_input_device->str, "default") && 
(backends[MIDI_BACKEND] != &dummy_midi_backend);
+  return strcmp (Denemo.prefs.portmidi_input_device->str, "none") != 0 && 
(backends[MIDI_BACKEND] != &dummy_midi_backend);
 }
 
 int


> On 10/13/2025 6:01 PM EDT Bric <[email protected]> wrote:
> 
>  
> > On 10/12/2025 3:25 AM EDT Andreas Schneider <[email protected]> wrote:
> > 
> >  
> > Compiling in JACK support adds a new MIDI backend, yet it is only used 
> > if you select it as MIDI backend in the settings dialog under the MIDI 
> > tab. The default backend is still PortMidi even if JACK support is 
> > compiled in.
> > I also had the strange effect that MIDI input did not work at first 
> > after updating my distribution and recompiling Denemo, however, when 
> > trying again the next day it worked. I'm not sure why. Maybe the device 
> > was already in use by another process. That happened to me with audio 
> > output. Thus, it is worth to retry under Linux and check that the device 
> > is not in direct use by some other process (i.e. not via the sound server).
> > 
> > Andreas
> > 
> 
> Well, the bizarre thing, again, is that Denemo on my Ubuntu  **IS** detecting 
> the input keyboard!  It is showing up, listed, under 
> 
> Edit -> Change Preference -> MIDI -> Input device
> 
> But nothing happens when I actually send the MIDI signal.

Reply via email to