Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P purr-data
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 362
    • Issues 362
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 54
    • Merge requests 54
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Jonathan Wilkes
  • purr-data
  • Merge requests
  • !240

ALSA MIDI backend: fix for bogus zero-velocity note-offs

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Albert Gräf requested to merge aggraef/purr-data:zero-noteoff-fix into master Sep 22, 2018
  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 1

In the ALSA MIDI backend, we're outputting zero-velocity note-off messages; we should output a note-on with zero velocity instead, which is also what vanilla does in the latest versions. The PR fixes this.

Rationale: The MIDI standard doesn't really specify what a note-off with zero velocity is supposed to mean, but it suggests that a medium velocity of 64 should be used in cases where no actual velocity value is available, not 0. In principle, note-offs with zero velocity should be equivalent to a note-on with zero velocity as well, but I found that this doesn't always work. E.g., my AKAI APCmini will turn the LED of a button off when I send a note-on with velocity 0, but just ignore note-offs with velocity 0. I've had similar issues with other devices taking note input as feedback.

To avoid any such trouble, we should just output note-ons with velocity 0 to denote note-offs. That's what the standard recommends in such cases (one reason is that backends can then make good use of running status). I've never seen a device or application emit a proper note-off which doesn't actually have note-off velocity sensing, only (older) Pd versions.

Note that we inherited this behavior from vanilla, but this has since been fixed there by danomatika's fairly comprehensive MIDI fixes in https://github.com/pure-data/pure-data/pull/211. We should pull this over eventually, but it's a fairly complicated changeset which touches on both the MIDI backend infrastructure and all the backends, so I haven't had the time to look at it yet. In the meantime, this PR fixes the most glaring remaining issue in our ALSA backend.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: zero-noteoff-fix