Skip to content

Commit 66bf92f

Browse files
committed
Fix note-selection octave range (10 octaves: -1..9)
1 parent 07bba70 commit 66bf92f

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

gui/tuna.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,9 @@ static bool cb_set_mode (RobWidget* handle, void *data) {
762762
mode = -1
763763
- rintf(robtk_spin_get_value(ui->spb_octave)+1) * 12.
764764
- robtk_select_get_value(ui->sel_note);
765+
if (mode < -128) {
766+
mode = -128;
767+
}
765768
break;
766769
}
767770
if (!ui->disable_signals) {
@@ -864,7 +867,7 @@ static RobWidget * toplevel(TunaUI* ui, void * const top)
864867
robtk_sep_set_linewidth(ui->sep[2], 1);
865868

866869
ui->spb_tuning = robtk_spin_new(220, 880, .5);
867-
ui->spb_octave = robtk_spin_new(-1, 10, 1);
870+
ui->spb_octave = robtk_spin_new(-1, 9, 1);
868871
ui->spb_freq = robtk_spin_new(20, 1000, .5); // TODO log-map
869872
ui->sel_mode = robtk_select_new();
870873
ui->sel_note = robtk_select_new();

lv2ttl/tuna.lv2.ttl.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
lv2:symbol "mode" ;
5555
lv2:name "Mode" ;
5656
lv2:default 0 ;
57-
lv2:minimum 0 ;
57+
lv2:minimum -128 ;
5858
lv2:maximum 8000 ;
5959
lv2:portProperty lv2:integer;
6060
lv2:scalePoint [ rdfs:label "auto"; rdf:value 0 ; ] ;

lv2ttl/tuna1.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static const RtkLv2Description _plugin_tuna_one = {
1616
{ "sysex", MIDI_OUT, nan, nan, nan, "MTS/SysEx output and Plugin to GUI communication"},
1717
{ "in", AUDIO_IN, nan, nan, nan, "Audio Input"},
1818
{ "out", AUDIO_OUT, nan, nan, nan, "Audio output"},
19-
{ "mode", CONTROL_IN, 0.000000, 0.000000, 8000.000000, "Mode"},
19+
{ "mode", CONTROL_IN, 0.000000, -128.000000, 8000.000000, "Mode"},
2020
{ "tuning", CONTROL_IN, 440.000000, 220.000000, 880.000000, "Tuning A440"},
2121
{ "rms", CONTROL_OUT, nan, -100.000000, -0.000000, "Signal Level (RMS)"},
2222
{ "freq_out", CONTROL_OUT, nan, 0.000000, 10000.000000, "Detected Frequency"},

lv2ttl/tuna2.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static const RtkLv2Description _plugin_tuna_two = {
1616
{ "sysex", MIDI_OUT, nan, nan, nan, "MTS/SysEx output and Plugin to GUI communication"},
1717
{ "in", AUDIO_IN, nan, nan, nan, "Audio Input"},
1818
{ "out", AUDIO_OUT, nan, nan, nan, "Audio output"},
19-
{ "mode", CONTROL_IN, 0.000000, 0.000000, 8000.000000, "Mode"},
19+
{ "mode", CONTROL_IN, 0.000000, -128.000000, 8000.000000, "Mode"},
2020
{ "tuning", CONTROL_IN, 440.000000, 220.000000, 880.000000, "Tuning A440"},
2121
{ "rms", CONTROL_OUT, nan, -100.000000, -0.000000, "Signal Level (RMS)"},
2222
{ "freq_out", CONTROL_OUT, nan, 0.000000, 10000.000000, "Detected Frequency"},

0 commit comments

Comments
 (0)