1
Fork 0

Let the user bypass note on filtering when velocity is 0

Only for standalone program, dbus is not done yet.
See https://github.com/linuxaudio/a2jmidid/issues/14

(cherry picked from commit ee48ecee4d2cf2cd73ca29cbc2bf0b709de150fe)
This commit is contained in:
Guido Aulisi 2021-01-04 11:51:57 +01:00 committed by Nedko Arnaudov
parent a530eb8281
commit ff9f7358d4
3 changed files with 10 additions and 3 deletions

View File

@ -66,6 +66,7 @@ static bool g_started = false;
struct a2j * g_a2j = NULL;
size_t g_max_jack_port_name_size;
bool g_disable_port_uniqueness = false;
bool g_filter_note_on = true;
bool g_a2j_export_hw_ports = false;
char * g_a2j_jack_server_name = "default";
@ -427,7 +428,7 @@ void
a2j_help(
const char * self)
{
a2j_info("Usage: %s [-j jack-server] [-e | --export-hw] [-u]", self);
a2j_info("Usage: %s [-j jack-server] [-e | --export-hw] [-u] [-n]", self);
a2j_info("Defaults:");
a2j_info("-j default");
}
@ -485,6 +486,9 @@ main(
case 'u':
g_disable_port_uniqueness = true;
break;
case 'n':
g_filter_note_on = false;
break;
default:
a2j_help(argv[0]);
return 1;

3
jack.c
View File

@ -36,6 +36,7 @@
#include "port_thread.h"
static bool g_freewheeling = false;
extern bool g_filter_note_on;
/*
* =================== Input/output port handling =========================
@ -176,7 +177,7 @@ a2j_input_event(
}
// fixup NoteOn with vel 0
if ((data[0] & 0xF0) == 0x90 && data[2] == 0x00) {
if (g_filter_note_on && (data[0] & 0xF0) == 0x90 && data[2] == 0x00) {
data[0] = 0x80 + (data[0] & 0x0F);
data[2] = 0x40;
}

View File

@ -3,7 +3,7 @@
.SH NAME
a2jmidid \- JACK MIDI daemon for ALSA MIDI
.SH SYNOPSIS
.B a2jmidid [-j jack-server] [e | --export-hw]
.B a2jmidid [-j jack-server] [e | --export-hw] [-u] [-n]
.SH DESCRIPTION
a2jmidid is a daemon that implements automatic bridging. For every ALSA
sequencer port you get one JACK midi port. If ALSA sequencer port is
@ -16,6 +16,8 @@ forces a2jmidid to bridge hardware ports as well as software ports
forces a2jmidid to generate non-unique port names (see NOTES)
.IP -j
specifies which jack-server to use
.IP -n
do not filter note on
.SH NOTES
ALSA does not guarantee client names to by unique. I.e. it is possible
to have two apps that create two clients with same ALSA client name.