Double note sound
JakiDa2nd opened this issue ยท 6 comments
Describe the bug
The notes in-game play twice: once when I press the note key down, and again when I release it. This only happens when I play from the real life midi piano. The sound when you release the key is quieter then the sound when you first play it, sort of feels like an echo. The sound does get burnt onto a record if you record it. Doing /data get on the record reveals the sound volume when you release the note is always 0.06f. The sustain pedal doesn't seem to effect it in any way. This is an issue with every instrument, even with the genshin instruments. Doing it with the Nightwind Horn makes it play indefinitely.
To Reproduce
Steps to reproduce the behavior:
- connect your piano
- play it
Expected behavior
No note sound when key is released.
Additional context
Tested it in 1.20.1 and 1.21 fabric, both had the same issue. I have a Yamaha midi keyboard, the mod recognizes it as Digital Keyboard.
Java: 21.0.3
OS: Windows
(Hopefully I explained everything well enough)
Hey there! I'm so, so sorry for the extremely late replay.
Been busy.
Either way, it seems I couldn't really replicate this issue with me...
I'd like you to try and play using a different MIDI device - this is to test if it is specifically an issue with my mod's protocol on some specific devices (like your Yamaha per se), or perhaps a problem with your machine altogether (may still be solvable!).
- Install LoopMIDI and FreePiano together:
- Open a new MIDI port with LoopMIDI
- Connect FreePiano to that new LoopMIDI output
- Within the mod, select LoopMIDI as your input port
- Play something
Try to replicate the issue. Please tell me your results.
Note that if this works, I believe you can also connect a MIDI input to FreePiano to act as your intermediate for a temporary solution :)
Very interesting observation. Thank you!
I tried to replicate the above issues again, and I really couldn't get it to.
As issue StavWasPlayZ/Genshin-Instruments#22 may suggest, this might actually be rooted in an incompatibility with Windows altogether.
I'll try to run these tests on my own Windows machine and see if I may be successful in re-creating the issue, and will update accordingly.
...Quite embarrassing if true lol
everything you describe here is something that occurs for me as well
the note that plays when you release a key has a volume that matches your minimum velocity level
if you turn the note velocity slider all the way down, the note that plays on release will be much louder
Okay, can confirm that it is not a platform-dependent issue.
My other theory is that the mod simply does not recognize your guys' MIDI input correctly.
As in, when coding, I tested the mod to listen to specific MIDI signals to signify a press, release, and so on based on my own MIDI device and some virtual ones (Samson Carbon & FreePiano); but perhaps your devices simply use other "codes" for these things, causing incorrect behavior like double pressing or no releasing etc.
I'll test this in 2 ways:
- Go to this website
- Select your 'problematic' MIDI device, and perform the following inputs there (in exact):
- C3 press, C3 release
- D3 press, D3 release
- C#3 press, C#3 release
- C#4 press, C#4 release
- D4 press, D4 release
- If you have a physical pedal:
- Pedal on
- Pedal off
- Send me the logs of this website (simply copy what it provided you, like):
69910.00s: Chan 1 Note off C3 (128 48 90) 105235.00s: Chan 1 Note off C#3 (128 49 105) ...
- Select your 'problematic' MIDI device, and perform the following inputs there (in exact):
- If I see no effective difference with my own input, I'll provide you with a new "release" of the mod that will simply have more debug information for me to see what you MIDI device transmits and how the mod interprets it, which will help me better understand the underlying issue.
Thank you kindly!
I have a physical sustain pedal:
26523.00s: Chan 1 Control/Mode Change (176 64 0)
25982.00s: Chan 1 Control/Mode Change (176 64 127)
20538.00s: Chan 1 Note on D4 (144 62 0)
20297.00s: Chan 1 Note on D4 (144 62 85)
19757.00s: Chan 1 Note on C#4 (144 61 0)
19518.00s: Chan 1 Note on C#4 (144 61 94)
12258.00s: Chan 1 Note on C#3 (144 49 0)
12018.00s: Chan 1 Note on C#3 (144 49 75)
11223.00s: Chan 1 Note on D3 (144 50 0)
10953.00s: Chan 1 Note on D3 (144 50 83)
10338.00s: Chan 1 Note on C3 (144 48 0)
10052.00s: Chan 1 Note on C3 (144 48 83)
I guess some MIDI devices just send a note on at zero velocity instead of a dedicated note off, that would explain both issues and should be a fairly easy patch
I haven't had any issues in FL Studio or Cantabile so it must be part of the MIDI specification somewhere
i recommend reading this (turns out it is part of the midi specification)
http://midi.teragonaudio.com/tech/midispec/noteon.htm