Skip to content

Commit

Permalink
Slow start fix with long notes used
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomek Sosnowski committed Mar 31, 2018
1 parent 5b1aa1c commit ca07dd7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SLUG = KoralfxVCV

# Must follow the format in the Versioning section of https://vcvrack.com/manual/PluginDevelopmentTutorial.html
VERSION = 0.6.1
VERSION = 0.6.1a

# FLAGS will be passed to both the C and C++ compiler
FLAGS +=
Expand Down
45 changes: 36 additions & 9 deletions src/Scorovnik/Scorovnik.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ void Scorovnik::step() {
stepNumber = "--";
notePitchDisplay = "--";
}



float deltaTime = engineGetSampleTime();
bool clockGateOn = false;
Expand Down Expand Up @@ -101,8 +99,8 @@ void Scorovnik::step() {

//start triggers
if (startTriggerA.process(inputs[START_INPUT + 0].value)) {
groupPlay[0] = 1; mode1LoopCounter = loopLimit;
mode2LoopCounterA = loopLimit;
groupPlay[0] = 1;
mode1LoopCounter = loopLimit;
mode2LoopCounterA = loopLimit;
mode3LoopCounterA = loopLimit;
}
Expand All @@ -120,10 +118,25 @@ void Scorovnik::step() {
}

//stop triggers
if (stopTriggerA.process(inputs[STOP_INPUT + 0].value)) groupPlay[0] = 0;
if (stopTriggerB.process(inputs[STOP_INPUT + 1].value)) groupPlay[1] = 0;
if (stopTriggerC.process(inputs[STOP_INPUT + 2].value)) groupPlay[2] = 0;
if (stopTriggerD.process(inputs[STOP_INPUT + 3].value)) groupPlay[3] = 0;
if (stopTriggerA.process(inputs[STOP_INPUT + 0].value)) {
groupPlay[0] = 0;
mode1SeqCounter = 0;
mode2SeqCounterA = 0;
mode3SeqCounterA = 0;
}
if (stopTriggerB.process(inputs[STOP_INPUT + 1].value)) {
groupPlay[1] = 0;
mode3SeqCounterB = 0;
}
if (stopTriggerC.process(inputs[STOP_INPUT + 2].value)) {
groupPlay[2] = 0;
mode2SeqCounterC = 0;
mode3SeqCounterC = 0;
}
if (stopTriggerD.process(inputs[STOP_INPUT + 3].value)) {
groupPlay[3] = 0;
mode3SeqCounterD = 0;
}

//reset triggers
if (resetTriggerA.process(inputs[RESET_INPUT + 0].value)) {
Expand Down Expand Up @@ -155,10 +168,12 @@ void Scorovnik::step() {

if (globalStopTriger.process(params[SWITCH_STOP_PARAM].value)) {
groupPlay[0] = 0;
mode1SeqCounter = 0;
}

if (globalResetTriger.process(params[SWITCH_RESET_PARAM].value)) {
mode1Seq = -1;
mode1SeqCounter = 0;
}
break;

Expand All @@ -172,10 +187,14 @@ void Scorovnik::step() {
if (globalStopTriger.process(params[SWITCH_STOP_PARAM].value)) {
groupPlay[0] = 0;
groupPlay[2] = 0;
mode2SeqCounterA = 0;
mode2SeqCounterC = 0;
}
if (globalResetTriger.process(params[SWITCH_RESET_PARAM].value)) {
mode2SeqA = -1;
mode2SeqC = 15;
mode2SeqCounterA = 0;
mode2SeqCounterC = 0;
}
break;

Expand All @@ -195,13 +214,21 @@ void Scorovnik::step() {
groupPlay[1] = 0;
groupPlay[2] = 0;
groupPlay[3] = 0;
mode3SeqCounterA = 0;
mode3SeqCounterB = 0;
mode3SeqCounterC = 0;
mode3SeqCounterD = 0;
}

if (globalResetTriger.process(params[SWITCH_RESET_PARAM].value)) {
mode3SeqA = -1;
mode3SeqB = 7;
mode3SeqC = 15;
mode3SeqD = 23;
mode3SeqCounterA = 0;
mode3SeqCounterB = 0;
mode3SeqCounterC = 0;
mode3SeqCounterD = 0;
}
break;
}
Expand Down Expand Up @@ -265,6 +292,7 @@ void Scorovnik::step() {
///////////////////////////////////////////////////////////////////////////////

switch(mode) {

case 0:
if (groupPlay [0] == 1) {
if (mode1SeqCounter > 0) mode1SeqCounter -= 1;
Expand Down Expand Up @@ -349,7 +377,6 @@ void Scorovnik::step() {
case 0:
if (groupPlay[0] == 1) {
notePitch = (params[SLIDER_NOTE_PITCH_PARAM + mode1Seq].value)*(10/122.0) ;

outputs[PITCH_OUTPUT + 0].value = notePitch + globalTranspose * (10/122.0) + uniOut;

noteStaccato = params[SWITCH_NOTE_STACCATO_PARAM + mode1Seq].value ;
Expand Down
1 change: 0 additions & 1 deletion src/Scorovnik/Scorovnik.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ struct Scorovnik : Module {
int globalTranspose = 0;
int globalTransposeOld = -1;


int loopLimit = 0;
int loopLimitOld = -1;

Expand Down

0 comments on commit ca07dd7

Please sign in to comment.