Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDI mapping errors between Hydrogen 1.x and DrumGizmo? #1363

Closed
lminiero opened this issue Sep 2, 2021 · 8 comments
Closed

MIDI mapping errors between Hydrogen 1.x and DrumGizmo? #1363

lminiero opened this issue Sep 2, 2021 · 8 comments

Comments

@lminiero
Copy link

lminiero commented Sep 2, 2021

Hydrogen version * : 1.0.2
Operating system + version : Fedora 34
Audio driver + version : Integrated Intel soundcard


I've been using Hydrogen and DrumGizmo together via Ardour for quite some time and with good success. Specifically, I've been using a Hydrogen .h2drumkit file configured for the Muldjord kit, which allows me to write patterns in Hydrogen, and have Hydrogen send the MIDI commands to DrumGizmo via Ardour, where DG is loaded as a plugin.

This worked fine up until version 0.9.7 of Hydrogen, but when I upgraded to Hydrogen 1.0.1 it stopped working. Hitting a kick would trigger a crash, and hitting other elements would trigger no sound at all. Downgrading to 0.9.7 made it work again, which is what I've been using so far. Of course I realize I'm missing out on new cool features, by sticking to a legacy version, but when 1.0.2 became available on Fedora I got the same issue. I tried a couple of different .h2drumkit files for the DG Muldjord kit, and I got the same problem, which makes me think there could either be some breaking change in how the drumkit file format is now compared to 0.x, or in how the MIDI mapping works now between Hydrogen and DrumGizmo.

Unfortunately I'm not very familiar with the internals of either, so I wouldn't know what additional information to provide at this stage. If there's any info you need in particular from me to better understand the problem (e.g., the .h2drumkit file itself), please let me know.

Thanks!


  • H2 version : see 'Info - About', or in case you build Hydrogen from source use 'git rev-parse HEAD'
    ** if you are reporting a bug, please describe how the bug can be reproduced
@theGreatWhiteShark
Copy link
Contributor

Hey @lminiero

Just to be sure: You used a custom drumkit you (or someone else) created yourself and it is triggering different samples in the same drumgizmo drumkit depending on the version of Hydrogen you use? Or do you use the default kit of Hydrogen to connect to drumgizmo?

Regarding the samples triggered: You can set the MIDI channel and note triggered by each note using the instrument editor. By altering them you can select the corresponding instrument within drumgizmo.

@lminiero
Copy link
Author

lminiero commented Sep 4, 2021

Just to be sure: You used a custom drumkit you (or someone else) created yourself and it is triggering different samples in the same drumgizmo drumkit depending on the version of Hydrogen you use? Or do you use the default kit of Hydrogen to connect to drumgizmo?

Yes, it's a custom drumkit someone created. You can find one for the Muldjord kit in this post on LinuxMusicians for instance. When interfacing with DrumGizmo, there's no audio output from Hydrogen, as Hydrogen in this case acts as a sequencer for the "remote" DrumGizmo plugin (in this case Ardour). What this drumkit does, I believe, is creating valid drum nodes in Hydrogen (kick1, kick2, snare, etc.), which when hit send a MIDI command on the corresponding MIDI channel.

Regarding the samples triggered: You can set the MIDI channel and note triggered by each note using the instrument editor. By altering them you can select the corresponding instrument within drumgizmo.

Thanks for the heads up! I've never used the instrument editor myself, but I think that's already what these custom drumkits are doing, since in DrumGizmo different drum parts are mapped to different MIDI channels, and it is indeed working in Hydrogen 0.9.7, so I'm not sure why it doesn't in newer versions. I'll check what the the instrument editor reports for these drumkits in both old and new version to see if I can spot anything obvious.

@lminiero
Copy link
Author

lminiero commented Sep 4, 2021

@theGreatWhiteShark I think I found out the issue, even though I still don't understand why it's occurring.

Checking with the instrument editor on 0.9.7, I found out which notes the drumkit was configured to send (all on channel 1) via MIDI, e.g., B2 (59) for the left kickdrum, C3 (60) for the right kickdrum and so on. If I manually sent those notes to Ardour using something like sendmidi (via a2jmidi_bridge), though, e.g., 59 for the left kickdrum:

sendmidi dev "playback" on 59 127

what I heard was exactly what I hear when hitting the left kickdrum in Hydrogen 1.0.2, that is a ride. Messing a bit by manually sending different notes via sendmidi, I found out that DrumGizmo actually expects two octaves below what is configured in those drumkits, which means that if I sent B0 (35) instead of B2 (59):

sendmidi dev "playback" on 35 127

I would indeed hear the left kickdrum as expected, and the reason why I heard a ride when sending B2 was because the drumkit associated the left ride to B4, while DrumGizmo used B2 for the ride instead. All other buttons resulted in no sound obviously because all the configured notes were higher than what DrumGizmo expected.

Manually modifiying the midiOutNote values in drumkit.xml by subtracting 24 from the original value got Hydrogen 1.0.2 to work as expected with Ardour/DrumGizmo.

What I don't understand, though, is why it did work with Hydrogen 0.9.7 before! The drumkit.xml was definitely configured to send those higher notes, and yet Hydrogen was for some reason sending the right value to DrumGizmo, possibly by lowering each note by two octaves automatically somehow, which didn't happen in Hydrogen 1.x instead thus causing the issue. I couldn't find anything obvious in the drumkit.xml file that could explain this: was there an undocumented feature, or possibly a bug, in Hydrogen 0.x that caused this note rewriting to happen?

@theGreatWhiteShark
Copy link
Contributor

Thanks a lot for looking into it! I probably need a couple of weeks before I have time to investigate this issue. Sorry for keeping you waiting.

In the meantime: after opening the drumkit using newer version of Hydrogen, is it still working with Hydrogen 0.9.7?

@lminiero
Copy link
Author

lminiero commented Sep 6, 2021

Thanks a lot for looking into it! I probably need a couple of weeks before I have time to investigate this issue. Sorry for keeping you waiting.

No worries, I'm not in a hurry and you've actually been incredibly responsive, thanks!

In the meantime: after opening the drumkit using newer version of Hydrogen, is it still working with Hydrogen 0.9.7?

Considering the way to get the drumkit working was lowering the notes by 24, my guess is that it will not work with 0.9.7 (who might turn the 35 in 35-24=11), but I haven't tested: I'll try that later and let you know.

One thing I do remember is that, with 0.9.7, live feeding Ardour worked but saving the patterns to MIDI and importing the MIDI in Ardour didn't, while it now does when saving in Hydrogen 1.0.2 after editing the drumkit to send lower notes: very likely the MIDI notes saved by Hydrogen 0.9.7 had the higher notes written in, which would not be what DrumGizmo expected. Since the mapping in the Hydrogen 1.0.2 drumkit is now correct, it works as expected both when sending the MIDI notes in real-time, and when writing them down.

@theGreatWhiteShark
Copy link
Contributor

Considering the way to get the drumkit working was lowering the notes by 24, my guess is that it will not work with 0.9.7 (who might turn the 35 in 35-24=11), but I haven't tested: I'll try that later and let you know.

Probably not. I haven't been around for the whole time till the 0.9.7 release. So, I'm not sure whether this is due to a dedicated bug fix or was fixed "incidentally". I'll check (soon) and keep you posted.

@theGreatWhiteShark
Copy link
Contributor

Hey @lminiero ,

I took a look at it and there was indeed a bug in Hydrogen versions prior to 1.0.0 (fixed in #666), which caused all MIDI output notes to have an offset of -24. So, fixing the drumkit, which was written to compensate the former bug, was indeed the right thing to do.

Since you already fixed the drumkits to work with newer Hydrogen versions, can I ask you to post the fixed ones in the thread you shared above?

Also, I'll close this issue here as there seems nothing more to do on the Hydrogen side. (Although I'm not pleased with the fix I linked above because it could have featured upgrade code that would have kept all drumkits created in previous versions intact. But, unfortunately, this can't be introduced in retrospective). Please feel free to reopen it if something is still missing from your point of view.

@lminiero
Copy link
Author

Thanks for looking into this and for the clarification! I'll notify that thread about this fix, as it involved an automated tool to generate drumkits for Drumgizmo which would probably need fixing too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants