computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit 5ff69894cbe8d5d43987613b5a2dd4b7c03fe372
parent 6644509c5977dd6c7788a2fd3ed30dcef713c8c3
Author: Adam M <aemalone@gmail.com>
Date:   Sun, 27 Dec 2020 21:00:14 -0600

horse outputs triggers somewhat sensibly for all modes

Diffstat:
Mres/ComputerscareGolyPeneratorPanel.svg | 10+++++-----
Msrc/ComputerscareHorseADoodleDoo.cpp | 59++++++++++++++---------------------------------------------
2 files changed, 19 insertions(+), 50 deletions(-)

diff --git a/res/ComputerscareGolyPeneratorPanel.svg b/res/ComputerscareGolyPeneratorPanel.svg @@ -25,10 +25,10 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="5.6568545" - inkscape:cx="72.70835" - inkscape:cy="327.29794" + inkscape:cx="54.500351" + inkscape:cy="304.49375" inkscape:document-units="mm" - inkscape:current-layer="text924" + inkscape:current-layer="g1669" showgrid="false" units="px" inkscape:snap-bbox="true" @@ -381,8 +381,8 @@ id="text1023" style="font-style:normal;font-weight:normal;font-size:2.98674px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.074669"> <path - d="m 10.367148,217.19757 q 0,0.2507 0.21228,0.41128 0.210608,0.16058 0.576666,0.16058 0.207266,0 0.381102,-0.0475 0.172163,-0.0492 0.289168,-0.10651 v -0.34573 h -0.01671 q -0.148763,0.10977 -0.330956,0.17532 -0.182192,0.0639 -0.349342,0.0639 -0.207265,0 -0.32427,-0.0655 -0.117005,-0.0655 -0.117005,-0.20646 0,-0.10808 0.06352,-0.16386 0.06352,-0.0557 0.244038,-0.095 0.06685,-0.0147 0.175508,-0.0344 0.10698,-0.0197 0.195565,-0.0426 0.245711,-0.0639 0.349342,-0.18679 0.101965,-0.12454 0.101965,-0.30478 0,-0.11305 -0.0468,-0.213 -0.04846,-0.1 -0.14542,-0.17862 -0.09361,-0.077 -0.237353,-0.12125 -0.145419,-0.0458 -0.324271,-0.0458 -0.167148,0 -0.337641,0.041 -0.172164,0.0393 -0.285825,0.0966 v 0.32935 h 0.01671 q 0.120348,-0.0868 0.292511,-0.14582 0.172165,-0.0607 0.337643,-0.0607 0.172165,0 0.290841,0.0655 0.118676,0.0639 0.118676,0.1917 0,0.11306 -0.07188,0.17041 -0.0702,0.0574 -0.227324,0.0934 -0.08691,0.0197 -0.193893,0.0393 -0.108643,0.0197 -0.180522,0.0361 -0.218966,0.0491 -0.337642,0.16877 -0.118677,0.12125 -0.118677,0.32115 z" - style="stroke-width:0.0847338" + d="m 11.716156,216.89919 q 0,0.2507 -0.120488,0.41128 -0.119538,0.16058 -0.327308,0.16058 -0.117641,0 -0.216308,-0.0475 -0.09772,-0.0492 -0.164128,-0.10651 v -0.34573 h 0.0095 q 0.08444,0.10977 0.187847,0.17532 0.103409,0.0639 0.198281,0.0639 0.117641,0 0.184052,-0.0655 0.06641,-0.0655 0.06641,-0.20646 0,-0.10808 -0.03605,-0.16386 -0.03605,-0.0557 -0.138513,-0.095 -0.03794,-0.0147 -0.09962,-0.0344 -0.06072,-0.0197 -0.111,-0.0426 -0.139462,-0.0639 -0.198282,-0.18679 -0.05787,-0.12454 -0.05787,-0.30478 0,-0.11305 0.02656,-0.213 0.0275,-0.1 0.08254,-0.17862 0.05313,-0.077 0.134718,-0.12125 0.08254,-0.0458 0.184052,-0.0458 0.09487,0 0.191641,0.041 0.09772,0.0393 0.16223,0.0966 v 0.32935 h -0.0095 q -0.06831,-0.0868 -0.166025,-0.14582 -0.09772,-0.0607 -0.191642,-0.0607 -0.09772,0 -0.165078,0.0655 -0.06736,0.0639 -0.06736,0.1917 0,0.11306 0.0408,0.17041 0.03984,0.0574 0.129026,0.0934 0.04933,0.0197 0.110051,0.0393 0.06166,0.0197 0.102462,0.0361 0.124282,0.0491 0.191641,0.16877 0.06736,0.12125 0.06736,0.32115 z" + style="stroke-width:0.063837" id="path1059" /> <path d="m 13.216187,217.5418 q -0.143483,0.0598 -0.2709,0.0911 -0.125965,0.0314 -0.264219,0.0257 -0.176092,-0.007 -0.317881,-0.0642 -0.141636,-0.0585 -0.23572,-0.16757 -0.09554,-0.10918 -0.137404,-0.27166 -0.04186,-0.16249 -0.02002,-0.37642 0.04072,-0.39875 0.282192,-0.61677 0.242932,-0.21794 0.602392,-0.2031 0.139708,0.006 0.269582,0.0506 0.131329,0.0449 0.23759,0.10632 l -0.03106,0.30416 -0.01455,-6.1e-4 q -0.115201,-0.10266 -0.243738,-0.1606 -0.127083,-0.0579 -0.253695,-0.0631 -0.232848,-0.01 -0.38424,0.14197 -0.149788,0.15019 -0.180696,0.45289 -0.03002,0.29397 0.08476,0.45802 0.116384,0.16263 0.355054,0.17249 0.08296,0.003 0.171047,-0.0149 0.08809,-0.0183 0.16006,-0.0504 0.06278,-0.0281 0.118599,-0.0594 0.05596,-0.0328 0.08905,-0.0563 l 0.01455,6e-4 z" diff --git a/src/ComputerscareHorseADoodleDoo.cpp b/src/ComputerscareHorseADoodleDoo.cpp @@ -4,7 +4,7 @@ struct ComputerscareHorseADoodleDoo; -const std::string HorseAvailableModes[4] = {"Each Channel Independent", "All Channels Triggered by Ch. 1 sequence","Trigger Cascade:\nEach channel is triggered by the previous channel's trigger sequence","EOC Cascade:\nEach channel is triggered by the previous channel's EOC"}; +const std::string HorseAvailableModes[4] = {"Each channel outputs independent pulse & CV sequence", "All channels triggered by Ch. 1 sequence", "Trigger Cascade:\nEach channel is triggered by the previous channel's trigger sequence", "EOC Cascade:\nEach channel is triggered by the previous channel's EOC"}; struct HorseModeParam : ParamQuantity { std::string getDisplayValueString() override { @@ -138,7 +138,8 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { float currentValues[16] = {0.f}; bool atFirstStepPoly[16] = {false}; int previousStep[16] = { -1}; - bool shouldSetEOCHigh[16]={false}; + bool shouldSetEOCHigh[16] = {false}; + bool shouldOutputPulse[16] = {false}; enum ParamIds { PATTERN_KNOB, PATTERN_TRIM, @@ -214,7 +215,7 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { configParam(DENSITY_TRIM, -1.f, 1.f, 0.f, "Density CV Trim"); - configParam(PATTERN_SPREAD, 0.f, 1.f, 0.f, "Pattern Spread", "%", 0, 100); + configParam(PATTERN_SPREAD, 0.f, 1.f, 0.5f, "Pattern Spread", "%", 0, 100); configParam(STEPS_SPREAD, -1.f, 1.f, 0.f, "Steps Spread", "%", 0, 100); configParam(DENSITY_SPREAD, -1.f, 1.f, 0.f, "Density Spread", "%", 0, 100); @@ -229,7 +230,7 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { for (int i = 0; i < 16; i++) { seq[i] = HorseSequencer(0.f, 8, 0.f, i); - previousStep[i]=-1; + previousStep[i] = -1; } @@ -296,6 +297,7 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { } } else { + // no override, operate as normal. Tick sequencer every clock, and tick CV if the trigger is high seqVal[ch] = seq[ch].tickAndGet(); if (seqVal[ch]) { cvVal[ch] = seq[ch].getCV(); @@ -305,12 +307,16 @@ struct ComputerscareHorseADoodleDoo : ComputerscarePolyModule { atFirstStepPoly[ch] = (seq[ch].currentStep == 0); shouldSetEOCHigh[ch] = atFirstStepPoly[ch] && previousStep[ch] != 0; + shouldOutputPulse[ch] = seqVal[ch] == 1 && (previousStep[ch] != seq[ch].currentStep); + previousStep[ch] = seq[ch].currentStep; + + } if (true || inputs[CLOCK_INPUT].isConnected()) { - outputs[TRIGGER_OUTPUT].setVoltage((clockInputHigh && seqVal[ch] == 1) ? 10.0f : 0.0f, ch); + outputs[TRIGGER_OUTPUT].setVoltage((clockInputHigh && shouldOutputPulse[ch]) ? 10.0f : 0.0f, ch); //DEBUG("before output:%f",cvVal); outputs[CV_OUTPUT].setVoltage(cvVal[ch], ch); //outputs[EOC_OUTPUT].setVoltage((currentTriggerIsHigh && atFirstStepPoly[ch]) ? 10.f : 0.0f, ch); @@ -548,21 +554,6 @@ struct setModeItem : MenuItem } }; -/*struct SetAllItem : MenuItem { - ComputerscareRolyPouter *pouter; - - Menu *createChildMenu() override { - Menu *menu = new Menu; - for (int i = 1; i < 17; i++) { - ssmi *menuItem = new ssmi(i); - menuItem->text = "Set all to ch. " + std::to_string(i); - menuItem->pouter = pouter; - menu->addChild(menuItem); - } - return menu; - } - -};*/ struct ModeChildMenu : MenuItem { ComputerscareHorseADoodleDoo *horse; @@ -576,7 +567,7 @@ struct ModeChildMenu : MenuItem { menuItem->text = HorseAvailableModes[i]; menuItem->horse = horse; - menuItem->box.size.y=40; + menuItem->box.size.y = 40; menu->addChild(menuItem); } @@ -594,9 +585,6 @@ struct ComputerscareHorseADoodleDooWidget : ModuleWidget { ComputerscareSVGPanel *panel = new ComputerscareSVGPanel(); panel->box.size = box.size; panel->setBackground(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ComputerscareHorseADoodleDooPanel.svg"))); - - //module->panelRef = panel; - addChild(panel); } @@ -606,22 +594,12 @@ struct ComputerscareHorseADoodleDooWidget : ModuleWidget { addInputBlock("Density", 10, 200, module, 4, ComputerscareHorseADoodleDoo::DENSITY_CV, 0, ComputerscareHorseADoodleDoo::DENSITY_SPREAD); addParam(createParam<ScrambleSnapKnobNoRandom>(Vec(4, 234), module, ComputerscareHorseADoodleDoo::MODE_KNOB)); - - //addInputBlock("Mode", 0, 250, module, ComputerscareHorseADoodleDoo::MODE_KNOB, 0, 1); - - - - - - - - - for (int i = 0; i < 1; i++) { + /*for (int i = 0; i < 1; i++) { horseDisplay = new HorseDisplay(i); horseDisplay->module = module; addChild(horseDisplay); - } + }*/ int outputY = 264; int dy = 30; @@ -685,20 +663,11 @@ struct ComputerscareHorseADoodleDooWidget : ModuleWidget { addParam(createParam<SmallKnob>(Vec(x + 32, y + 5), module, knobIndex + 1)); addInput(createInput<TinyJack>(Vec(x + 54, y + 6), module, inputIndex)); addParam(createParam<ScrambleKnob>(Vec(x + 55, y - 15), module, scrambleIndex)); - - - - - //addChild(smallLetterDisplay); - } void appendContextMenu(Menu* menu) override { ComputerscareHorseADoodleDoo* horse = dynamic_cast<ComputerscareHorseADoodleDoo*>(this->module); - menu->addChild(new MenuEntry); - - ModeChildMenu *modeMenu = new ModeChildMenu(); modeMenu->text = "Polyphonic Triggering Mode"; modeMenu->rightText = RIGHT_ARROW;