Skip to content

Commit

Permalink
Fix attack and release; cleanup debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashymad committed Jan 28, 2019
1 parent f556c99 commit 36d262d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions Source/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ BancomAudioProcessorEditor::BancomAudioProcessorEditor (BancomAudioProcessor& p)
processor.getStateInformation(data);
MemoryInputStream stream(data, false);
ValueTree processorTree = ValueTree::readFromStream(stream);
DBG(processorTree.toXmlString());

for (int i = 0; i < processorTree.getNumChildren(); ++i){
addGainSlider();
Expand All @@ -50,8 +49,8 @@ BancomAudioProcessorEditor::BancomAudioProcessorEditor (BancomAudioProcessor& p)

gainSliders.getLast()->setValue(bTree.getProperty("gain"), dontSendNotification);
ratioSliders.getLast()->setValue(bTree.getProperty("ratio"), dontSendNotification);
attackSliders.getLast()->setValue(bTree.getProperty("attack"), dontSendNotification);
releaseSliders.getLast()->setValue(bTree.getProperty("release"), dontSendNotification);
attackSliders.getLast()->setValue(static_cast<float>(bTree.getProperty("attack"))*1000, dontSendNotification);
releaseSliders.getLast()->setValue(static_cast<float>(bTree.getProperty("release"))*1000, dontSendNotification);
thresholdSliders.getLast()->setValue(bTree.getProperty("threshold"), dontSendNotification);
}

Expand Down Expand Up @@ -81,7 +80,7 @@ void BancomAudioProcessorEditor::addLevelMeterGraphics()
void BancomAudioProcessorEditor::addGainSlider()
{
Slider* slider = new Slider();
slider->setRange(0.0f, 40.0f);
slider->setRange(0.0f, 40.0f, 0.1f);
slider->setValue(0.0f, dontSendNotification);
slider->setTextValueSuffix(" dB");
slider->setPopupDisplayEnabled (true, false, this);
Expand Down Expand Up @@ -128,7 +127,7 @@ void BancomAudioProcessorEditor::addReleaseSlider()
void BancomAudioProcessorEditor::addRatioSlider()
{
Slider* slider = new Slider();
slider->setRange(1.0f, 90.0f);
slider->setRange(1.0f, 90.0f, 0.1f);
slider->setSkewFactor(0.5f);
slider->setValue(1.0f, dontSendNotification);
slider->setTextValueSuffix(":1");
Expand All @@ -140,7 +139,7 @@ void BancomAudioProcessorEditor::addRatioSlider()
void BancomAudioProcessorEditor::addThresholdSlider()
{
Slider* slider = new Slider();
slider->setRange(-90.0f, 0.0f);
slider->setRange(-90.0f, 0.0f, 0.1f);
slider->setSkewFactor(2.0f);
slider->setValue(0.0f, dontSendNotification);
slider->setTextValueSuffix(" dB");
Expand Down
4 changes: 2 additions & 2 deletions Source/PluginProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ void BancomAudioProcessor::setStateInformation (const void* data, int sizeInByte
float threshold = bTree.getProperty("threshold");

gainProcessor->setGainDecibels(gain);
compressorProcessor->setAttack(attack*1000);
compressorProcessor->setRelease(release*1000);
compressorProcessor->setAttack(attack);
compressorProcessor->setRelease(release);
compressorProcessor->setRatio(ratio);
compressorProcessor->setThreshold(threshold);

Expand Down

0 comments on commit 36d262d

Please sign in to comment.