Skip to content

Commit 3947048

Browse files
author
Greg Smith
committed
Added support for setting global volume via Midi.
Hid the BPM indicator on 3.5B as it takes a fair bit of CPU usage to redraw the entire screen each time.
1 parent e656472 commit 3947048

File tree

3 files changed

+45
-20
lines changed

3 files changed

+45
-20
lines changed

source/.clangd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CompileFlags:
2+
Remove: [-f*, -m*]

source/main/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@
810810
midiControlChangeAssociations.set(117, { param: "CABSIM BYPASS", value: { type: "TOGGLE" } })
811811
midiControlChangeAssociations.set(118, { param: "TEMPO SOURCE", value: { type: "TOGGLE" } })
812812
midiControlChangeAssociations.set(119, { param: "TUNING REFERENCE", value: { type: "RANGE" } })
813+
midiControlChangeAssociations.set(122, { param: "GLOBAL VOLUME", value: { type: "RANGE" } })
813814

814815
// tap tempo
815816
let globalTapTempo = new TapTempo();

source/main/midi_helper.c

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,13 @@ esp_err_t midi_helper_adjust_param_via_midi(uint8_t change_num, uint8_t midi_val
12411241
return ESP_FAIL;
12421242
} break;
12431243

1244+
case 122:
1245+
{
1246+
param = TONEX_GLOBAL_MASTER_VOLUME;
1247+
value = midi_helper_scale_midi_to_float(param, midi_value);
1248+
value = tonex_params_clamp_value(param, value);
1249+
} break;
1250+
12441251
case 127:
12451252
{
12461253
// Custom case: use CC to change params.
@@ -1917,33 +1924,48 @@ uint16_t midi_helper_get_param_for_change_num(uint8_t change_num)
19171924
param = TONEX_PARAM_VIR_BLEND;
19181925
} break;
19191926

1920-
// below items not supported on bigger Tonex pedal, custom for this controller
1921-
case 116:
1922-
{
1923-
param = TONEX_GLOBAL_INPUT_TRIM;
1924-
} break;
1927+
// below items not supported on bigger Tonex pedal, custom for this controller
1928+
case 116:
1929+
{
1930+
param = TONEX_GLOBAL_INPUT_TRIM;
1931+
} break;
19251932

1926-
case 117:
1927-
{
1928-
param = TONEX_GLOBAL_CABSIM_BYPASS;
1929-
} break;
1933+
case 117:
1934+
{
1935+
param = TONEX_GLOBAL_CABSIM_BYPASS;
1936+
} break;
19301937

1931-
case 118:
1932-
{
1933-
param = TONEX_GLOBAL_TEMPO_SOURCE;
1934-
} break;
1938+
case 118:
1939+
{
1940+
param = TONEX_GLOBAL_TEMPO_SOURCE;
1941+
} break;
19351942

1936-
case 119:
1937-
{
1938-
param = TONEX_GLOBAL_TUNING_REFERENCE;
1939-
} break;
1943+
case 119:
1944+
{
1945+
param = TONEX_GLOBAL_TUNING_REFERENCE;
1946+
} break;
19401947

1941-
case 127:
1942-
{
1948+
case 120:
1949+
{
1950+
// reserved for setting preset in slot A
1951+
} break;
1952+
1953+
case 121:
1954+
{
1955+
// reserved for setting preset in slot B
1956+
} break;
1957+
1958+
case 122:
1959+
{
1960+
param = TONEX_GLOBAL_MASTER_VOLUME;
1961+
} break;
1962+
1963+
case 127:
1964+
{
19431965
// Need the CC value to use this, so this won't work for
19441966
// footswitches, and it's kind of irrelevant anyways.
19451967
ESP_LOGW(TAG, "Unsupported Midi change number %d", change_num);
1946-
}
1968+
}
19471969
}
19481970

19491971
return param;

0 commit comments

Comments
 (0)