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 - fixedInputVelocity applied to every event #3694

Open
gi0e5b06 opened this issue Jul 11, 2017 · 4 comments
Open

MIDI - fixedInputVelocity applied to every event #3694

gi0e5b06 opened this issue Jul 11, 2017 · 4 comments
Labels

Comments

@gi0e5b06
Copy link

MidiPort.cpp lines 131-148
The following code should be moved inside the test just above. FixedInputVelocity should only be applied to relevant events.

if( fixedInputVelocity() >= 0 && inEvent.velocity() > 0 )
{ inEvent.setVelocity( fixedInputVelocity() ); }
@zonkmachine
Copy link
Member

Hi!

Well spotted! This was actually fixed in stable-1.2 in this commit less than a week ago: #3678
We're working on merging back commits from stables-1.2 to master so you'll see it in master in a day or two.

PS. If you press/select the line number on code in github, you can copy/paste the link and send people directly to the issue. Here's what the fixed code looks like: https://github.com/LMMS/lmms/blob/d65e1a361a60498f2371accf3b50b32ff834ab2f/src/core/midi/MidiPort.cpp#L117:L141

@gi0e5b06
Copy link
Author

Actually I think the changes on velocity shouldn't be implemented there, as it modifies midi messages that you want to receive unchanged. Also, in the same function, there is a test that discards Note* messages if the key is not standard (0-88). But on a lot of hardware, buttons are keys with a higher number. I had to remove that test to use the buttons on my midimix.
Velocity control is needed somewhere, just not here.

void MidiPort::processInEvent( const MidiEvent& event, const MidiTime& time )
{
	// mask event
	if( isInputEnabled() &&
		( inputChannel() == 0 || inputChannel()-1 == event.channel() ) )
	{
		m_midiEventProcessor->processInEvent( event, time );
	}
}

@PhysSong
Copy link
Member

I had to remove that test to use the buttons on my midimix.

Are there any problems with the test? Could you please explain more?

@gi0e5b06
Copy link
Author

@PhysSong The buttons of (all) my hardware midi contollers generate NoteOn/NoteOff events. These events were discarded by the test so they never reach the controllers in LMMS (mute for example).

@zonkmachine zonkmachine changed the title Bug: fixedInputVelocity applied to every event MIDI - fixedInputVelocity applied to every event Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants