From 94bff3c1a3e386d048448c656983a66669b30c0f Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 26 Oct 2021 14:51:36 -0400 Subject: [PATCH] Implement new panel design in CV-MIDI, MIDI-CC, and MIDI-Gate. --- src/core/CV_MIDI.cpp | 30 +++++++++++++++--------------- src/core/MIDI_CC.cpp | 38 +++++++++++++++++++------------------- src/core/MIDI_Gate.cpp | 36 ++++++++++++++++++------------------ 3 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/core/CV_MIDI.cpp b/src/core/CV_MIDI.cpp index 99385e1f..74ba44a6 100644 --- a/src/core/CV_MIDI.cpp +++ b/src/core/CV_MIDI.cpp @@ -156,21 +156,21 @@ struct CV_MIDIWidget : ModuleWidget { addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addInput(createInputCentered(mm2px(Vec(9, 64)), module, CV_MIDI::PITCH_INPUT)); - addInput(createInputCentered(mm2px(Vec(20, 64)), module, CV_MIDI::GATE_INPUT)); - addInput(createInputCentered(mm2px(Vec(32, 64)), module, CV_MIDI::VEL_INPUT)); - addInput(createInputCentered(mm2px(Vec(9, 80)), module, CV_MIDI::AFT_INPUT)); - addInput(createInputCentered(mm2px(Vec(20, 80)), module, CV_MIDI::PW_INPUT)); - addInput(createInputCentered(mm2px(Vec(32, 80)), module, CV_MIDI::MW_INPUT)); - addInput(createInputCentered(mm2px(Vec(9, 96)), module, CV_MIDI::CLK_INPUT)); - addInput(createInputCentered(mm2px(Vec(20, 96)), module, CV_MIDI::VOL_INPUT)); - addInput(createInputCentered(mm2px(Vec(32, 96)), module, CV_MIDI::PAN_INPUT)); - addInput(createInputCentered(mm2px(Vec(9, 112)), module, CV_MIDI::START_INPUT)); - addInput(createInputCentered(mm2px(Vec(20, 112)), module, CV_MIDI::STOP_INPUT)); - addInput(createInputCentered(mm2px(Vec(32, 112)), module, CV_MIDI::CONTINUE_INPUT)); - - MidiWidget* midiWidget = createWidget(mm2px(Vec(3.41891, 14.8373))); - midiWidget->box.size = mm2px(Vec(33.840, 28)); + addInput(createInputCentered(mm2px(Vec(7.906, 64.347)), module, CV_MIDI::PITCH_INPUT)); + addInput(createInputCentered(mm2px(Vec(20.249, 64.347)), module, CV_MIDI::GATE_INPUT)); + addInput(createInputCentered(mm2px(Vec(32.591, 64.347)), module, CV_MIDI::VEL_INPUT)); + addInput(createInputCentered(mm2px(Vec(7.906, 80.603)), module, CV_MIDI::AFT_INPUT)); + addInput(createInputCentered(mm2px(Vec(20.249, 80.603)), module, CV_MIDI::PW_INPUT)); + addInput(createInputCentered(mm2px(Vec(32.591, 80.603)), module, CV_MIDI::MW_INPUT)); + addInput(createInputCentered(mm2px(Vec(7.906, 96.859)), module, CV_MIDI::CLK_INPUT)); + addInput(createInputCentered(mm2px(Vec(20.249, 96.707)), module, CV_MIDI::VOL_INPUT)); + addInput(createInputCentered(mm2px(Vec(32.591, 96.859)), module, CV_MIDI::PAN_INPUT)); + addInput(createInputCentered(mm2px(Vec(7.906, 113.115)), module, CV_MIDI::START_INPUT)); + addInput(createInputCentered(mm2px(Vec(32.591, 112.975)), module, CV_MIDI::CONTINUE_INPUT)); + addInput(createInputCentered(mm2px(Vec(20.249, 113.115)), module, CV_MIDI::STOP_INPUT)); + + MidiWidget* midiWidget = createWidget(mm2px(Vec(0.0, 13.039))); + midiWidget->box.size = mm2px(Vec(40.64, 29.021)); midiWidget->setMidiPort(module ? &module->midiOutput : NULL); addChild(midiWidget); } diff --git a/src/core/MIDI_CC.cpp b/src/core/MIDI_CC.cpp index 46fc2996..0dca1802 100644 --- a/src/core/MIDI_CC.cpp +++ b/src/core/MIDI_CC.cpp @@ -214,33 +214,33 @@ struct MIDI_CC : Module { struct MIDI_CCWidget : ModuleWidget { MIDI_CCWidget(MIDI_CC* module) { setModule(module); - setPanel(Svg::load(asset::system("res/Core/MIDI-CC.svg"))); + setPanel(Svg::load(asset::system("res/Core/MIDI CC-CV.svg"))); addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addOutput(createOutput(mm2px(Vec(3.894335, 73.344704)), module, MIDI_CC::CC_OUTPUT + 0)); - addOutput(createOutput(mm2px(Vec(15.494659, 73.344704)), module, MIDI_CC::CC_OUTPUT + 1)); - addOutput(createOutput(mm2px(Vec(27.094982, 73.344704)), module, MIDI_CC::CC_OUTPUT + 2)); - addOutput(createOutput(mm2px(Vec(38.693932, 73.344704)), module, MIDI_CC::CC_OUTPUT + 3)); - addOutput(createOutput(mm2px(Vec(3.8943355, 84.945023)), module, MIDI_CC::CC_OUTPUT + 4)); - addOutput(createOutput(mm2px(Vec(15.49466, 84.945023)), module, MIDI_CC::CC_OUTPUT + 5)); - addOutput(createOutput(mm2px(Vec(27.094982, 84.945023)), module, MIDI_CC::CC_OUTPUT + 6)); - addOutput(createOutput(mm2px(Vec(38.693932, 84.945023)), module, MIDI_CC::CC_OUTPUT + 7)); - addOutput(createOutput(mm2px(Vec(3.8943343, 96.543976)), module, MIDI_CC::CC_OUTPUT + 8)); - addOutput(createOutput(mm2px(Vec(15.494659, 96.543976)), module, MIDI_CC::CC_OUTPUT + 9)); - addOutput(createOutput(mm2px(Vec(27.09498, 96.543976)), module, MIDI_CC::CC_OUTPUT + 10)); - addOutput(createOutput(mm2px(Vec(38.693932, 96.543976)), module, MIDI_CC::CC_OUTPUT + 11)); - addOutput(createOutput(mm2px(Vec(3.894335, 108.14429)), module, MIDI_CC::CC_OUTPUT + 12)); - addOutput(createOutput(mm2px(Vec(15.49466, 108.14429)), module, MIDI_CC::CC_OUTPUT + 13)); - addOutput(createOutput(mm2px(Vec(27.09498, 108.14429)), module, MIDI_CC::CC_OUTPUT + 14)); - addOutput(createOutput(mm2px(Vec(38.693932, 108.14429)), module, MIDI_CC::CC_OUTPUT + 15)); + addOutput(createOutputCentered(mm2px(Vec(8.189, 78.431)), module, MIDI_CC::CC_OUTPUT + 0)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 78.431)), module, MIDI_CC::CC_OUTPUT + 1)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 78.431)), module, MIDI_CC::CC_OUTPUT + 2)); + addOutput(createOutputCentered(mm2px(Vec(42.838, 78.431)), module, MIDI_CC::CC_OUTPUT + 3)); + addOutput(createOutputCentered(mm2px(Vec(8.189, 89.946)), module, MIDI_CC::CC_OUTPUT + 4)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 89.946)), module, MIDI_CC::CC_OUTPUT + 5)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 89.946)), module, MIDI_CC::CC_OUTPUT + 6)); + addOutput(createOutputCentered(mm2px(Vec(42.838, 89.946)), module, MIDI_CC::CC_OUTPUT + 7)); + addOutput(createOutputCentered(mm2px(Vec(8.189, 101.466)), module, MIDI_CC::CC_OUTPUT + 8)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 101.466)), module, MIDI_CC::CC_OUTPUT + 9)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 101.466)), module, MIDI_CC::CC_OUTPUT + 10)); + addOutput(createOutputCentered(mm2px(Vec(42.838, 101.466)), module, MIDI_CC::CC_OUTPUT + 11)); + addOutput(createOutputCentered(mm2px(Vec(8.19, 112.998)), module, MIDI_CC::CC_OUTPUT + 12)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 112.984)), module, MIDI_CC::CC_OUTPUT + 13)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 112.984)), module, MIDI_CC::CC_OUTPUT + 14)); + addOutput(createOutputCentered(mm2px(Vec(42.839, 112.984)), module, MIDI_CC::CC_OUTPUT + 15)); typedef Grid16MidiWidget> TMidiWidget; - TMidiWidget* midiWidget = createWidget(mm2px(Vec(3.399621, 14.837339))); - midiWidget->box.size = mm2px(Vec(44, 54.667)); + TMidiWidget* midiWidget = createWidget(mm2px(Vec(0.0, 13.039))); + midiWidget->box.size = mm2px(Vec(50.8, 55.88)); midiWidget->setMidiPort(module ? &module->midiInput : NULL); midiWidget->setModule(module); addChild(midiWidget); diff --git a/src/core/MIDI_Gate.cpp b/src/core/MIDI_Gate.cpp index 08aae44a..46561823 100644 --- a/src/core/MIDI_Gate.cpp +++ b/src/core/MIDI_Gate.cpp @@ -189,26 +189,26 @@ struct MIDI_GateWidget : ModuleWidget { addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addOutput(createOutput(mm2px(Vec(3.894335, 73.344704)), module, MIDI_Gate::GATE_OUTPUTS + 0)); - addOutput(createOutput(mm2px(Vec(15.494659, 73.344704)), module, MIDI_Gate::GATE_OUTPUTS + 1)); - addOutput(createOutput(mm2px(Vec(27.094982, 73.344704)), module, MIDI_Gate::GATE_OUTPUTS + 2)); - addOutput(createOutput(mm2px(Vec(38.693932, 73.344704)), module, MIDI_Gate::GATE_OUTPUTS + 3)); - addOutput(createOutput(mm2px(Vec(3.8943355, 84.945023)), module, MIDI_Gate::GATE_OUTPUTS + 4)); - addOutput(createOutput(mm2px(Vec(15.49466, 84.945023)), module, MIDI_Gate::GATE_OUTPUTS + 5)); - addOutput(createOutput(mm2px(Vec(27.094982, 84.945023)), module, MIDI_Gate::GATE_OUTPUTS + 6)); - addOutput(createOutput(mm2px(Vec(38.693932, 84.945023)), module, MIDI_Gate::GATE_OUTPUTS + 7)); - addOutput(createOutput(mm2px(Vec(3.8943343, 96.543976)), module, MIDI_Gate::GATE_OUTPUTS + 8)); - addOutput(createOutput(mm2px(Vec(15.494659, 96.543976)), module, MIDI_Gate::GATE_OUTPUTS + 9)); - addOutput(createOutput(mm2px(Vec(27.09498, 96.543976)), module, MIDI_Gate::GATE_OUTPUTS + 10)); - addOutput(createOutput(mm2px(Vec(38.693932, 96.543976)), module, MIDI_Gate::GATE_OUTPUTS + 11)); - addOutput(createOutput(mm2px(Vec(3.894335, 108.14429)), module, MIDI_Gate::GATE_OUTPUTS + 12)); - addOutput(createOutput(mm2px(Vec(15.49466, 108.14429)), module, MIDI_Gate::GATE_OUTPUTS + 13)); - addOutput(createOutput(mm2px(Vec(27.09498, 108.14429)), module, MIDI_Gate::GATE_OUTPUTS + 14)); - addOutput(createOutput(mm2px(Vec(38.693932, 108.14429)), module, MIDI_Gate::GATE_OUTPUTS + 15)); + addOutput(createOutputCentered(mm2px(Vec(8.189, 78.431)), module, MIDI_Gate::GATE_OUTPUTS + 0)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 78.431)), module, MIDI_Gate::GATE_OUTPUTS + 1)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 78.431)), module, MIDI_Gate::GATE_OUTPUTS + 2)); + addOutput(createOutputCentered(mm2px(Vec(42.838, 78.431)), module, MIDI_Gate::GATE_OUTPUTS + 3)); + addOutput(createOutputCentered(mm2px(Vec(8.189, 89.946)), module, MIDI_Gate::GATE_OUTPUTS + 4)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 89.946)), module, MIDI_Gate::GATE_OUTPUTS + 5)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 89.946)), module, MIDI_Gate::GATE_OUTPUTS + 6)); + addOutput(createOutputCentered(mm2px(Vec(42.838, 89.946)), module, MIDI_Gate::GATE_OUTPUTS + 7)); + addOutput(createOutputCentered(mm2px(Vec(8.189, 101.466)), module, MIDI_Gate::GATE_OUTPUTS + 8)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 101.466)), module, MIDI_Gate::GATE_OUTPUTS + 9)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 101.466)), module, MIDI_Gate::GATE_OUTPUTS + 10)); + addOutput(createOutputCentered(mm2px(Vec(42.838, 101.466)), module, MIDI_Gate::GATE_OUTPUTS + 11)); + addOutput(createOutputCentered(mm2px(Vec(8.189, 112.998)), module, MIDI_Gate::GATE_OUTPUTS + 12)); + addOutput(createOutputCentered(mm2px(Vec(19.739, 112.984)), module, MIDI_Gate::GATE_OUTPUTS + 13)); + addOutput(createOutputCentered(mm2px(Vec(31.289, 112.984)), module, MIDI_Gate::GATE_OUTPUTS + 14)); + addOutput(createOutputCentered(mm2px(Vec(42.838, 112.984)), module, MIDI_Gate::GATE_OUTPUTS + 15)); typedef Grid16MidiWidget> TMidiWidget; - TMidiWidget* midiWidget = createWidget(mm2px(Vec(3.399621, 14.837339))); - midiWidget->box.size = mm2px(Vec(44, 54.667)); + TMidiWidget* midiWidget = createWidget(mm2px(Vec(0.0, 13.039))); + midiWidget->box.size = mm2px(Vec(50.8, 55.88)); midiWidget->setMidiPort(module ? &module->midiInput : NULL); midiWidget->setModule(module); addChild(midiWidget);