From ef9ff09e1798f0da892b5b6a2f74b20ee2eda46f Mon Sep 17 00:00:00 2001 From: Skiski Date: Sat, 24 Jan 2026 18:35:00 +0100 Subject: [PATCH] change velocity for RB3 pro guitar when it stays the same twice in a row (#18064) There is a bug when you play twice in a row with the same velocity on a string. The second note is not taken into account as the game does not notice any change in the velocity. It is because the velocity is never reset (or at least not very often). The idea is to check if the velocity of the string is the same as the previous one. And if it is, we just flip the last bit. Since the accepted values goes from 6 to 127, from what I've seen, it should be ok. I don't have an official RB3 pro guitar, but I have a YouRock Guitar that is compatible and works perfectly with a real MPA. When I use midi in rpcs3, I miss notes because of that bug. I've add a log message to test the patch and in a streak of nearly 150 notes, I should have missed nearly 20 notes. I had absolutely no missed note with thanks to the patch. fixes https://github.com/RPCS3/rpcs3/issues/18062 --------- Co-authored-by: Romain Janvier --- rpcs3/Emu/Io/RB3MidiGuitar.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Io/RB3MidiGuitar.cpp b/rpcs3/Emu/Io/RB3MidiGuitar.cpp index 9895722638..1d6d10bb76 100644 --- a/rpcs3/Emu/Io/RB3MidiGuitar.cpp +++ b/rpcs3/Emu/Io/RB3MidiGuitar.cpp @@ -265,7 +265,16 @@ void usb_device_rb3_midi_guitar::parse_midi_message(u8* msg, usz size) // read strings if (size == 8 && msg[0] == 0xF0 && msg[4] == 0x05) { - button_state.string_velocities[msg[5] - 1] = msg[6]; + // if the velocity remains the same, the game does not know that you've just played a string + u8& velocity = ::at32(button_state.string_velocities, msg[5] - 1); + if (msg[6] != 0 && msg[6] == velocity) + { + velocity = msg[6] ^ 1; // to be sure to change the velocity + } + else + { + velocity = msg[6]; + } } // read buttons