Skip to content

Commit

Permalink
Fixed: Random Mix x8 (RX8) not working in trigger mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomassidor committed Oct 23, 2019
1 parent 175929f commit 11931fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ Thomas René Sidor


## Changelog
Version 1.2.1
* Fixed: Random Mix x8 (RX8) not working in trigger mode.

Version 1.2.0
* Added: Random Mix x8 (RX8)
* Added: Simplex Noise (SN1)
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"slug": "TinyTricks",
"name": "Tiny Tricks",
"brand": "Tiny Tricks",
"version": "1.2.0",
"version": "1.2.1",
"license": "MIT",
"author": "Thomas René Sidor",
"authorEmail": "[email protected]",
Expand Down
14 changes: 7 additions & 7 deletions src/random-mix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ struct RX8Base : Module {


float t = 0.f;
float summedLevels = 0.f;
void process(const ProcessArgs &args) override {

bool freeflow = (params[TRIGONLY_PARAM].getValue() == 0.f);
int connected = 0;
float summedLevels = 0.f;
t += 1.0f / args.sampleRate;

if(freeflow || (inputs[TRIG_INPUT].isConnected() && trigger.process(inputs[TRIG_INPUT].getVoltage()))){
Expand All @@ -90,12 +88,11 @@ struct RX8Base : Module {
}

//Getting new levels
float x = t;
summedLevels = 0.f;
for (int i = 0; i < NUM_CHANNELS; i++) {
if(inputs[AUDIO_L_INPUT + i].isConnected()){
connected++;
float y = (2.f*i);
float noiseVal = simp.SumOctave(jitter,x,y,0.7f,speed);
float noiseVal = simp.SumOctave(jitter,t,y,0.7f,speed);
float level = clamp(noiseVal*(pinning),-1.f,1.f);
level *= level;
summedLevels += level;
Expand All @@ -108,10 +105,13 @@ struct RX8Base : Module {

//Mixing signal for output
float mix = 0.f;
int connected = 0;
if(outputs[MIX_L_OUTPUT].isConnected()){
for (int i = 0; i < NUM_CHANNELS; i++) {
if(inputs[AUDIO_L_INPUT + i].isConnected())
if(inputs[AUDIO_L_INPUT + i].isConnected()) {
connected++;
mix += inputs[AUDIO_L_INPUT + i].getVoltage()*levels[i];
}
}
if(connected==1)
outputs[MIX_L_OUTPUT].setVoltage(mix);
Expand Down

0 comments on commit 11931fe

Please sign in to comment.