20 constexpr float kNumberWidthPercent = 0.2f;
21 constexpr float kSourceWidthPercent = 0.2f;
22 constexpr float kDestinationWidthPercent = 0.2f;
23 constexpr float kPaddingWidthPercent = 0.04f;
24 constexpr float kMatrixHeightInRows = 12.0f;
29 bool local_description =
false;
32 const std::string kNoConnectionString =
"-";
33 const SubMenu kDestinationSubMenuPrefixes[] = {
35 {
"osc_1_",
"Oscillator 1",
true },
36 {
"osc_2_",
"Oscillator 2",
true },
37 {
"osc_3_",
"Oscillator 3",
true },
38 {
"sample_",
"Sample" },
39 {
"filter_1_",
"Filter 1",
true },
40 {
"filter_2_",
"Filter 2",
true },
41 {
"filter_fx_",
"Filter FX",
true },
44 {
"random_",
"Randoms" },
45 {
"env_",
"Envelopes" },
46 {
"modulation_",
"Mod Matrix" },
48 {
"chorus_",
"Chorus" },
49 {
"compressor_",
"Compressor" },
50 {
"delay_",
"Delay" },
51 {
"distortion_",
"Distortion" },
52 {
"phaser_",
"Phaser" },
53 {
"flanger_",
"Flanger" },
54 {
"reverb_",
"Reverb" },
55 {
"delay_",
"Delay" },
56 {
"eq_",
"Equalizer" },
59 PopupItems createSubMenuForParameterPrefix(
const std::string& name,
const String& prefix,
60 const std::vector<String>& parameter_names,
bool local) {
62 int prefix_length =
static_cast<int>(prefix.length());
64 for (
const String& parameter_name : parameter_names) {
65 if (parameter_name.substring(0, prefix_length) == prefix) {
66 std::string display_name;
71 items.addItem(index, display_name);
79 PopupItems createMiscSubMenu(
const std::string& name,
const std::vector<String>& parameter_names) {
82 for (
const String& parameter_name : parameter_names) {
83 bool prefix_match =
false;
84 for (
const auto& prefix : kDestinationSubMenuPrefixes) {
85 int prefix_length =
static_cast<int>(prefix.prefix.length());
86 if (prefix_length && parameter_name.substring(0, prefix_length) == String(prefix.prefix))
90 if (!prefix_match && parameter_name != String(kNoConnectionString)) {
92 items.addItem(index, display_name);
161 bool operator()(
const String& first,
const String& second)
const {
162 return first.compareNatural(second) < 0;
169 on_(std::move(on)), off_(std::move(off)) { }
172 if (getToggleState())
176 ToggleButton::buttonStateChanged();
187 parent_(nullptr), modulation_amounts_(), scroll_offset_(0), modulation_active_() { }
190 std::string modulation_prefix =
"modulation_amount_";
192 std::string number = std::to_string(i + 1);
201 parent_ = findParentComponentOfClass<SynthGuiInterface>();
203 if (parent_ !=
nullptr)
208 if (parent_ ==
nullptr)
211 float width = getWidth();
212 float height = getHeight();
216 if (modulation_active_[i]) {
217 float min_x = 2.0f * modulation_bounds_[i].getX() / width - 1.0f;
218 float max_x = 2.0f * modulation_bounds_[i].getRight() / width - 1.0f;
219 float y = 1.0f - 2.0f * (modulation_bounds_[i].getBottom() - scroll_offset_) / height;
221 float value = modulation_amounts_[i]->
value()[index];
226 float center_x = (max_x + min_x) / 2.0f;
249 modulation_bounds_[i] = bounds;
253 modulation_active_[i] = active;
257 scroll_offset_ = offset;
270 int index = std::round(value);
276 int value = getValue();
277 for (
int i = 0; i < selections_->size(); ++i) {
278 if (selections_->at(i) == name) {
280 setValue(i, notification_type);
287 setValue(0, notification_type);
294 static constexpr int kWideWidth = 420;
297 *popup_items_, [=](
int selection) { setValue(selection); });
301 [=](
int selection) { setValue(selection); });
306 const std::vector<String>* sources,
const std::vector<String>* destinations) :
307 SynthSection(String(
"MOD ") + String(index)), index_(index), connection_(nullptr), parent_(nullptr),
308 last_source_value_(0.0f), last_destination_value_(0.0f), last_amount_value_(0.0),
309 updating_(false), selected_(false) {
314 source_ = std::make_unique<ModulationSelector>(
"source", sources, source_items,
false);
315 addAndMakeVisible(
source_.get());
317 source_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
320 source_->setScrollWheelEnabled(
false);
322 destination_ = std::make_unique<ModulationSelector>(
"destination", destinations, destination_items,
true);
325 destination_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
330 amount_slider_ = std::make_unique<SynthSlider>(String(
"modulation_") + String(
index + 1) + String(
"_amount"));
335 power_slider_ = std::make_unique<SynthSlider>(String(
"modulation_") + String(
index + 1) + String(
"_power"));
338 power_slider_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
340 String bipolar_text = String(
"modulation_") + String(
index + 1) + String(
"_bipolar");
341 bipolar_ = std::make_unique<OpenGlShapeButton>(bipolar_text);
343 bipolar_->setClickingTogglesState(
true);
349 stereo_ = std::make_unique<SynthButton>(String(
"modulation_") + String(
index + 1) + String(
"_stereo"));
355 String bypass_string = String(
"modulation_") + String(
index + 1) + String(
"_bypass");
356 bypass_ = std::make_unique<BypassButton>(bypass_string,
"X", String(
index + 1));
370 int width = getWidth();
371 int x_padding = width * kPaddingWidthPercent;
373 int source_width = width * kSourceWidthPercent;
374 int destination_width = width * kDestinationWidthPercent;
375 int component_height = getHeight() - 2 * y_padding;
377 int text_component_height = component_height * 0.7f;
378 int text_y = (getHeight() - text_component_height) / 2.0f;
380 bypass_->setBounds(y_padding, text_y, getHeight() - 2 * y_padding, text_component_height);
381 source_->setBounds(
bypass_->getRight() + y_padding, y_padding, source_width, component_height);
384 int bipolar_x =
source_->getRight() + x_padding / 2.0f;
385 bipolar_->setBounds(bipolar_x, y_padding, component_height, component_height);
387 int stereo_x =
bipolar_->getRight() + x_padding;
388 int expand = x_padding / 2;
389 stereo_->setBounds(stereo_x - expand, text_y, component_height + 2 * expand, text_component_height);
391 int power_x = stereo_x + component_height + x_padding;
392 power_slider_->setBounds(power_x, y_padding, component_height, component_height);
394 int destination_x = width - x_padding - destination_width;
395 destination_->setBounds(destination_x, y_padding, destination_width + x_padding / 2.0f, component_height);
399 int amount_x =
power_slider_->getRight() + x_padding - widget_margin;
400 int amount_width = destination_x - amount_x - x_padding / 2.0f + 2 * widget_margin;
401 amount_slider_->setBounds(amount_x, (getHeight() - slider_height + 1) / 2, amount_width, slider_height);
406 g.fillRect(getLocalBounds());
410 g.fillRoundedRectangle(
source_->getBounds().toFloat(), rounding);
411 g.fillRoundedRectangle(
destination_->getBounds().toFloat(), rounding);
423 listener->rowSelected(
this);
467 String source_name =
source_->getSelection();
474 String source_name =
source_->getSelection();
496 listener->rowSelected(
this);
514 if (original ==
"aftertouch")
515 return "After Touch";
517 String modified = original.replaceFirstOccurrenceOf(
"control_",
"");
519 tokens.addTokens(modified,
"_",
"");
521 for (
const String& token : tokens) {
522 String capitalized = String(token.substring(0, 1)).toUpperCase() + token.substring(1);
523 result += capitalized +
" ";
526 return result.trim();
534 SynthSection(
"MODULATION MATRIX"), container_(
"Container") {
538 sort_ascending_ =
true;
542 addAndMakeVisible(viewport_);
543 viewport_.setViewedComponent(&container_);
545 viewport_.setScrollBarsShown(
false,
false,
true,
false);
547 source_strings_.push_back(kNoConnectionString);
548 for (
const auto& source : sources)
549 source_strings_.push_back(source.first);
551 std::sort(source_strings_.begin(), source_strings_.end(), comparator);
553 destination_strings_.push_back(kNoConnectionString);
554 for (
const auto& destination : destinations)
555 destination_strings_.push_back(destination.first);
557 std::sort(destination_strings_.begin(), destination_strings_.end(), comparator);
559 source_popup_items_.
addItem(0,
"-");
560 for (
int i = 1; i < source_strings_.size(); ++i) {
562 source_popup_items_.
addItem(i, display_name);
565 destination_popup_items_.
addItem(0, kNoConnectionString);
566 destination_popup_items_.
addItem(createMiscSubMenu(
"Global", destination_strings_));
567 for (
const auto& sub_menu_prefix : kDestinationSubMenuPrefixes) {
568 if (sub_menu_prefix.prefix.empty())
569 destination_popup_items_.
addItem(-1,
"");
571 bool local = sub_menu_prefix.local_description;
572 PopupItems sub_items = createSubMenuForParameterPrefix(sub_menu_prefix.name, sub_menu_prefix.prefix,
573 destination_strings_, local);
574 destination_popup_items_.
addItem(sub_items);
579 rows_[i] = std::make_unique<ModulationMatrixRow>(i, &source_popup_items_, &destination_popup_items_,
580 &source_strings_, &destination_strings_);
581 rows_[i]->addListener(
this);
582 row_order_.push_back(rows_[i].get());
584 container_.addAndMakeVisible(rows_[i].get());
587 scroll_bar_ = std::make_unique<OpenGlScrollBar>();
588 addAndMakeVisible(scroll_bar_.get());
590 scroll_bar_->addListener(
this);
591 scroll_bar_->setAlwaysOnTop(
true);
593 readouts_ = std::make_unique<ModulationMeterReadouts>();
595 readouts_->setInterceptsMouseClicks(
false,
false);
597 grid_size_x_ = std::make_unique<SynthSlider>(
"grid_size_x");
601 grid_size_x_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
603 grid_size_x_->addListener(
this);
605 grid_size_x_->setMaxDecimalPlaces(0);
606 grid_size_x_->setTextHeightPercentage(0.6f);
607 grid_size_x_->setSensitivity(0.2f);
610 grid_size_y_ = std::make_unique<SynthSlider>(
"grid_size_y");
614 grid_size_y_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
616 grid_size_y_->addListener(
this);
618 grid_size_y_->setMaxDecimalPlaces(0);
619 grid_size_y_->setTextHeightPercentage(0.6f);
620 grid_size_y_->setSensitivity(0.2f);
623 paint_ = std::make_unique<OpenGlShapeButton>(
"paint");
624 paint_->useOnColors(
true);
625 paint_->setClickingTogglesState(
true);
626 addAndMakeVisible(paint_.get());
628 paint_->addListener(
this);
631 remap_name_ = std::make_unique<PlainTextComponent>(
"remap_name", String(
"MOD REMAP ") + String(1));
635 paint_pattern_ = std::make_unique<PaintPatternSelector>(
"paint_pattern");
637 paint_pattern_->addListener(
this);
639 paint_pattern_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
643 paint_pattern_->setTextHeightPercentage(0.45f);
644 paint_pattern_->setActive(
false);
647 smooth_ = std::make_unique<OpenGlShapeButton>(
"smooth");
648 smooth_->useOnColors(
true);
649 smooth_->setClickingTogglesState(
true);
650 addAndMakeVisible(smooth_.get());
652 smooth_->addListener(
this);
655 preset_selector_ = std::make_unique<PresetSelector>();
657 preset_selector_->addListener(
this);
659 preset_selector_->setText(
"Linear");
670 int row_height = getRowHeight();
672 total_height = std::max(total_height, viewport_.getHeight());
673 container_.setBounds(container_.getX(), container_.getY(), getWidth(), total_height);
676 Image background_image = Image(Image::ARGB, getWidth() * mult, total_height * mult,
true);
677 Graphics background_graphics(background_image);
678 background_graphics.addTransform(AffineTransform::scale(mult));
680 for (
int i = 0; i < num_shown_; ++i) {
683 background_graphics.saveState();
684 Rectangle<int> bounds = row->getBounds();
685 background_graphics.reduceClipRegion(bounds);
686 background_graphics.setOrigin(bounds.getTopLeft());
688 background_graphics.restoreState();
696 Rectangle<int> matrix_bounds(0, 0, getWidth(), viewport_.getBottom());
697 int remap_y = matrix_bounds.getBottom() + padding;
698 Rectangle<int> remap_bounds(0, remap_y, getWidth(), getHeight() - remap_y);
703 int row_height = getRowHeight();
705 int width = getWidth();
706 int x_padding = width * kPaddingWidthPercent;
708 int source_width = width * kSourceWidthPercent;
709 int destination_width = width * kDestinationWidthPercent;
710 int component_height = row_height - 2 * y_padding;
711 int bipolar_x = source_width + row_height;
712 int stereo_x = bipolar_x + component_height + x_padding;
713 int morph_x = stereo_x + component_height + x_padding;
714 int amount_x = morph_x + component_height + x_padding;
715 int destination_x = getWidth() - destination_width - x_padding;
718 g.fillRect(row_height, 0, 1, title_width);
719 g.fillRect(morph_x, 0, 1, title_width);
720 g.fillRect(bipolar_x, 0, 1, title_width);
721 g.fillRect(stereo_x, 0, 1, title_width);
722 g.fillRect(amount_x, 0, 1, title_width);
723 g.fillRect(destination_x, 0, 1, title_width);
728 g.setFont(sort_column_ ==
kNumber ? sorted : regular);
729 g.drawText(
"#", 0, 0, row_height, title_width, Justification::centred);
730 g.setFont(sort_column_ ==
kSource ? sorted : regular);
731 g.drawText(
"SOURCE", row_height, 0, bipolar_x - row_height, title_width, Justification::centred);
732 g.setFont(sort_column_ ==
kBipolar ? sorted : regular);
733 g.drawText(
"BIPOLAR", bipolar_x, 0, stereo_x - bipolar_x, title_width, Justification::centred);
734 g.setFont(sort_column_ ==
kStereo ? sorted : regular);
735 g.drawText(
"STEREO", stereo_x, 0, morph_x - stereo_x, title_width, Justification::centred);
736 g.setFont(sort_column_ ==
kMorph ? sorted : regular);
737 g.drawText(
"MORPH", morph_x, 0, amount_x - morph_x, title_width, Justification::centred);
738 g.setFont(sort_column_ ==
kAmount ? sorted : regular);
739 g.drawText(
"AMOUNT", amount_x, 0, destination_x - amount_x, title_width, Justification::centred);
740 g.setFont(sort_column_ ==
kDestination ? sorted : regular);
741 g.drawText(
"DESTINATION", destination_x - 0.5f * x_padding, 0,
742 getWidth() - destination_x + 0.5f * x_padding, title_width, Justification::centred);
749 g.reduceClipRegion(0, title_width, getWidth(), getHeight());
750 g.fillRoundedRectangle(0, 0, getWidth(), viewport_.getBottom(), rounding);
757 if (map_editors_[selected_index_] && map_editors_[0]) {
759 Rectangle<int> bounds = getLocalArea(map_editors_[0].get(), map_editors_[0]->getLocalBounds());
760 g.reduceClipRegion(bounds);
761 g.setOrigin(bounds.getTopLeft());
762 map_editors_[selected_index_]->paintBackground(g);
767 Rectangle<int> preset_bounds = getLocalArea(preset_selector_.get(), preset_selector_->getLocalBounds());
768 g.reduceClipRegion(preset_bounds);
769 g.setOrigin(preset_bounds.getTopLeft());
770 preset_selector_->paintBackground(g);
774 g.fillRoundedRectangle(paint_->getX(), paint_->getY(),
775 paint_pattern_->getRight() - paint_->getX(), paint_->getHeight(), widget_rounding);
776 g.fillRoundedRectangle(grid_size_x_->getX(), grid_size_x_->getY(),
777 grid_size_y_->getRight() - grid_size_x_->getX(), grid_size_x_->getHeight(), widget_rounding);
779 int grid_label_x = grid_size_x_->getX();
780 int grid_size_width = std::max(1, grid_size_y_->getRight() - grid_label_x);
783 g.drawText(
"-", grid_label_x, grid_size_x_->getY(), grid_size_width, grid_size_x_->getHeight(),
784 Justification::centred,
false);
792 Rectangle<int> matrix_bounds(0, 0, getWidth(), viewport_.getBottom());
795 int remap_y = viewport_.getBottom() +
getPadding();
796 Rectangle<int> remap_bounds(0, remap_y, getWidth(), getHeight() - remap_y);
802 if (parent ==
nullptr)
807 rows_[i]->setGuiParent(parent);
809 rows_[i]->setConnection(connection);
811 if (map_editors_[i] ==
nullptr) {
813 std::string name =
"modulation_source_" + std::to_string(i + 1);
814 map_editors_[i] = std::make_unique<LineMapEditor>(map_generator, name);
816 map_editors_[i]->addListener(
this);
819 map_editors_[i]->setVisible(
false);
822 rows_[0]->select(
true);
823 map_editors_[0]->setVisible(
true);
827 int row_height = getRowHeight();
828 int matrix_width = getWidth();
832 int remap_section_y = viewport_.getBottom() +
getPadding();
833 int remap_y = remap_section_y + title_width;
834 Rectangle<int> mapping_bounds(widget_margin, remap_y,
835 getWidth() - 2 * widget_margin, getHeight() - remap_y - widget_margin);
841 if (map_editors_[i]) {
842 map_editors_[i]->setBounds(mapping_bounds);
843 map_editors_[i]->setSizeRatio(size_ratio);
849 static constexpr float kScrollBarWidth = 13.0f;
853 int row_height = getRowHeight();
858 int matrix_width = getWidth();
859 viewport_.setBounds(0, title_width, matrix_width, matrix_height);
862 int preset_x = getWidth() / 2;
863 int top_bar_height = title_width - 2 * widget_margin;
864 int top_bar_y = viewport_.getBottom() +
getPadding() + widget_margin;
865 preset_selector_->setBounds(preset_x, top_bar_y, getWidth() - preset_x - widget_margin, top_bar_height);
867 smooth_->setBounds(preset_x - title_width - widget_margin, top_bar_y, title_width, top_bar_height);
868 int grid_y_x = smooth_->getX() - title_width - widget_margin;
869 int grid_x_x = grid_y_x - title_width - widget_margin;
870 grid_size_y_->setBounds(grid_y_x, top_bar_y, title_width, top_bar_height);
871 grid_size_x_->setBounds(grid_x_x, top_bar_y, title_width, top_bar_height);
874 int paint_pattern_width = 3 * top_bar_height;
875 paint_pattern_->setBounds(grid_x_x - paint_pattern_width - widget_margin, top_bar_y,
876 paint_pattern_width, top_bar_height);
878 paint_->setBounds(paint_pattern_->getX() - top_bar_height, top_bar_y, top_bar_height, top_bar_height);
880 remap_name_->setBounds(widget_margin, top_bar_y, paint_->getX() - 2 * widget_margin, top_bar_height);
881 remap_name_->setTextSize(title_width * 0.45f);
887 container_.setBounds(0, title_width, matrix_width, container_height);
889 int scroll_bar_width =
size_ratio_ * kScrollBarWidth;
890 scroll_bar_->setBounds(getWidth() - scroll_bar_width - 1, title_width, scroll_bar_width, matrix_height);
898 readouts_->setBounds(viewport_.getBounds());
900 readouts_->setMeterBounds(i, rows_[i]->getMeterBounds() + rows_[i]->getPosition());
904 if (changed_slider == grid_size_x_.get()) {
905 if (map_editors_[selected_index_])
906 map_editors_[selected_index_]->setGridSizeX(grid_size_x_->getValue());
908 else if (changed_slider == grid_size_y_.get()) {
909 if (map_editors_[selected_index_])
910 map_editors_[selected_index_]->setGridSizeY(grid_size_y_->getValue());
912 else if (changed_slider == paint_pattern_.get()) {
913 if (map_editors_[selected_index_])
921 if (clicked_button == paint_.get()) {
922 if (map_editors_[selected_index_])
923 map_editors_[selected_index_]->setPaint(paint_->getToggleState());
924 paint_pattern_->setActive(paint_->getToggleState());
926 else if (clicked_button == smooth_.get()) {
927 if (map_editors_[selected_index_])
928 map_editors_[selected_index_]->setSmooth(smooth_->getToggleState());
936 if (map_editors_[selected_index_])
937 smooth_->setToggleState(map_editors_[selected_index_]->getSmooth(), dontSendNotification);
941 if (getWidth() <= 0 || getHeight() <= 0)
945 for (
auto& row : rows_) {
946 row->updateDisplay();
947 row->setActive(row->connected());
948 readouts_->setMeterActive(i++, row->connected());
951 if (map_editors_[selected_index_])
952 map_editors_[selected_index_]->setActive(rows_[selected_index_]->connected());
958 rows_[index]->updateDisplayValue();
976 if (num_shown_ != num_show) {
977 num_shown_ = num_show;
983 if (rows_[selected_row->
index()]->selected())
987 bool selected = rows_[i].get() == selected_row;
988 rows_[i]->select(selected);
989 if (map_editors_[i]) {
990 map_editors_[i]->setVisible(selected);
993 map_editors_[i]->setActive(rows_[i]->connected());
996 smooth_->setToggleState(map_editors_[i]->getModel()->smooth(), dontSendNotification);
997 map_editors_[i]->setGridSizeX(grid_size_x_->getValue());
998 map_editors_[i]->setGridSizeY(grid_size_y_->getValue());
1000 map_editors_[i]->setPaint(paint_->getToggleState());
1001 remap_name_->setText(String(
"MOD REMAP ") + String(i + 1));
1011 int x = e.position.x;
1012 int width = getWidth();
1013 int x_padding = width * kPaddingWidthPercent;
1014 int row_height = getRowHeight();
1016 int component_height = row_height - 2 * y_padding;
1017 int source_width = width * kSourceWidthPercent;
1018 int destination_width = width * kDestinationWidthPercent;
1019 int bipolar_x = source_width + 1.5f * x_padding;
1020 int stereo_x = bipolar_x + component_height + x_padding;
1021 int morph_x = stereo_x + component_height + x_padding;
1022 int amount_x = morph_x + component_height + x_padding;
1023 int destination_x = getWidth() - destination_width - 1.5f * x_padding;
1028 else if (x < bipolar_x)
1030 else if (x < stereo_x)
1032 else if (x < morph_x)
1034 else if (x < amount_x)
1036 else if (x < destination_x)
1041 if (sort_column == sort_column_)
1042 sort_ascending_ = !sort_ascending_;
1044 sort_ascending_ =
true;
1046 sort_column_ = sort_column;
1050void ModulationMatrix::sort() {
1051 if (sort_column_ ==
kNumber) {
1052 if (sort_ascending_)
1053 std::stable_sort(row_order_.begin(), row_order_.end(), compareIndexAscending);
1055 std::stable_sort(row_order_.begin(), row_order_.end(), compareIndexDescending);
1057 else if (sort_column_ ==
kSource) {
1058 if (sort_ascending_)
1059 std::stable_sort(row_order_.begin(), row_order_.end(), compareSourceAscending);
1061 std::stable_sort(row_order_.begin(), row_order_.end(), compareSourceDescending);
1063 else if (sort_column_ ==
kBipolar) {
1064 if (sort_ascending_)
1065 std::stable_sort(row_order_.begin(), row_order_.end(), compareBipolarAscending);
1067 std::stable_sort(row_order_.begin(), row_order_.end(), compareBipolarDescending);
1069 else if (sort_column_ ==
kStereo) {
1070 if (sort_ascending_)
1071 std::stable_sort(row_order_.begin(), row_order_.end(), compareStereoAscending);
1073 std::stable_sort(row_order_.begin(), row_order_.end(), compareStereoDescending);
1075 else if (sort_column_ ==
kMorph) {
1076 if (sort_ascending_)
1077 std::stable_sort(row_order_.begin(), row_order_.end(), compareMorphAscending);
1079 std::stable_sort(row_order_.begin(), row_order_.end(), compareMorphDescending);
1081 else if (sort_column_ ==
kAmount) {
1082 if (sort_ascending_)
1083 std::stable_sort(row_order_.begin(), row_order_.end(), compareAmountAscending);
1085 std::stable_sort(row_order_.begin(), row_order_.end(), compareAmountDescending);
1088 if (sort_ascending_)
1089 std::stable_sort(row_order_.begin(), row_order_.end(), compareDestinationAscending);
1091 std::stable_sort(row_order_.begin(), row_order_.end(), compareDestinationDescending);
1094 std::stable_sort(row_order_.begin(), row_order_.end(), compareConnected);
1103 background_.
init(open_gl);
1109 ScopedLock open_gl_lock(open_gl_critical_section_);
1114 float width_ratio = image_width / (mult * viewport_.getWidth());
1115 float height_ratio = image_height / (mult * viewport_.getHeight());
1117 float y_offset = (2.0f * viewport_.getViewPositionY()) / viewport_.getHeight();
1119 background_.
setTopLeft(-1.0f, 1.0f + y_offset);
1120 background_.
setTopRight(-1.0 + 2.0f * width_ratio, 1.0f + y_offset);
1121 background_.
setBottomLeft(-1.0f, 1.0f - 2.0f * height_ratio + y_offset);
1122 background_.
setBottomRight(-1.0 + 2.0f * width_ratio, 1.0f - 2.0f * height_ratio + y_offset);
1124 background_.
setColor(Colours::white);
1126 readouts_->setScrollOffset(viewport_.getViewPositionY());
1127 map_editors_[selected_index_]->setAnimate(rows_[selected_index_]->
isActive());
1139 if (lfo_file.exists())
1148 if (lfo_file.exists())
1155 static constexpr int kBrowserWidth = 500;
1156 static constexpr int kBrowserHeight = 250;
1159 int browser_height = kBrowserHeight *
size_ratio_;
1160 Rectangle<int> bounds(preset_selector_->getRight(), preset_selector_->getY(), browser_width, browser_height);
1161 bounds = getLocalArea(
this, bounds);
1167 if (paint_->getToggleState())
1168 paint_pattern_->mouseWheelMove(e, wheel);
1170 grid_size_x_->mouseWheelMove(e, wheel);
1174 paint_->setToggleState(enabled != temporary_switch, dontSendNotification);
1175 paint_pattern_->setActive(enabled != temporary_switch);
1180 if (!import_box.browseForFileToOpen())
1183 File choice = import_box.getResult();
1189 if (!export_box.browseForFileToSave(
true))
1192 File choice = export_box.getResult();
1194 if (!choice.exists())
1196 choice.replaceWithText(map_editors_[selected_index_]->getModel()->stateToJson().dump());
1198 String name = choice.getFileNameWithoutExtension();
1199 map_editors_[selected_index_]->getModel()->setName(name.toStdString());
1200 preset_selector_->setText(name);
1204 smooth_->setToggleState(map_editors_[selected_index_]->getModel()->smooth(), dontSendNotification);
1205 preset_selector_->setText(map_editors_[selected_index_]->getModel()->getName());
1212 current_file_ = file;
1213 LineMapEditor* current_editor = map_editors_[selected_index_].get();
1216 json parsed_file = json::parse(file.loadFileAsString().toStdString(),
nullptr,
false);
1219 catch (
const json::exception& e) {
1223 String name = file.getFileNameWithoutExtension();
1226 preset_selector_->setText(name);
1229 smooth_->setToggleState(current_editor->
getModel()->
smooth(), dontSendNotification);
1233 ScopedLock open_gl_lock(open_gl_critical_section_);
1234 viewport_.setViewPosition(Point<int>(0, range_start));
1238 scroll_bar_->setRangeLimits(0.0, container_.getHeight());
1239 scroll_bar_->setCurrentRange(scroll_bar_->getCurrentRangeStart(), viewport_.getHeight(), dontSendNotification);
A renderer for drawing a series of bars using OpenGL.
Definition bar_renderer.h:18
void setColor(const Colour &color)
Sets the color of the bars.
Definition bar_renderer.h:76
void positionBar(int index, float x, float y, float width, float height)
Positions a bar at a specific rectangle.
Definition bar_renderer.h:179
void setBarWidth(float bar_width)
Sets the relative width of each bar.
Definition bar_renderer.h:94
virtual void render(OpenGlWrapper &open_gl, bool animate) override
Renders the bars using the current OpenGL context.
Definition bar_renderer.cpp:149
static CurveLookAndFeel * instance()
Gets the singleton instance of CurveLookAndFeel.
Definition curve_look_and_feel.h:52
Font & proportional_regular()
Returns a reference to the proportional regular font.
Definition fonts.h:22
Font & proportional_light()
Returns a reference to the proportional light font.
Definition fonts.h:28
static Fonts * instance()
Gets the singleton instance of the Fonts class.
Definition fonts.h:52
static std::vector< std::pair< float, float > > getPaintPattern(int pattern)
Retrieves a paint pattern as a vector of (x, y) pairs.
Definition lfo_section.h:54
@ kNumPaintPatterns
The number of available paint patterns.
Definition lfo_section.h:45
static constexpr int kMaxGridSizeY
Definition line_editor.h:51
LineGenerator * getModel()
Gets the current LineGenerator model.
Definition line_editor.h:357
force_inline void resetPositions()
Marks positions as needing recalculation on next render.
Definition line_editor.h:399
static constexpr int kMaxGridSizeX
Maximum grid sizes for horizontal and vertical lines.
Definition line_editor.h:50
A class for generating and storing a line shape, defined by a series of points and associated powers.
Definition line_generator.h:20
void setLastBrowsedFile(const std::string &path)
Stores the last browsed file path associated with this line.
Definition line_generator.h:86
void setName(const std::string &name)
Sets a name identifier for the line.
Definition line_generator.h:79
force_inline bool smooth() const
Indicates whether smoothing is enabled.
Definition line_generator.h:280
void jsonToState(json data)
Restores the line state from a given JSON object.
Definition line_generator.cpp:125
A specialized LineEditor that visualizes and optionally animates a line-to-value mapping.
Definition line_map_editor.h:20
static std::vector< File > getLfoDirectories()
Gets directories that should contain LFO shapes.
Definition load_save.cpp:1780
static File getShiftedFile(const String directory_name, const String &extensions, const std::string &additional_folders_name, const File ¤t_file, int shift)
Given a directory name and extensions, returns a file shifted by some offset from the current file.
Definition load_save.cpp:1921
static const std::string kLfoFolderName
Definition load_save.h:78
static File getUserLfoDirectory()
Retrieves the user's LFO directory.
Definition load_save.cpp:1819
SortColumn
Columns available for sorting the modulation matrix rows.
Definition modulation_matrix.h:387
@ kAmount
Definition modulation_matrix.h:393
@ kDestination
Definition modulation_matrix.h:394
@ kNumber
Definition modulation_matrix.h:388
@ kSource
Definition modulation_matrix.h:389
@ kBipolar
Definition modulation_matrix.h:390
@ kMorph
Definition modulation_matrix.h:392
@ kStereo
Definition modulation_matrix.h:391
@ kNumColumns
Definition modulation_matrix.h:395
void resized() override
Handles resizing of the component.
Definition modulation_matrix.cpp:848
void setVisible(bool should_be_visible) override
Sets visibility of this component, and updates modulations if visible.
Definition modulation_matrix.h:454
void setAllValues(vital::control_map &controls) override
Sets all parameter values from a control map.
Definition modulation_matrix.cpp:934
void initOpenGlComponents(OpenGlWrapper &open_gl) override
Initializes OpenGL components.
Definition modulation_matrix.cpp:1102
void importLfo() override
Imports an LFO file to the current line editor.
Definition modulation_matrix.cpp:1178
void nextClicked() override
Called when 'next' is clicked on the preset selector.
Definition modulation_matrix.cpp:1145
static constexpr int kDefaultGridSizeX
Definition modulation_matrix.h:366
void setScrollBarRange()
Sets the range of the scroll bar based on the current rows.
Definition modulation_matrix.cpp:1237
void prevClicked() override
Called when 'previous' is clicked on the preset selector.
Definition modulation_matrix.cpp:1136
void lineEditorScrolled(const MouseEvent &e, const MouseWheelDetails &wheel) override
Handles line editor scrolling for pattern or grid adjustments.
Definition modulation_matrix.cpp:1166
static constexpr int kRowPadding
Definition modulation_matrix.h:364
void paintBackground(Graphics &g) override
Paints the background of the modulation matrix.
Definition modulation_matrix.cpp:693
void mouseDown(const MouseEvent &e) override
Handles mouse down events for sorting column selection.
Definition modulation_matrix.cpp:1007
void loadFile(const File &file) override
Loads a specific file (LFO configuration).
Definition modulation_matrix.cpp:1208
void paintBackgroundShadow(Graphics &g) override
Paints background shadows for the matrix sections.
Definition modulation_matrix.cpp:791
void renderOpenGlComponents(OpenGlWrapper &open_gl, bool animate) override
Renders OpenGL components, including animated elements.
Definition modulation_matrix.cpp:1107
void togglePaintMode(bool enabled, bool temporary_switch) override
Toggles paint mode for the line editors.
Definition modulation_matrix.cpp:1173
static String getMenuSourceDisplayName(const String &original)
Returns a user-friendly display name for a given source string in menu context.
Definition modulation_matrix.cpp:513
virtual ~ModulationMatrix()
Destructor.
Definition modulation_matrix.cpp:664
void setMeterBounds()
Sets the meter bounds for each modulation row.
Definition modulation_matrix.cpp:897
void sliderValueChanged(Slider *changed_slider) override
Handles slider value changes.
Definition modulation_matrix.cpp:903
void setRowPositions()
Positions rows within the viewport.
Definition modulation_matrix.cpp:826
void exportLfo() override
Exports the current LFO to a file.
Definition modulation_matrix.cpp:1187
File getCurrentFile() override
Gets the currently loaded file.
Definition modulation_matrix.h:567
static String getUiSourceDisplayName(const String &original)
Returns a display name suitable for the UI given a source string.
Definition modulation_matrix.cpp:529
void scrollBarMoved(ScrollBar *scroll_bar, double range_start) override
Called when the scroll bar moves.
Definition modulation_matrix.cpp:1232
void paintScrollableBackground()
Paints the portion of the matrix that scrolls, i.e., the rows.
Definition modulation_matrix.cpp:666
void textMouseDown(const MouseEvent &e) override
Handles mouse down events on text components (for loading browser).
Definition modulation_matrix.cpp:1154
void buttonClicked(Button *button) override
Handles button clicks.
Definition modulation_matrix.cpp:920
void destroyOpenGlComponents(OpenGlWrapper &open_gl) override
Destroys OpenGL components.
Definition modulation_matrix.cpp:1131
ModulationMatrix(const vital::output_map &sources, const vital::output_map &destinations)
Constructs a ModulationMatrix.
Definition modulation_matrix.cpp:533
static constexpr int kDefaultGridSizeY
Definition modulation_matrix.h:367
void updateModulations()
Updates the displayed modulations when changes occur.
Definition modulation_matrix.cpp:940
void updateModulationValue(int index)
Updates the modulation value for a given index.
Definition modulation_matrix.cpp:957
void checkNumModulationsShown()
Ensures the correct number of modulation rows is displayed based on connectivity.
Definition modulation_matrix.cpp:962
void parentHierarchyChanged() override
Called when this component's parent hierarchy changes, used to initialize rows and connections.
Definition modulation_matrix.cpp:800
void fileLoaded() override
Called when a file is loaded.
Definition modulation_matrix.cpp:1203
void rowSelected(ModulationMatrixRow *selected_row) override
Called when a modulation row is selected (from ModulationMatrixRow::Listener).
Definition modulation_matrix.cpp:982
Interface for objects that need to respond to row selection changes.
Definition modulation_matrix.h:166
Represents a single row in the modulation matrix, showing source, destination, and associated paramet...
Definition modulation_matrix.h:160
ModulationMatrixRow(int index, PopupItems *source_items, PopupItems *destination_items, const std::vector< String > *sources, const std::vector< String > *destinations)
Constructs a ModulationMatrixRow.
Definition modulation_matrix.cpp:305
std::unique_ptr< SynthSlider > amount_slider_
The slider for modulation amount.
Definition modulation_matrix.h:344
std::unique_ptr< SynthSlider > power_slider_
The slider for the morph/power parameter.
Definition modulation_matrix.h:345
double last_destination_value_
The last known destination value.
Definition modulation_matrix.h:342
void sliderValueChanged(Slider *changed_slider) override
Callback when a slider's value changes.
Definition modulation_matrix.cpp:472
force_inline float morph() const
Gets the morph value of this modulation.
Definition modulation_matrix.h:324
force_inline int stereo() const
Gets whether this row is set to stereo modulation.
Definition modulation_matrix.h:312
int index_
The index of this row.
Definition modulation_matrix.h:335
std::unique_ptr< ModulationSelector > source_
The source selector.
Definition modulation_matrix.h:339
void resized() override
Handles component resizing.
Definition modulation_matrix.cpp:365
bool connected() const
Checks if this row represents a connected modulation.
Definition modulation_matrix.cpp:462
double last_source_value_
The last known source value.
Definition modulation_matrix.h:341
bool matchesSourceAndDestination(const std::string &source, const std::string &destination) const
Checks if this row matches the given source and destination names.
Definition modulation_matrix.cpp:466
force_inline int bipolar() const
Gets whether this row is set to bipolar modulation.
Definition modulation_matrix.h:318
force_inline int index() const
Gets the row index.
Definition modulation_matrix.h:294
Rectangle< int > getMeterBounds()
Gets the bounds where a modulation meter may be drawn.
Definition modulation_matrix.cpp:499
std::vector< Listener * > listeners_
Registered row listeners.
Definition modulation_matrix.h:333
void select()
Selects this row and notifies listeners.
Definition modulation_matrix.h:261
bool selected_
Whether this row is currently selected.
Definition modulation_matrix.h:352
OverlayBackgroundRenderer highlight_
Renders a highlight overlay when selected.
Definition modulation_matrix.h:349
std::unique_ptr< SynthButton > stereo_
The stereo toggle button.
Definition modulation_matrix.h:347
force_inline int source() const
Gets the selected source index.
Definition modulation_matrix.h:300
SynthGuiInterface * parent_
The parent GUI interface.
Definition modulation_matrix.h:337
force_inline float amount() const
Gets the modulation amount value.
Definition modulation_matrix.h:330
void updateDisplayValue()
Updates only the display values (like amount) without changing source/destination selection.
Definition modulation_matrix.cpp:438
std::unique_ptr< OpenGlShapeButton > bipolar_
The bipolar toggle button.
Definition modulation_matrix.h:346
force_inline int destination() const
Gets the selected destination index.
Definition modulation_matrix.h:306
void buttonClicked(Button *button) override
Callback when a button is clicked.
Definition modulation_matrix.cpp:417
vital::ModulationConnection * connection_
The modulation connection for this row.
Definition modulation_matrix.h:336
void updateDisplay()
Updates the display of the row based on the current connection state.
Definition modulation_matrix.cpp:426
double last_amount_value_
The last known amount value.
Definition modulation_matrix.h:343
void paintBackground(Graphics &g) override
Paints the background of this row.
Definition modulation_matrix.cpp:404
bool updating_
Indicates if the row is currently updating to avoid recursive changes.
Definition modulation_matrix.h:351
std::unique_ptr< ModulationSelector > destination_
The destination selector.
Definition modulation_matrix.h:340
std::unique_ptr< SynthButton > bypass_
The bypass button for this modulation row.
Definition modulation_matrix.h:348
Definition modulation_matrix.cpp:184
void paintBackground(Graphics &g) override
Paints a standard background for the component.
Definition modulation_matrix.cpp:246
void setMeterActive(int i, bool active)
Definition modulation_matrix.cpp:252
void render(OpenGlWrapper &open_gl, bool animate) override
Renders the bars using the current OpenGL context.
Definition modulation_matrix.cpp:234
void setScrollOffset(int offset)
Definition modulation_matrix.cpp:256
void parentHierarchyChanged() override
Called when the component's parent hierarchy changes.
Definition modulation_matrix.cpp:197
void loadAmountOutputs()
Definition modulation_matrix.cpp:189
ModulationMeterReadouts()
Definition modulation_matrix.cpp:186
void setMeterBounds(int i, Rectangle< int > bounds)
Definition modulation_matrix.cpp:248
void updatePositions(int index)
Definition modulation_matrix.cpp:207
void mouseDown(const juce::MouseEvent &e) override
Handles mouse down events, showing the popup selection menu.
Definition modulation_matrix.cpp:292
String getTextFromValue(double value) override
Converts a numeric value to a display text representing the currently selected modulation.
Definition modulation_matrix.cpp:268
void setValueFromName(const String &name, NotificationType notification_type)
Sets the current value based on a given name.
Definition modulation_matrix.cpp:274
void addListener(Listener *listener)
Adds a listener to be notified of scrolling changes.
Definition modulation_matrix.h:139
static bool setViewPort(Component *component, Rectangle< int > bounds, OpenGlWrapper &open_gl)
Sets the OpenGL viewport to match a specified rectangle within a component.
Definition open_gl_component.cpp:42
void setOwnImage(Image &image)
Sets the image from an owned copy.
Definition open_gl_image.h:69
void init(OpenGlWrapper &open_gl)
Initializes the OpenGL buffers and shader attributes needed for rendering the image.
Definition open_gl_image.cpp:33
void setBottomLeft(float x, float y)
Sets the bottom-left corner position of the image quad.
Definition open_gl_image.h:116
int getImageWidth()
Gets the width of the currently set image.
Definition open_gl_image.h:132
void drawImage(OpenGlWrapper &open_gl)
Draws the image to the current OpenGL context.
Definition open_gl_image.cpp:59
int getImageHeight()
Gets the height of the currently set image.
Definition open_gl_image.h:138
void setBottomRight(float x, float y)
Sets the bottom-right corner position of the image quad.
Definition open_gl_image.h:121
void setTopLeft(float x, float y)
Sets the top-left corner position of the image quad.
Definition open_gl_image.h:111
void destroy(OpenGlWrapper &open_gl)
Releases any OpenGL resources allocated by this object.
Definition open_gl_image.cpp:128
void setTopRight(float x, float y)
Sets the top-right corner position of the image quad.
Definition open_gl_image.h:126
void setColor(Colour color)
Sets the color tint applied to the image.
Definition open_gl_image.h:92
void redoImage(bool skip_image=false)
Definition synth_slider.cpp:64
SynthSection * parent_
The parent SynthSection.
Definition synth_slider.h:289
void setColor(const Colour &color)
Sets the overlay color.
Definition overlay.h:109
static Path halfSinCurve()
Definition paths.h:751
static Path bipolar()
Definition paths.h:668
static Path paintBrush()
Definition paths.h:804
@ kTitle
Definition open_gl_image_component.h:308
@ kWidgetMargin
Definition skin.h:103
@ kBodyRounding
Definition skin.h:71
@ kTextComponentOffset
Definition skin.h:85
@ kWidgetRoundedCorner
Definition skin.h:104
@ kModulationMeterRight
Definition skin.h:177
@ kModulationMeterLeft
Definition skin.h:176
@ kBackground
Definition skin.h:128
@ kBodyText
Definition skin.h:133
@ kLightenScreen
Definition skin.h:141
@ kPopupSelectorBackground
Definition skin.h:143
@ kTextComponentBackground
Definition skin.h:147
@ kHeadingText
Definition skin.h:131
@ kTextComponentText
Definition skin.h:148
@ kBody
Definition skin.h:129
@ kModulationMatrix
Definition skin.h:56
vital::ModulationConnectionBank & getModulationBank()
Retrieves the ModulationConnectionBank managing all modulation connections.
Definition synth_base.cpp:730
const vital::StatusOutput * getStatusOutput(const std::string &name)
Retrieves a status output by name.
Definition synth_base.cpp:262
An interface class linking the Vital synthesizer backend (SynthBase) with a GUI.
Definition synth_gui_interface.h:56
SynthBase * getSynth()
Returns the SynthBase instance this interface is managing.
Definition synth_gui_interface.h:85
void disconnectModulation(std::string source, std::string destination)
Disconnects a modulation from the GUI layer.
Definition synth_gui_interface.cpp:146
void connectModulation(std::string source, std::string destination)
Connects a modulation source to a destination parameter through the GUI.
Definition synth_gui_interface.cpp:91
void notifyModulationValueChanged(int index)
Notifies the GUI that a specific modulation's value changed.
Definition synth_gui_interface.cpp:87
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
virtual void buttonClicked(Button *clicked_button) override
Called when a button is clicked. Updates the synth parameter accordingly.
Definition synth_section.cpp:398
virtual void renderOpenGlComponents(OpenGlWrapper &open_gl, bool animate)
Renders all OpenGL components in this section and sub-sections.
Definition synth_section.cpp:357
float getPadding()
Definition synth_section.cpp:660
float getSliderWidth()
Definition synth_section.cpp:637
void addSlider(SynthSlider *slider, bool show=true, bool listen=true)
Definition synth_section.cpp:445
void createOffOverlay()
Definition synth_section.cpp:514
virtual void animate(bool animate)
Triggers animation state change in sub-sections if needed.
Definition synth_section.cpp:822
void addSubSection(SynthSection *section, bool show=true)
Adds a subsection (another SynthSection) as a child.
Definition synth_section.cpp:457
void paintOpenGlChildrenBackgrounds(Graphics &g)
Paints the backgrounds for all OpenGL child components.
Definition synth_section.cpp:267
virtual void resized() override
Called when the component is resized. Arranges layout of child components.
Definition synth_section.cpp:35
virtual void paintBody(Graphics &g, Rectangle< int > bounds)
Paints the body background within given bounds.
Definition synth_section.cpp:165
float getWidgetRounding()
Definition synth_section.cpp:680
void updatePopupBrowser(SynthSection *owner)
Updates the currently visible popup browser if any.
Definition synth_section.cpp:113
void paintKnobShadows(Graphics &g)
Paints knob shadows for all sliders.
Definition synth_section.cpp:253
virtual int getPixelMultiple() const
Definition synth_section.cpp:729
void setLabelFont(Graphics &g)
Sets the Graphics context font and color for labels.
Definition synth_section.cpp:740
virtual void destroyOpenGlComponents(OpenGlWrapper &open_gl)
Destroys all OpenGL components in this section and sub-sections.
Definition synth_section.cpp:383
void showPopupSelector(Component *source, Point< int > position, const PopupItems &options, std::function< void(int)> callback, std::function< void()> cancel={ })
Shows a popup selector with options.
Definition synth_section.cpp:119
float size_ratio_
Definition synth_section.h:821
void addButton(OpenGlToggleButton *button, bool show=true)
Definition synth_section.cpp:428
float findValue(Skin::ValueId value_id) const
Finds a value in the skin overrides or from the parent if not found locally.
Definition synth_section.cpp:18
virtual void paintBorder(Graphics &g, Rectangle< int > bounds)
Paints the border around given bounds.
Definition synth_section.cpp:170
bool isActive() const
Checks if the section is currently active.
Definition synth_section.h:683
void showDualPopupSelector(Component *source, Point< int > position, int width, const PopupItems &options, std::function< void(int)> callback)
Shows a dual popup selector for hierarchical selection.
Definition synth_section.cpp:126
void addOpenGlComponent(OpenGlComponent *open_gl_component, bool to_beginning=false)
Definition synth_section.cpp:489
float getSizeRatio() const
Definition synth_section.h:765
virtual void sliderValueChanged(Slider *moved_slider) override
Called when a slider value changes. Updates the synth parameter accordingly.
Definition synth_section.cpp:391
virtual void setAllValues(vital::control_map &controls)
Sets values for all known parameters from a control map.
Definition synth_section.cpp:827
void setPresetSelector(PresetSelector *preset_selector, bool half=false)
Definition synth_section.h:779
float getTitleWidth()
Definition synth_section.cpp:629
virtual void setScrollWheelEnabled(bool enabled)
Enables or disables scroll wheel support for this section and sub-sections.
Definition synth_section.cpp:481
void setSkinOverride(Skin::SectionOverride skin_override)
Definition synth_section.h:303
virtual void initOpenGlComponents(OpenGlWrapper &open_gl)
Initializes all OpenGL components in this section and sub-sections.
Definition synth_section.cpp:349
virtual void paintTabShadow(Graphics &g)
Paints a tab-like shadow effect around the component.
Definition synth_section.cpp:188
void showPopupBrowser(SynthSection *owner, Rectangle< int > bounds, std::vector< File > directories, String extensions, std::string passthrough_name, std::string additional_folders_name)
Shows a file browser popup (e.g., for loading samples or wavetables).
Definition synth_section.cpp:105
float getWidgetMargin()
Definition synth_section.cpp:676
static TextLookAndFeel * instance()
Singleton instance access.
Definition text_look_and_feel.h:106
A container managing a fixed number of ModulationConnections.
Definition synth_types.h:87
ModulationConnection * atIndex(int index)
Retrieves a ModulationConnection by index.
Definition synth_types.h:114
static const ValueDetails & getDetails(const std::string &name)
Definition synth_parameters.h:200
A helper class to track the "status" of a particular Output as a poly_float value.
Definition synth_module.h:35
static constexpr float kClearValue
Special "clear" value indicating no status.
Definition synth_module.h:37
force_inline poly_float value() const
Returns the current status value.
Definition synth_module.h:49
nlohmann::json json
Definition line_generator.h:7
const std::string kPaintPatternNames[]
Names for painting patterns in wavetable or LFO editing.
Definition synth_strings.h:327
force_inline poly_float clamp(poly_float value, mono_float min, mono_float max)
Clamps each lane of a vector to [min, max].
Definition poly_utils.h:306
force_inline int nextPowerOfTwo(mono_float value)
Finds the next power of two greater than or equal to a float value.
Definition utils.h:370
force_inline poly_float interpolate(poly_float from, poly_float to, mono_float t)
Performs a linear interpolation between two poly_floats using a scalar t in [0..1].
Definition poly_utils.h:182
Contains classes and functions used within the Vital synthesizer framework.
std::map< std::string, Output * > output_map
Maps parameter names to Output pointers, representing output signals from various modules.
Definition synth_types.h:229
std::map< std::string, Value * > control_map
Maps parameter names to Value pointers representing synth control parameters.
Definition synth_types.h:214
constexpr int kMaxModulationConnections
Maximum number of modulation connections allowed.
Definition synth_constants.h:49
const std::string kLfoExtension
File extension for Vital LFO shape files.
Definition synth_constants.h:100
Definition modulation_matrix.cpp:160
bool operator()(const String &first, const String &second) const
Definition modulation_matrix.cpp:161
A helper struct containing references to OpenGL context, shaders, and display scale.
Definition shaders.h:174
A structure representing a single modulation connection between a modulation source and a destination...
Definition synth_types.h:30
std::unique_ptr< ModulationConnectionProcessor > modulation_processor
Processor applying scaling/mapping.
Definition synth_types.h:75
std::string destination_name
The name of the destination parameter.
Definition synth_types.h:74
std::string source_name
The name of the modulation source.
Definition synth_types.h:73
Holds metadata about a single parameter (control) in the Vital synthesizer.
Definition synth_parameters.h:23
mono_float max
Maximum parameter value.
Definition synth_parameters.h:41
@ kLinear
Parameter scales linearly between min and max.
Definition synth_parameters.h:30
@ kIndexed
Parameter steps through discrete indexed values.
Definition synth_parameters.h:29
mono_float min
Minimum parameter value.
Definition synth_parameters.h:40
std::string display_name
Human-readable name for display in UI.
Definition synth_parameters.h:48
std::string local_description
Local description or additional metadata.
Definition synth_parameters.h:50
ValueScale value_scale
The scaling mode of the parameter value.
Definition synth_parameters.h:45
Defines the SynthModule class which extends ProcessorRouter to form a building block of the Vital syn...
Declares the SynthSlider and related classes, providing various slider styles and functionality in th...
Declares the TextSelector class and PaintPatternSelector class for selecting text-based options and d...