commit 8468586b6cf60b45ae265e25c870ee1549b95b96
parent b01755430077989cfd0595b383ce022a7a234316
Author: Matt Demanett <matt@demanett.net>
Date: Wed, 28 Mar 2018 01:01:45 -0400
Oscillators: random fixes.
Diffstat:
15 files changed, 56 insertions(+), 52 deletions(-)
diff --git a/res-src/Additator-src.svg b/res-src/Additator-src.svg
@@ -35,7 +35,7 @@
<g transform="translate(19 19)">
<polyline points="-5,0 5,0" stroke-width="1" stroke="#00f" />
<polyline points="0,-5 0,5" stroke-width="1" stroke="#00f" />
- <circle cx="0" cy="0" r="18" stroke-width="1" stroke="#00f" fill="none" />
+ <circle cx="0" cy="0" r="18.5" stroke-width="1" stroke="#00f" fill="none" />
</g>
</symbol>
@@ -43,7 +43,7 @@
<g transform="translate(13 13)">
<polyline points="-3,0 3,0" stroke-width="1" stroke="#00f" />
<polyline points="0,-3 0,3" stroke-width="1" stroke="#00f" />
- <circle cx="0" cy="0" r="12" stroke-width="1" stroke="#00f" fill="none" />
+ <circle cx="0" cy="0" r="12.5" stroke-width="1" stroke="#00f" fill="none" />
</g>
</symbol>
@@ -362,11 +362,11 @@
</g>
<g transform="translate(37 0)">
<use id="PARTIALS_INPUT" xlink:href="#input" transform="translate(3 5)" />
- <text font-size="6pt" letter-spacing="2px" transform="translate(5.5 40)">PTS</text>
+ <text font-size="6pt" letter-spacing="1px" transform="translate(0.5 40)">PRTLS</text>
</g>
<g transform="translate(71 0)">
<use id="WIDTH_INPUT" xlink:href="#input" transform="translate(3 5)" />
- <text font-size="6pt" letter-spacing="2px" transform="translate(0.5 40)">WDTH</text>
+ <text font-size="6pt" letter-spacing="1px" transform="translate(0 40)">WIDTH</text>
</g>
<g transform="translate(105 0)">
<use id="ODD_SKEW_INPUT" xlink:href="#input" transform="translate(3 5)" />
@@ -389,7 +389,7 @@
</g>
<g transform="translate(71 0)">
<use id="DECAY_INPUT" xlink:href="#input" transform="translate(3 5)" />
- <text font-size="6pt" letter-spacing="2px" transform="translate(5.5 40)">DEC</text>
+ <text font-size="6pt" letter-spacing="1px" transform="translate(1 40)">DECAY</text>
</g>
<g transform="translate(105 0)">
<use id="BALANCE_INPUT" xlink:href="#input" transform="translate(3 5)" />
@@ -397,7 +397,7 @@
</g>
<g transform="translate(139 0)">
<use id="FILTER_INPUT" xlink:href="#input" transform="translate(3 5)" />
- <text font-size="6pt" letter-spacing="2px" transform="translate(6.5 40)">FLT</text>
+ <text font-size="6pt" letter-spacing="2px" transform="translate(3 40)">FLTR</text>
</g>
<g transform="translate(173 0)">
<use id="AUDIO_OUTPUT" xlink:href="#output" transform="translate(3 5)" />
diff --git a/res-src/EightFO-src.svg b/res-src/EightFO-src.svg
@@ -411,7 +411,7 @@
<g transform="translate(50 0)">
<!-- <rect width="30" height="47" rx="5" fill="#fafafa" /> -->
<use id="RESET_INPUT" xlink:href="#input" transform="translate(2 5)" />
- <text font-size="6pt" letter-spacing="2px" transform="translate(4.5 40)">RST</text>
+ <text font-size="6pt" letter-spacing="1px" transform="translate(0 40)">RESET</text>
</g>
</g>
</svg>
diff --git a/res-src/FMOp-src.svg b/res-src/FMOp-src.svg
@@ -27,7 +27,7 @@
<g transform="translate(19 19)">
<polyline points="-5,0 5,0" stroke-width="1" stroke="#00f" />
<polyline points="0,-5 0,5" stroke-width="1" stroke="#00f" />
- <circle cx="0" cy="0" r="18" stroke-width="1" stroke="#00f" fill="none" />
+ <circle cx="0" cy="0" r="18.5" stroke-width="1" stroke="#00f" fill="none" />
</g>
</symbol>
@@ -35,7 +35,7 @@
<g transform="translate(13 13)">
<polyline points="-3,0 3,0" stroke-width="1" stroke="#00f" />
<polyline points="0,-3 0,3" stroke-width="1" stroke="#00f" />
- <circle cx="0" cy="0" r="12" stroke-width="1" stroke="#00f" fill="none" />
+ <circle cx="0" cy="0" r="12.5" stroke-width="1" stroke="#00f" fill="none" />
</g>
</symbol>
diff --git a/res-src/VCO-src.svg b/res-src/VCO-src.svg
@@ -35,7 +35,7 @@
<g transform="translate(13 13)">
<polyline points="-3,0 3,0" stroke-width="1" stroke="#00f" />
<polyline points="0,-3 0,3" stroke-width="1" stroke="#00f" />
- <circle cx="0" cy="0" r="12" stroke-width="1" stroke="#00f" fill="none" />
+ <circle cx="0" cy="0" r="12.5" stroke-width="1" stroke="#00f" fill="none" />
</g>
</symbol>
@@ -304,8 +304,8 @@
<use id="FM_PARAM" xlink:href="#knob-medium" transform="translate(18 0)" />
</g>
<!-- <rect width="90" height="10" fill="#0f0" transform="translate(0 26)" /> -->
- <g transform="translate(52 1)">
- <use id="FM_TYPE_PARAM" xlink:href="#button-small" transform="translate(30 7.5)" />
+ <g transform="translate(53 -3)">
+ <use id="FM_TYPE_PARAM" xlink:href="#button-small" transform="translate(9 26)" />
<g transform="translate(0 2)">
<use id="FM_EXP_LIGHT" xlink:href="#light-small" transform="translate(0 0)" />
<text font-size="6pt" letter-spacing="2px" transform="translate(9 6.2)">EXP</text>
diff --git a/res-src/XCO-src.svg b/res-src/XCO-src.svg
@@ -35,7 +35,7 @@
<g transform="translate(13 13)">
<polyline points="-3,0 3,0" stroke-width="1" stroke="#00f" />
<polyline points="0,-3 0,3" stroke-width="1" stroke="#00f" />
- <circle cx="0" cy="0" r="12" stroke-width="1" stroke="#00f" fill="none" />
+ <circle cx="0" cy="0" r="12.5" stroke-width="1" stroke="#00f" fill="none" />
</g>
</symbol>
@@ -283,8 +283,8 @@
<use id="FM_INPUT" xlink:href="#input" transform="translate(3 5)" />
<text font-size="6pt" letter-spacing="1px" transform="translate(9 40)">FM</text>
</g>
- <g transform="translate(42 11.5)">
- <use id="FM_TYPE_PARAM" xlink:href="#button-small" transform="translate(30 7.5)" />
+ <g transform="translate(42 6)">
+ <use id="FM_TYPE_PARAM" xlink:href="#button-small" transform="translate(9 26)" />
<g transform="translate(0 2)">
<use id="FM_EXP_LIGHT" xlink:href="#light-small" transform="translate(0 0)" />
<text font-size="6pt" letter-spacing="2px" transform="translate(9 6.2)">EXP</text>
diff --git a/res/Additator.svg b/res/Additator.svg
Binary files differ.
diff --git a/res/EightFO.svg b/res/EightFO.svg
Binary files differ.
diff --git a/res/FMOp.svg b/res/FMOp.svg
Binary files differ.
diff --git a/res/VCO.svg b/res/VCO.svg
Binary files differ.
diff --git a/res/XCO.svg b/res/XCO.svg
Binary files differ.
diff --git a/src/Additator.cpp b/src/Additator.cpp
@@ -24,11 +24,14 @@ float Additator::cvValue(Input& cv, bool dc) {
}
void Additator::step() {
- lights[SINE_LIGHT].value = _phase == PHASE_SINE;
- lights[COSINE_LIGHT].value = _phase == PHASE_COSINE;
if (!outputs[AUDIO_OUTPUT].active) {
+ Phase phase = ((int)params[PHASE_PARAM].value) == 2 ? PHASE_COSINE : PHASE_SINE;
+ lights[SINE_LIGHT].value = phase == PHASE_SINE;
+ lights[COSINE_LIGHT].value = phase == PHASE_COSINE;
return;
}
+ lights[SINE_LIGHT].value = _phase == PHASE_SINE;
+ lights[COSINE_LIGHT].value = _phase == PHASE_COSINE;
++_steps;
if (_steps >= modulationSteps) {
@@ -145,15 +148,15 @@ struct AdditatorWidget : ModuleWidget {
// generated by svg_widgets.rb
auto frequencyParamPosition = Vec(40.0, 45.0);
- auto partialsParamPosition = Vec(163.5, 60.5);
+ auto partialsParamPosition = Vec(163.0, 60.0);
auto fineParamPosition = Vec(30.0, 160.0);
- auto widthParamPosition = Vec(79.5, 155.5);
- auto oddSkewParamPosition = Vec(132.5, 155.5);
- auto evenSkewParamPosition = Vec(184.5, 155.5);
- auto gainParamPosition = Vec(25.5, 218.5);
- auto decayParamPosition = Vec(79.5, 218.5);
- auto balanceParamPosition = Vec(132.5, 218.5);
- auto filterParamPosition = Vec(184.5, 218.5);
+ auto widthParamPosition = Vec(79.0, 155.0);
+ auto oddSkewParamPosition = Vec(132.0, 155.0);
+ auto evenSkewParamPosition = Vec(184.0, 155.0);
+ auto gainParamPosition = Vec(25.0, 218.0);
+ auto decayParamPosition = Vec(79.0, 218.0);
+ auto balanceParamPosition = Vec(132.0, 218.0);
+ auto filterParamPosition = Vec(184.0, 218.0);
auto phaseParamPosition = Vec(194.0, 299.0);
auto pitchInputPosition = Vec(16.0, 274.0);
diff --git a/src/EightFO.cpp b/src/EightFO.cpp
@@ -15,7 +15,7 @@ void EightFO::onSampleRateChange() {
}
void EightFO::step() {
- lights[SLOW_LIGHT].value = _slowMode;
+ lights[SLOW_LIGHT].value = _slowMode = ((int)params[SLOW_PARAM].value) == 1;
if (!(
outputs[PHASE7_OUTPUT].active ||
outputs[PHASE6_OUTPUT].active ||
@@ -33,7 +33,6 @@ void EightFO::step() {
if (_modulationStep >= modulationSteps) {
_modulationStep = 0;
- _slowMode = ((int)params[SLOW_PARAM].value) == 1;
float frequency = powf(params[FREQUENCY_PARAM].value, frequencyExponent);
frequency *= maxFrequency - minFrequency;
frequency += minFrequency;
diff --git a/src/FMOp.cpp b/src/FMOp.cpp
@@ -16,11 +16,13 @@ void FMOp::onSampleRateChange() {
}
void FMOp::step() {
- lights[ENV_TO_LEVEL_LIGHT].value = _levelEnvelopeOn;
- lights[ENV_TO_FEEDBACK_LIGHT].value = _feedbackEnvelopeOn;
if (!outputs[AUDIO_OUTPUT].active) {
+ lights[ENV_TO_LEVEL_LIGHT].value = params[ENV_TO_LEVEL_PARAM].value > 0.5f;
+ lights[ENV_TO_FEEDBACK_LIGHT].value = params[ENV_TO_FEEDBACK_PARAM].value > 0.5f;
return;
}
+ lights[ENV_TO_LEVEL_LIGHT].value = _levelEnvelopeOn;
+ lights[ENV_TO_FEEDBACK_LIGHT].value = _feedbackEnvelopeOn;
float pitchIn = 0.0f;
if (inputs[PITCH_INPUT].active) {
@@ -128,15 +130,15 @@ struct FMOpWidget : ModuleWidget {
addChild(Widget::create<ScrewSilver>(Vec(box.size.x - 30, 365)));
// generated by svg_widgets.rb
- auto ratioParamPosition = Vec(30.5, 45.5);
+ auto ratioParamPosition = Vec(30.0, 45.0);
auto fineParamPosition = Vec(112.0, 57.0);
- auto attackParamPosition = Vec(107.5, 92.5);
- auto decayParamPosition = Vec(107.5, 135.5);
- auto sustainParamPosition = Vec(107.5, 178.5);
- auto releaseParamPosition = Vec(107.5, 221.5);
- auto depthParamPosition = Vec(36.5, 115.5);
- auto feedbackParamPosition = Vec(36.5, 164.5);
- auto levelParamPosition = Vec(36.5, 213.5);
+ auto attackParamPosition = Vec(107.0, 92.0);
+ auto decayParamPosition = Vec(107.0, 135.0);
+ auto sustainParamPosition = Vec(107.0, 178.0);
+ auto releaseParamPosition = Vec(107.0, 221.0);
+ auto depthParamPosition = Vec(36.0, 115.0);
+ auto feedbackParamPosition = Vec(36.0, 164.0);
+ auto levelParamPosition = Vec(36.0, 213.0);
auto envToLevelParamPosition = Vec(76.0, 257.3);
auto envToFeedbackParamPosition = Vec(125.0, 257.3);
diff --git a/src/VCO.cpp b/src/VCO.cpp
@@ -13,7 +13,8 @@ void VCO::onSampleRateChange() {
}
void VCO::step() {
- lights[SLOW_LIGHT].value = _slowMode;
+ lights[SLOW_LIGHT].value = _slowMode = ((int)params[SLOW_PARAM].value) == 1;
+ _fmLinearMode = ((int)params[FM_TYPE_PARAM].value) == 1;
lights[FM_EXP_LIGHT].value = !_fmLinearMode;
lights[FM_LIN_LIGHT].value = _fmLinearMode;
@@ -35,7 +36,7 @@ void VCO::step() {
if (inputs[PITCH_INPUT].active) {
_baseVOct += clamp(inputs[PITCH_INPUT].value, -5.0f, 5.0f);
}
- if ((_slowMode = ((int)params[SLOW_PARAM].value)) == 1) {
+ if (_slowMode) {
_baseVOct -= 5.0f;
}
_baseHz = cvToFrequency(_baseVOct);
@@ -53,7 +54,6 @@ void VCO::step() {
_square.setPulseWidth(pw);
_fmDepth = params[FM_PARAM].value;
- _fmLinearMode = ((int)params[FM_TYPE_PARAM].value) == 1;
}
float phaseOffset = 0.0f;
@@ -105,9 +105,9 @@ struct VCOWidget : ModuleWidget {
auto frequencyParamPosition = Vec(40.0, 45.0);
auto fineParamPosition = Vec(33.0, 151.0);
auto slowParamPosition = Vec(130.0, 155.2);
- auto pwParamPosition = Vec(28.5, 186.5);
- auto fmParamPosition = Vec(28.5, 231.5);
- auto fmTypeParamPosition = Vec(92.0, 239.5);
+ auto pwParamPosition = Vec(28.0, 186.0);
+ auto fmParamPosition = Vec(28.0, 231.0);
+ auto fmTypeParamPosition = Vec(72.0, 254.0);
auto pitchInputPosition = Vec(14.0, 318.0);
auto syncInputPosition = Vec(52.0, 318.0);
@@ -120,8 +120,8 @@ struct VCOWidget : ModuleWidget {
auto sineOutputPosition = Vec(113.0, 318.0);
auto slowLightPosition = Vec(90.0, 156.5);
- auto fmExpLightPosition = Vec(62.0, 234.0);
- auto fmLinLightPosition = Vec(62.0, 247.3);
+ auto fmExpLightPosition = Vec(63.0, 230.0);
+ auto fmLinLightPosition = Vec(63.0, 243.3);
// end generated by svg_widgets.rb
addParam(ParamWidget::create<Knob68>(frequencyParamPosition, module, VCO::FREQUENCY_PARAM, -3.0, 6.0, 0.0));
diff --git a/src/XCO.cpp b/src/XCO.cpp
@@ -13,7 +13,8 @@ void XCO::onSampleRateChange() {
}
void XCO::step() {
- lights[SLOW_LIGHT].value = _slowMode;
+ lights[SLOW_LIGHT].value = _slowMode = ((int)params[SLOW_PARAM].value) == 1;
+ _fmLinearMode = ((int)params[FM_TYPE_PARAM].value) == 1;
lights[FM_EXP_LIGHT].value = !_fmLinearMode;
lights[FM_LIN_LIGHT].value = _fmLinearMode;
@@ -36,7 +37,7 @@ void XCO::step() {
if (inputs[PITCH_INPUT].active) {
_baseVOct += clamp(inputs[PITCH_INPUT].value, -5.0f, 5.0f);
}
- if ((_slowMode = ((int)params[SLOW_PARAM].value)) == 1) {
+ if (_slowMode) {
_baseVOct -= 5.0f;
}
_baseHz = cvToFrequency(_baseVOct);
@@ -60,7 +61,6 @@ void XCO::step() {
_saw.setSaturation(saturation * 10.f);
_fmDepth = params[FM_PARAM].value;
- _fmLinearMode = ((int)params[FM_TYPE_PARAM].value) == 1;
_squarePhaseOffset = phaseOffset(params[SQUARE_PHASE_PARAM], inputs[SQUARE_PHASE_INPUT]);
_sawPhaseOffset = phaseOffset(params[SAW_PHASE_PARAM], inputs[SAW_PHASE_INPUT]);
@@ -142,8 +142,8 @@ struct XCOWidget : ModuleWidget {
auto frequencyParamPosition = Vec(40.0, 45.0);
auto fineParamPosition = Vec(65.5, 156.0);
auto slowParamPosition = Vec(90.0, 191.7);
- auto fmParamPosition = Vec(61.5, 219.5);
- auto fmTypeParamPosition = Vec(103.0, 275.0);
+ auto fmParamPosition = Vec(61.0, 219.0);
+ auto fmTypeParamPosition = Vec(82.0, 288.0);
auto squarePwParamPosition = Vec(147.0, 60.0);
auto squarePhaseParamPosition = Vec(147.0, 148.0);
auto squareMixParamPosition = Vec(147.0, 237.0);
@@ -176,8 +176,8 @@ struct XCOWidget : ModuleWidget {
auto mixOutputPosition = Vec(103.0, 318.0);
auto slowLightPosition = Vec(50.0, 193.0);
- auto fmExpLightPosition = Vec(73.0, 270.5);
- auto fmLinLightPosition = Vec(73.0, 281.8);
+ auto fmExpLightPosition = Vec(73.0, 264.0);
+ auto fmLinLightPosition = Vec(73.0, 277.3);
// end generated by svg_widgets.rb
addParam(ParamWidget::create<Knob68>(frequencyParamPosition, module, XCO::FREQUENCY_PARAM, -3.0, 6.0, 0.0));