aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends
diff options
context:
space:
mode:
authorLeon Scheid <leon@weingut-scheid.de>2019-11-21 18:41:02 +0100
committerLeon Scheid <leon@weingut-scheid.de>2019-11-21 18:41:02 +0100
commitb4a9721ff7d93dd899eb8e6c64510afaf95cbbca (patch)
treed9aa9b18374ebdad031c43de92ee601926e7cf76 /backends
parentcb17ab98ebffb5b736068452da5a46016caba424 (diff)
downloadmidimonster-b4a9721ff7d93dd899eb8e6c64510afaf95cbbca.tar.gz
midimonster-b4a9721ff7d93dd899eb8e6c64510afaf95cbbca.tar.bz2
midimonster-b4a9721ff7d93dd899eb8e6c64510afaf95cbbca.zip
Chane NoteOff behavior
Diffstat (limited to 'backends')
-rw-r--r--backends/midi.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/backends/midi.c b/backends/midi.c
index 536457d..d609ad9 100644
--- a/backends/midi.c
+++ b/backends/midi.c
@@ -259,14 +259,20 @@ static int midi_handle(size_t num, managed_fd* fds){
ident.label = 0;
switch(ev->type){
case SND_SEQ_EVENT_NOTEON:
- case SND_SEQ_EVENT_NOTEOFF:
- case SND_SEQ_EVENT_NOTE:
ident.fields.type = note;
ident.fields.channel = ev->data.note.channel;
ident.fields.control = ev->data.note.note;
val.normalised = (double)ev->data.note.velocity / 127.0;
event_type = "note";
break;
+ case SND_SEQ_EVENT_NOTEOFF:
+ ident.fields.type = note;
+ ident.fields.channel = ev->data.note.channel;
+ ident.fields.control = ev->data.note.note;
+ val.normalised = (double)0;
+ event_type = "note";
+ break;
+ case SND_SEQ_EVENT_NOTE:
case SND_SEQ_EVENT_KEYPRESS:
ident.fields.type = pressure;
ident.fields.channel = ev->data.note.channel;