hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.01k stars 172 forks source link

Hydrogen gets a MIDI message, but no instrument is triggered #1919

Closed quasilyte closed 6 months ago

quasilyte commented 6 months ago

Hello. :christmas_tree: I'm having trouble making Hydrogen work responsively with my drumkit and Linux.

The problem: Hydrogen ignores the hi-hat instrument more often than not. I see the midi-in indicator in the top part of the Hydrogen main UI flickering, as it's receiving the input, but the instrument is not triggered.

It doesn't matter how hard I hit the hi-hat.

I think I either need to debug a MIDI stream to see what messages does the Hydrogen receive or maybe I need to configure the Hydrogen to handle these messages correctly.

Here is the qjackctl screenshot:

image

The Hydrogen clearly getting some sort of an input from the drumkit:

image

But the instrument is not triggered. I see no sound, and the relevant icon isn't flashing inside the mixer:

image

If I get lucky, sometimes it's activated, but the sound looks reduced or whatever:

image

Observation: only one part of the hi-hat is being this tricky. If I hit the back part of the pad, it plays 100% of the time.

Another weird thing is that there is a ~100% chance that the hi-hat instrument will be triggered IF I trigger some other instrument right before it. But if I go on with a hi-hat alone after that, it will eventually start to ignore it after a 3 or 4 hits.

I thought that it could be related to the note-off setting, but switching it off doesn't help here.

These are the settings I'm using:

image

I tried using the TD2 as an input device; the results are the same.

Some extra info:

$ uname -a
Linux lispbook2 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$ cat /proc/asound/cards
 0 [sofhdadsp      ]: sof-hda-dsp - sof-hda-dsp
                      HP-HPEliteBook63013inchG9NotebookPC--897A
 1 [TD02           ]: USB-Audio - TD-02
                      Roland TD-02 at usb-0000:00:14.0-3, full speed

Maybe there is some feature or setting I'm missing?

quasilyte commented 6 months ago

I did some MIDI debugging. I connected the TD midi stream to both Hydrogen and midisnoop to log the messages.

This is an example of a single hi-hat hit that makes no sound in Hydrogen:

image

This is an example of the same hi-hat making the sound:

image

quasilyte commented 6 months ago

It almost looks like the note is the case here. Maybe the sound bank doesn't have the note 26 available? I tried it multiple times and I get the same results.

This is a very rought experience for a beginner. :) I doubt everyone would lean towards the MIDI message debugging.

The problem is: the user doesn't know which side has an issue. Is it a drumkit problem? Maybe they're not hitting the drums right. Or perhaps it's Linux playing its favorite game of not cooperating when it comes to the audio? :D

I think a notice to the user when they're trying to play a note that is not covered by a sound bank could be a good first step in making it less frustrating for the end-users.

quasilyte commented 6 months ago

But user-friendliness issues aside, I hope there is a way to map the non-existing note to some closest one. I would like to use the builtin drum kits to get more familiar with this software. To use them, I need to make this note 26 work. :)

theGreatWhiteShark commented 6 months ago

Hey @quasilyte ,

The problem is: the user doesn't know which side has an issue.

You should take a look in Hydrogen's log (start it via hydrogen -VDebug). Then Hydrogen should talk about each incoming MIDI message, whether it can handle it, and if it can be mapped to an instrument of your current drumkit. But I would highly recommend doing so with a more recent version.

I thought that it could be related to the note-off setting, but switching it off doesn't help here.

There was actually bug in this very setting at some point. But the more recent version should fix that too.

Maybe the sound bank doesn't have the note 26 available?

Yes. Most kits will not respond to note 26. But you can adjust which note an instrument is listening too in the Instrument Editor (see http://hydrogen-music.org/documentation/manual/manual_en.html#chpt.midi.note). I know it's not intuitive. Especially since the corresponding label reads "MIDI Output". But it grew that way in the past and we try to make the best out of it. :)

I think a notice to the user when they're trying to play a note that is not covered by a sound bank could be a good first step in making it less frustrating for the end-users.

I know. Somewhere deep, deep down my TODO list I also want to make the MIDI-In LED clickable and show a nice summary of incoming and outgoing MIDI messages, note mapping etc. But no idea when or if that will happen :|

quasilyte commented 6 months ago

@theGreatWhiteShark just so you know, I find this software amazing, and I want to explore more of it. :) I'll try to follow your suggestions. I can't wait to play around with my drums and Hydrogen some more.

quasilyte commented 6 months ago

Enabling the "use output note as input note" plus assigning the output note value to the instrument manually fixes my issue. I believe the only thing I need to do now is to copy/paste the hi-hat instrument so it can handle both notes (it's OK for me if they sound identical for now). This issue can be closed.