-
Notifications
You must be signed in to change notification settings - Fork 172
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 exported file has an offset of +24 on Midi notes #411
Comments
Hi! I've tried to reproduce the problem, but i couldn't find any issues with the export. Attached is a screenshot of a minimal example, just a fresh song with GMKit and the result in Bitwig. The same note is shown in Hydrogen and Bitwig. Nevertheless, the hydrogen midi out / midi export handling can be confusing: #307 has more informations about possible problems. Does your problem persist with every song (even new songs)`or is it affecting only some songs? |
I vaguely remember encountering the same problem. As far as I remember, MIDI defines note 60 to middle C, but does not define "middle C", so different software use C3, C4 and C5 as "middle C" (C3 being most common), and I'm not sure whether Hydrogen is consistent with this. |
Hydrogen seems to offset notes by 36 and 60 in different places (60 - 36 = 24 which explains two octave difference):
hydrogen/src/core/src/IO/portmidi_driver.cpp Line 268 in df7be3d
hydrogen/src/core/src/IO/jack_midi_driver.cpp Line 423 in 47e46e5
|
Hi, in addition, the alsa midi driver sends out 'note on' midi messages for the first instrument with midi note 36 but 'note off' messages with mide note 60. What a mess.. |
@jduemes (or everyone else who can reproduce the behaviour): Can you provide me with a midi file and the corresponding song file which shows the incorrect behaviour? I've tried to export different songs yesterday, but in all cases, the note values which are displayed in hydrogen matched the note values in the exported midi file. I've checked the note values in the midi file by looking at the output of the program midicsv. |
(Note: message edited by @trebmuh to fix a code typo in the link) Hi Mauser, your are right about "the note values which are displayed in hydrogen matched the note values in the exported midi file". I see the same behavior here. The thing is, H2 does not "speaks" those values when talking to a sequencer. That sequencer can be the Fluydsynth software or a external hardware like a music keyboard. |
Hi Jeff! Thanks, this makes it clear. Then the problem can be boiled down to the lines which @elpescado has identified earlier. So the core of the problem is in the code of hydrogen's midi drivers. Thanks for reporting the issue and sending the example song! |
Hi Sebastian, I'm happy to help. Is there a chance to link this issue to the release announcement of the version where this problem is already resolved ? |
Hi @jduemes : reading at this thread, it looks to me that @elpescado and @mauser fixed the issue with #450 . Could you please re-test it with the beta release 1.0.0-beta1 and report back here confirming us that the issue is gone? Thanks. |
Hi folks, There are also offset problems for sending MIDI note number out when hitting a drum or just playing: This makes problems when using Hydrogen as a drum sequencer and triggering a drum sound elsewhere via MIDI. I write this here because I guess that this is related to this thread and I just compiled and tested the 1.0.0-beta1. When enabling MIDI out and hitting a note, the offsets are +232 or -24 depending on which note Hydrogen tries to send out. Here is a list containing the note numbers Hydrogen believes to send and what actually is sent (hydrogen=actual): 0=232 So if Hydrogen believes it sends MIDI note 22, then it actually sends MIDI note 254 and if Hydrogen believes it sends MIDI note 25, it sends MIDI note 1. I can't say I find the solution for this and hope that someone skilled in C++ resolves it. :-) EDIT: I do after browsing the GIT repo and the issue system, see that my posting was not needed, sorry. Jostein |
I hope this is fixed by me in #666. |
Using my Achlinux laptops I just tested Hydrogen 1.0.0.beta1.r3322.538eaeb9-1 using the GMRockKit as it comes with H2. My test setup is easy to reproduce.
Using only alsa:
Using jack or alsa, Hydrogen still sends out the notes 2 octaves under what is defined for the instrument. An offset off -24. In my test with Kick which has the default note 36 aseqdump shows note 12.
Another observation: When SENDING midi notes to Hydrogen, GMRockKit seems to be very GM compatible, so to speak, and Hydrogen seems to work as expected. What I mean is, sending note 39 plays Hand Clap, sending 44 plays Hat Pedal and so on.
|
Hi, Unfortunately, fix #666 hasn't made its way to 1.0.0 branch yet. Could you please test it on my branch? I'd appreciate if you post test results in that thread, as I need some help with testing. |
Oh, sorry, I thought I reported it months ago! I have tested it and it works great as far as I can see. Well done and thank you very much for doing it. I wonder something: Why does one hit on an instrument trigger three events? It's a note off-on-off sequence. A note off first will make for example cymbals sound unnatural in for example Superior Drummer or other players that strive to behave like real drummers. A note on event only should be sufficient in most cases. |
Hi, the fix from @elpescado is since march 2019 part of our master branch and this problem seems to be solved from me (tested for alsa with aseqdump as shown above), so i think that the issue can be closed. If someone still experiences problems, just comment here and the issue will be re-opened. |
(Note: message edited by @trebmuh for better readability using the so-called "Insert code" tag)
Hi Folks,
I manually edited the GMKit drumkit.xml file adding midi notes to the instruments. This way I connect (via Jack audio connection Kit) Hydrogen to a keyboard(1) and - as expected - Hydrogen sends the notes to the keyboard.
Now, if I export my song to a Midi file, open this Midi file with Drumstick MIDI Player connected to that same keyboard, it plays very different notes.
I did a test connecting Drumstick MIDI Player to QMidiRoute and QMidiRoute to the keyboard. Then changing the "Note Offset" option on QMidiRoute to -24. Surprise !!! It plays exactly the same notes as using Hydrogen. As I understand the Hydrogen Midi export is buggy.
(1) I used a keyboard but the same happens if I use another midi synthetizer like Qsynth (a Fluydsynth GUI).
Can somebody confirm this or point me an option or workaround to get a correct midi file ?
Cheers,
Jeff
The text was updated successfully, but these errors were encountered: