computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit 9804bc5e9cbe2ee59c1c3f12ca716baa75fe792b
parent 77e8e973e7b552add8d82bf70f8dc80dc1f053f4
Author: Adam M <[email protected]>
Date:   Sun, 17 Nov 2019 00:21:48 -0600

Format, add chanceof to the randomization output of laundry

Diffstat:
Msrc/ComputerscareLaundrySoup.cpp | 15+++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/ComputerscareLaundrySoup.cpp b/src/ComputerscareLaundrySoup.cpp @@ -96,9 +96,12 @@ struct ComputerscareLaundrySoup : Module { for (int j = 0; j < length; j++) { randchar = mainlookup[floor(random::uniform() * mainlookup.size())]; string = string + randchar; + if (random::uniform() < 0.2) { + string += "?"; } - if(random::uniform() < 0.5) { - string += "@"+std::to_string((int)(random::uniform()*129)); + } + if (random::uniform() < 0.5) { + string += "@" + std::to_string((int)(random::uniform() * 129)); } currentFormula[i] = string; @@ -113,7 +116,7 @@ struct ComputerscareLaundrySoup : Module { } void setAbsoluteSequenceFromQueue(int index) { laundryPoly[index] = LaundryPoly(currentFormula[index]); - if(laundryPoly[index].inError) { + if (laundryPoly[index].inError) { DEBUG("ERROR ch:%i", index); } } @@ -244,8 +247,8 @@ void ComputerscareLaundrySoup::process(const ProcessArgs &args) { if (inputs[CLOCK_INPUT + i].isConnected()) { for (int ch = 0; ch < 16; ch++) { - outputs[TRG_OUTPUT + i].setVoltage((currentTriggerIsHigh && activePolyStep[i][ch]) ? 10.0f : 0.0f,ch); - outputs[FIRST_STEP_OUTPUT + i].setVoltage((currentTriggerIsHigh && atFirstStepPoly[ch]) ? 10.f : 0.0f,ch); + outputs[TRG_OUTPUT + i].setVoltage((currentTriggerIsHigh && activePolyStep[i][ch]) ? 10.0f : 0.0f, ch); + outputs[FIRST_STEP_OUTPUT + i].setVoltage((currentTriggerIsHigh && atFirstStepPoly[ch]) ? 10.f : 0.0f, ch); } } else { @@ -276,7 +279,7 @@ struct LaundryTF2 : ComputerscareTextField module->manualSet[rowIndex] = false; } std::string value = text.c_str(); - + if (value != module->lastValue[rowIndex]) { LaundrySoupSequence lss = LaundrySoupSequence(value);