commit e9183c51bed547b078642947d99cf2b0110e4246
parent 2af607d5676dd262537e2a935a4e60f80c133bda
Author: Tal Aviram <me@talaviram.com>
Date: Tue, 7 Sep 2021 18:35:35 +0300
controller - pan parameter
Diffstat:
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/source/jucePlugin/VirusController.cpp b/source/jucePlugin/VirusController.cpp
@@ -330,6 +330,21 @@ namespace Virus
return prefix + juce::String(juce::roundToInt(bankIdx + 1));
}
+ juce::String numToPan(float panIdx, Parameter::Description)
+ {
+ // handles rounding due to continuous...
+ const auto idx = juce::roundToInt(panIdx);
+ if (idx == 64)
+ return "Center";
+ if (idx == 0)
+ return "Left";
+ if (idx == 127)
+ return "Right";
+
+ const auto sign = idx > 64 ? "+" : "";
+ return sign + juce::String(juce::roundToInt(idx - 64));
+ }
+
const std::initializer_list<Parameter::Description> Controller::m_paramsDescription =
{
{Parameter::Page::A, Parameter::Class::PERFORMANCE_CONTROLLER, 0, "Bank Select", {0, 3 + 26}, numToBank, {}, false, true, false}, // The Virus TI contains 4 banks of RAM, followed by 26 banks of ROM
@@ -342,7 +357,7 @@ namespace Virus
{Parameter::Page::A, Parameter::Class::PERFORMANCE_CONTROLLER, 7, "Channel Volume", {0,127}, {},{}, true, false, false},
{Parameter::Page::A, Parameter::Class::PERFORMANCE_CONTROLLER, 8, "Balance", {0,127}, {},{}, true, false, false},
{Parameter::Page::A, Parameter::Class::PERFORMANCE_CONTROLLER, 9, "Contr 9", {0,127}, {},{}, false, false, false},
- {Parameter::Page::A, Parameter::Class::SOUNDBANK_A, 10, "Panorama", {0,127}, {},{}, true, false, false},
+ {Parameter::Page::A, Parameter::Class::SOUNDBANK_A, 10, "Panorama", {0,127}, numToPan,{}, true, false, false},
{Parameter::Page::A, Parameter::Class::PERFORMANCE_CONTROLLER, 11, "Expression", {0,127}, {},{}, true, false, false},
{Parameter::Page::A, Parameter::Class::PERFORMANCE_CONTROLLER, 12, "Contr 12", {0,127}, {},{}, false, false, false},
{Parameter::Page::A, Parameter::Class::PERFORMANCE_CONTROLLER, 13, "Contr 13", {0,127}, {},{}, false, false, false},