Skip to content

Commit

Permalink
Fix keyrange mode min/max port-range
Browse files Browse the repository at this point in the history
  • Loading branch information
x42 committed Sep 8, 2019
1 parent d1af114 commit 9ccb77f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions filters/keyrange.c
Expand Up @@ -13,7 +13,7 @@ MFD_FILTER(keyrange)
, TTF_IPORT(2, "upper", "Highest Note", 0, 127, 127,
lv2:portProperty lv2:integer; units:unit units:midiNote ;
rdfs:comment "upper end of note-range (inclusive)")
, TTF_IPORT(3, "mode", "Operation Mode", 0, 3, 1,
, TTF_IPORT(3, "mode", "Operation Mode", 0, 2, 1,
lv2:portProperty lv2:integer; lv2:portProperty lv2:enumeration;
lv2:scalePoint [ rdfs:label "Bypass" ; rdf:value 0 ] ;
lv2:scalePoint [ rdfs:label "Include Range" ; rdf:value 1 ] ;
Expand All @@ -31,7 +31,8 @@ filter_midi_keyrange(MidiFilter* self,
const uint8_t* const buffer,
uint32_t size)
{
const int mode = RAIL(floorf(*self->cfg[3]),0, 3);
const int mode = RAIL(floorf(*self->cfg[3]),0, 2);
fprintf (stderr, "MODE: %d\n", mode);
const uint8_t chs = midi_limit_chn(floorf(*self->cfg[0]) -1);
const uint8_t chn = buffer[0] & 0x0f;
uint8_t mst = buffer[0] & 0xf0;
Expand Down Expand Up @@ -81,7 +82,7 @@ static void filter_preproc_keyrange(MidiFilter* self) {
uint8_t buf[3];
buf[2] = 0;

const int mode = RAIL(floorf(*self->cfg[3]),0, 3);
const int mode = RAIL(floorf(*self->cfg[3]),0, 2);
const uint8_t low = midi_limit_val(floorf(*self->cfg[1]));
const uint8_t upp = midi_limit_val(floorf(*self->cfg[2]));

Expand Down

0 comments on commit 9ccb77f

Please sign in to comment.