diff --git a/Source/GUIelements/LineGraph.h b/Source/GUIelements/LineGraph.h index 2fe39b2..219e805 100644 --- a/Source/GUIelements/LineGraph.h +++ b/Source/GUIelements/LineGraph.h @@ -41,9 +41,8 @@ template class LineGraph : public juce::Component, public juce::Async return; } for (int i = 0; i < numPoints; ++i) { - if ((ymin <= data[i]) && (data[i] <= ymax)) { - yVals[i] = getHeight() - (data[i] - ymin) / (ymax - ymin) * getHeight(); - } + auto d = std::max(ymin, std::min(data[i], ymax)); + yVals[i] = getHeight() - (d - ymin) / (ymax - ymin) * getHeight(); } triggerAsyncUpdate(); } diff --git a/Source/GUIelements/PsychoanalGraph.cpp b/Source/GUIelements/PsychoanalGraph.cpp index ca02b0b..7c0cbdb 100644 --- a/Source/GUIelements/PsychoanalGraph.cpp +++ b/Source/GUIelements/PsychoanalGraph.cpp @@ -49,13 +49,16 @@ void PsychoanalGraph::valueTreePropertyChanged(juce::ValueTree &treeWhosePropert if (property == juce::Identifier("energy")) { juce::Array* e = treeWhosePropertyHasChanged[property].getArray(); for (int i = 0; i < 22; ++i) { - energyVals[i] = (*e)[i].operator double(); + energyVals[i] = (float)(*e)[i].operator double(); } } else if (property == juce::Identifier("threshold")) { juce::Array* t = treeWhosePropertyHasChanged[property].getArray(); + std::cout << "new threshold"; for (int i = 0; i < 22; ++i) { - thresholdVals[i] = (*t)[i].operator double(); + thresholdVals[i] = (float)(*t)[i].operator double(); + std::cout << thresholdVals[i] << " "; } + std::cout << "\n"; } energy.loadData(energyVals.data()); diff --git a/Source/MP3Controller.cpp b/Source/MP3Controller.cpp index c2f12ef..9caf01a 100644 --- a/Source/MP3Controller.cpp +++ b/Source/MP3Controller.cpp @@ -109,7 +109,7 @@ bool MP3Controller::processFrame (float* leftIn, float* rightIn, float* leftOut, void MP3Controller::setThresholdBias (float bias) { - const float incr = 0.05; +/* const float incr = 0.05; if (std::abs(bias - actualThresholdBias) < incr) { actualThresholdBias = bias; } else if (bias > actualThresholdBias) { @@ -117,5 +117,6 @@ void MP3Controller::setThresholdBias (float bias) } else { actualThresholdBias -= incr; } - _setThresholdBias(actualThresholdBias); + _setThresholdBias(actualThresholdBias);*/ + _setThresholdBias(bias); } \ No newline at end of file