-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 Program Change received with incorrect program number #5139
Comments
if I understand correctly you are compiling LMMS yourself? Have you tried if it works if you handle the case for So the relevant code section would look as follows: case MidiNoteOff:
case MidiNoteOn:
case MidiKeyPressure:
case MidiChannelPressure:
m_midiParseData.m_midiEvent.setKey( m_midiParseData.m_buffer[0] - KeysPerOctave );
m_midiParseData.m_midiEvent.setVelocity( m_midiParseData.m_buffer[1] );
break;
case MidiProgramChange:
m_midiParseData.m_midiEvent.setKey( m_midiParseData.m_buffer[0] );
m_midiParseData.m_midiEvent.setVelocity( m_midiParseData.m_buffer[1] );
break; I don't really know LMMS' MIDI code but it looks quite strange that a value of 12 is subtracted for all these events. Does the code for the "Note On" and "Note Off" events mean that LMMS plays every note an octave lower than other DAWs? |
Hi, Yes, I compile it myself from the yesterday's most recent commit on master (0db83c5).
I tested these changes with both Jack-MIDI and ALSA Sequencer, they work correctly now. Regarding subtraction of an octave, it seems that #1857 might be the reason. |
More mappingsI have investigated a bit further and found that several MIDI values, e.g. for "Note On" and "Note Off" are manipulated in What's surprising is that for example Triple Oscillator still plays an A4 = 440 Hz (69) instead of an A3 = 220 Hz (57). This means that somewhere the whole thing has to be corrected again. I found out that this more or less happens in the constructor of m_baseNoteModel.setInitValue( DefaultKey ); The value of
In the case of the pressed A4 LMMS can't handle the full note range of MIDI devicesIn if( inEvent.key() < 0 || inEvent.key() >= NumKeys )
{
return;
} If I trigger the lowest note on my MIDI keyboard this corresponds to a "Note On" with a value of 0. Because LMMS subtracts a value of 12 in Put differently: if you had a keyboard with 128 keys for each MIDI value then LMMS would ignore some of them and would likely also not forward them to VSTs which might be interested in the full range. I think LMMS should not manipulate the raw MIDI data and instead should just forward it. It should be left to consumers to decide how to deal with them, i.e. if they want to ignore some of the values. I think I will create a separate issue for this. |
Fixed in #5154. @artur-twardowski Thank you! |
Setup:
Preparation for Jack-MIDI:
Preparation for ALSA-Sequencer:
Steps to reproduce:
Expected behavior:
Actual behavior:
Further remarks:
The text was updated successfully, but these errors were encountered: