midi: add option to disable outgoing note_on,vel=0 to note_off conversion

This commit is contained in:
jean-emmanuel 2025-09-15 08:15:33 +02:00
parent 74faac7baf
commit 48402e277d
5 changed files with 14 additions and 6 deletions

5
.gitignore vendored
View file

@ -5,9 +5,8 @@ node_modules/
/app/
# python/midi build
*.pyc
src/server/python/build
src/server/python/__pycache__
src/server/python/*
!src/server/python/*.py
# docs build
src/docs/widgets-reference.js

View file

@ -13,6 +13,9 @@
- scripting
- user scripts are longer protected against infinite loop and the main window object may be reached (it's not supported to break out of scripting context, but resources are no longer wasted to prevent it)
- midi
- add `no_auto_note_off` option
- breaking change
- dropped support for iOS 10.3

View file

@ -94,7 +94,11 @@ Send program changes with a `-1` offset to match some software/hardware implemen
**`note_off_velocity`**
Enable receiving noteOff messages with a velocity and on a different address than noteOn messages.
Use `/note_on` for noteOn messages and `/note_off` for noteOff messages instead of the defaut `/note` and velocity 0 for note off.
**`auto_note_off`**
Prevent converting outgoing noteOn messages with velocity 0 to noteOff messages.
**`device_name:virtual`** (*Linux / Mac only*): creates a virtual midi device with one input port and one output port

View file

@ -46,8 +46,10 @@ ignore_mtc = 'mtc' not in argv
ignore_rpn = 'rpn' not in argv and 'nrpn' not in argv
# option: parse active sensing
ignore_active_sensing = 'active_sensing' not in argv
# option: note off velocity
# option: note off velocity (/note_on and /note_off instead of only /note and velocity 0 for note off)
note_off_velocity = 'note_off_velocity' in argv
# option: no auto note off (do not translate received note_on with velocity 0 to note off)
no_auto_note_off = 'no_auto_note_off' in argv
# option: list midi ports
list_midi = 'list' in argv
list_midi_exit = 'list-only' in argv

View file

@ -260,7 +260,7 @@ def send_midi(name, event, *args):
m = [mtype, args[0]]
if mtype == NOTE_ON:
if args[2] == 0:
if args[2] == 0 and not no_auto_note_off:
mtype = NOTE_OFF
elif mtype == PITCH_BEND: