Skip to content

Commit

Permalink
Merge pull request #33 from jeremymuller/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jeremymuller authored Oct 3, 2021
2 parents 874e948 + 1c5737e commit 56c3300
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.3.6 (10-02-2021)
- Put gates back to 1e-3 on StochSeq and StochSeq4
- Fixed UI bug in sliders that would allow for < 0%

v1.3.5 (9-30-2021)
- Added NOT gate and INV v/oct to StochSeq and all StochSeq4 patterns
- Added OR and XOR gates to StochSeq4 patterns
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"slug": "Sha-Bang-Modules",
"name": "Sha#Bang! Modules",
"version": "1.3.5",
"version": "1.3.6",
"license": "GPL-3.0-only",
"author": "Jeremy Muller",
"authorEmail": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion src/Photron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ struct PhotronDisplay : Widget {

// X
if (module->inputs[Photron::X_INPUT].active) {
Vec3 rgb = module->blocks[12][12].rgb;
Vec3 rgb = module->blocks[module->rows-1][module->cols-1].rgb;
nvgStrokeColor(args.vg, nvgRGB(rgb.x, rgb.y, rgb.z));
// nvgStrokeColor(args.vg, nvgRGBA(0x28, 0xb0, 0xf3, 0xc0));
drawWaveform(args.vg, valuesX, NULL);
Expand Down
7 changes: 4 additions & 3 deletions src/StochSeq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ struct StochSeq : Module, Quantize {

float prob = gateProbabilities[gateIndex];
if (random::uniform() < prob) {
gatePulse.trigger(1e-1);
gatePulse.trigger(1e-3);
currentGateOut = gateIndex;
lightBlink = true;
randLight = static_cast<int>(random::uniform() * NUM_OF_LIGHTS);
} else {
notGatePulse.trigger(1e-1);
notGatePulse.trigger(1e-3);
}

float spread = params[SPREAD_PARAM].getValue();
Expand Down Expand Up @@ -388,7 +388,8 @@ struct StochSeqDisplay : Widget {
if (index >= NUM_OF_SLIDERS) index = NUM_OF_SLIDERS - 1;
if (dragY < 0) dragY = 0;
else if (dragY > box.size.y) dragY = box.size.y - SLIDER_TOP;
module->gateProbabilities[index] = 1.0 - dragY / (box.size.y - SLIDER_TOP);
float prob = 1.0 - dragY / (box.size.y - SLIDER_TOP);
module->gateProbabilities[index] = clamp(prob, 0.0, 1.0);
}

float getSliderHeight(int index) {
Expand Down
7 changes: 4 additions & 3 deletions src/StochSeq4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ struct Sequencer {
// gate
float prob = gateProbabilities[gateIndex];
if (random::uniform() < prob) {
gatePulse.trigger(1e-1);
gatePulse.trigger(1e-3);
} else {
notGatePulse.trigger(1e-1);
notGatePulse.trigger(1e-3);
}

// pitch
Expand Down Expand Up @@ -483,7 +483,8 @@ struct StochSeq4Display : Widget {
if (index >= NUM_OF_SLIDERS) index = NUM_OF_SLIDERS - 1;
if (dragY < 0) dragY = 0;
else if (dragY > box.size.y) dragY = box.size.y - SLIDER_TOP;
module->seqs[seqId].gateProbabilities[index] = 1.0 - dragY / (box.size.y - SLIDER_TOP);
float prob = 1.0 - dragY / (box.size.y - SLIDER_TOP);
module->seqs[seqId].gateProbabilities[index] = clamp(prob, 0.0, 1.0);
}

float getSliderHeight(int index) {
Expand Down

0 comments on commit 56c3300

Please sign in to comment.