Skip to content

Commit

Permalink
Let the user bypass note on filtering when velocity is 0
Browse files Browse the repository at this point in the history
Only for standalone program, dbus is not done yet.
See #14
  • Loading branch information
tartina committed Jan 4, 2021
1 parent 5b8f5d9 commit ee48ece
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion a2jmidid.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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";
Expand Down Expand Up @@ -424,7 +425,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");
}
Expand Down Expand Up @@ -482,6 +483,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;
Expand Down
3 changes: 2 additions & 1 deletion jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "port_thread.h"

static bool g_freewheeling = false;
extern bool g_filter_note_on;

/*
* =================== Input/output port handling =========================
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion man/a2jmidid.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit ee48ece

Please sign in to comment.