Skip to content

Commit

Permalink
stimuli: raise threshold for range -> button from 1 to 64
Browse files Browse the repository at this point in the history
This means that we switch in the middle of the range, increasing
the zones in which the control can be safely "parked", and also
avoiding issues with devices that have difficulties reaching the
end of the range.

Also updated test/stimin
  • Loading branch information
wpwrak committed Feb 11, 2012
1 parent a788442 commit a60a417
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/compiler/test/stimin
Expand Up @@ -43,11 +43,12 @@ EOF
#------------------------------------------------------------------------------

ptest "stimuli, input, MIDI: range -> button" -c -q \
-v sx -m 0=63 -m 0=127 -m 0=0 <<EOF
-v sx -m 0=63 -m 0=64 -m 0=127 -m 0=0 <<EOF
midi "foo" { bar = range(1, 0); }
sx = button(bar);
EOF
expect <<EOF
0
1
1
0
Expand All @@ -56,11 +57,12 @@ EOF
#------------------------------------------------------------------------------

ptest "stimuli, input, MIDI: range -> toggle" -c -q \
-v sx -m 0=63 -m 0=127 -m 0=0 <<EOF
-v sx -m 0=63 -m 0=64 -m 0=127 -m 0=0 <<EOF
midi "foo" { bar = range(1, 0); }
sx = toggle(bar);
EOF
expect <<EOF
0
1
1
0
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/stimuli.c
Expand Up @@ -80,7 +80,7 @@ static void midi_proc_diff_linear(struct s_midi_ctrl *ct, int value)

static void midi_proc_range_button(struct s_midi_ctrl *ct, int value)
{
regs_set(&ct->regs, !!value);
regs_set(&ct->regs, value > 63);
}

static void midi_proc_diff_button(struct s_midi_ctrl *ct, int value)
Expand Down

0 comments on commit a60a417

Please sign in to comment.