Skip to content

Commit

Permalink
OUAIve read mode available under TRIG mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-bouffier committed Dec 5, 2017
1 parent c264ed1 commit 695feeb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Bidoo's plugins for [VCVRack](https://vcvrack.com)

<!-- Version and License Badges -->
![Version](https://img.shields.io/badge/version-0.5.3-green.svg?style=flat-square)
![Version](https://img.shields.io/badge/version-0.5.5-green.svg?style=flat-square)
![License](https://img.shields.io/badge/license-BSD3-blue.svg?style=flat-square)
![Language](https://img.shields.io/badge/language-C++-yellow.svg?style=flat-square)

Expand Down
30 changes: 28 additions & 2 deletions src/OUAIVE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,18 @@ void OUAIVE::step() {
string s = stream.str();
displaySpeed = "x" + s;



if ((trigMode == 0) && (playTrigger.process(inputs[GATE_INPUT].value))) {
play = true;
displayParams = "TRIG";
samplePos = clampi((int)(inputs[POS_INPUT].value*audioFile.getNumSamplesPerChannel()/10), 0 , audioFile.getNumSamplesPerChannel() -1);
if (readMode == 0) {
displayReadMode = "";
} else if (readMode == 2) {
displayReadMode = "►►";
}
else {
displayReadMode = "";
}
} else if (trigMode == 1) {
displayParams = "GATE";
play = (inputs[GATE_INPUT].value > 0);
Expand Down Expand Up @@ -166,7 +172,23 @@ void OUAIVE::step() {

//shift samplePos
if (trigMode == 0) {
if (readMode != 1) {
samplePos = samplePos + speed;
}
else {
samplePos = samplePos - speed;
}

//manage eof readMode
if ((readMode == 0) && (samplePos >= audioFile.getNumSamplesPerChannel()))
play = false;

if ((readMode == 1) && (samplePos <=0))
play = false;

if ((readMode == 2) && (samplePos >= audioFile.getNumSamplesPerChannel())) {
samplePos = clampi((int)(inputs[POS_INPUT].value*audioFile.getNumSamplesPerChannel()/10), 0 , audioFile.getNumSamplesPerChannel() -1);
}
}
else if (trigMode == 2)
{
Expand Down Expand Up @@ -224,6 +246,10 @@ struct OUAIVEDisplay : TransparentWidget {
if (module->trigMode != 1)
nvgTextBox(vg, 95, 55,30, module->displaySpeed.c_str(), NULL);

if (module->trigMode == 0) {
nvgTextBox(vg, 45, 55,20, module->displayReadMode.c_str(), NULL);
}

if (module->trigMode == 2) {
nvgTextBox(vg, 45, 55,20, module->displayReadMode.c_str(), NULL);
nvgTextBox(vg, 62, 55,40, module->displaySlices.c_str(), NULL);
Expand Down

0 comments on commit 695feeb

Please sign in to comment.