fixed filter issues
This commit is contained in:
@@ -47,6 +47,16 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
audio_->parameters()->set(ParamId::Osc1WaveSelector2, index);
|
||||
});
|
||||
|
||||
connect(ui_->sliderOsc1Volume, &SmartSlider::valueChanged, this, [this](float v) {
|
||||
audio_->parameters()->set(ParamId::Osc1Volume, v);
|
||||
});
|
||||
connect(ui_->sliderFilterCutoff, &SmartSlider::valueChanged, this, [this](float v) {
|
||||
audio_->parameters()->set(ParamId::FilterCutoff, v);
|
||||
});
|
||||
connect(ui_->sliderFilterResonance, &SmartSlider::valueChanged, this, [this](float v) {
|
||||
audio_->parameters()->set(ParamId::FilterResonance, v);
|
||||
});
|
||||
|
||||
// synth business
|
||||
audio_->start();
|
||||
|
||||
@@ -77,4 +87,11 @@ void MainWindow::onResetClicked() {
|
||||
ui_->comboOsc1WaveSelector1->setCurrentIndex(static_cast<int>(PARAM_DEFS[static_cast<size_t>(ParamId::Osc1WaveSelector1)].def));
|
||||
ui_->comboOsc1WaveSelector2->setCurrentIndex(static_cast<int>(PARAM_DEFS[static_cast<size_t>(ParamId::Osc1WaveSelector2)].def));
|
||||
|
||||
// misc sliders
|
||||
ui_->sliderOsc1Volume->setRange(PARAM_DEFS[static_cast<size_t>(ParamId::Osc1Volume)].min, PARAM_DEFS[static_cast<size_t>(ParamId::Osc1Volume)].max);
|
||||
ui_->sliderFilterCutoff->setRange(PARAM_DEFS[static_cast<size_t>(ParamId::FilterCutoff)].min, PARAM_DEFS[static_cast<size_t>(ParamId::FilterCutoff)].max);
|
||||
ui_->sliderFilterResonance->setRange(PARAM_DEFS[static_cast<size_t>(ParamId::FilterResonance)].min, PARAM_DEFS[static_cast<size_t>(ParamId::FilterResonance)].max);
|
||||
ui_->sliderOsc1Volume->setValue(PARAM_DEFS[static_cast<size_t>(ParamId::Osc1Volume)].def);
|
||||
ui_->sliderFilterCutoff->setValue(PARAM_DEFS[static_cast<size_t>(ParamId::FilterCutoff)].def);
|
||||
ui_->sliderFilterResonance->setValue(PARAM_DEFS[static_cast<size_t>(ParamId::FilterResonance)].def);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>940</width>
|
||||
<height>600</height>
|
||||
<height>658</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -39,7 +39,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>270</y>
|
||||
<y>360</y>
|
||||
<width>300</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
@@ -68,7 +68,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<y>270</y>
|
||||
<y>360</y>
|
||||
<width>300</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
@@ -84,7 +84,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>620</x>
|
||||
<y>270</y>
|
||||
<y>360</y>
|
||||
<width>300</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
@@ -100,7 +100,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>110</x>
|
||||
<y>240</y>
|
||||
<y>330</y>
|
||||
<width>101</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
@@ -121,7 +121,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>420</x>
|
||||
<y>240</y>
|
||||
<y>330</y>
|
||||
<width>101</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
@@ -142,7 +142,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>710</x>
|
||||
<y>240</y>
|
||||
<y>330</y>
|
||||
<width>121</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
@@ -261,6 +261,108 @@
|
||||
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="SmartSlider" name="sliderFilterCutoff" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>770</x>
|
||||
<y>30</y>
|
||||
<width>65</width>
|
||||
<height>280</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="SmartSlider" name="sliderOsc1Volume" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>700</x>
|
||||
<y>30</y>
|
||||
<width>65</width>
|
||||
<height>280</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="SmartSlider" name="sliderFilterResonance" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>840</x>
|
||||
<y>30</y>
|
||||
<width>65</width>
|
||||
<height>280</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>690</x>
|
||||
<y>10</y>
|
||||
<width>91</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Volume</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>760</x>
|
||||
<y>10</y>
|
||||
<width>81</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cutoff</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>830</x>
|
||||
<y>10</y>
|
||||
<width>81</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Resonance</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
@@ -270,6 +372,12 @@
|
||||
<header>EnvelopeGenerator/EnvelopeGenerator.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>SmartSlider</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>SmartSlider/SmartSlider.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Scope</class>
|
||||
<extends>QWidget</extends>
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// TODO: package the rogue sliders into the envelopeGenerators with a "base" column (its what the "peak" slider in the esp synth was supposed to be)
|
||||
|
||||
EnvelopeGenerator::EnvelopeGenerator(QWidget* parent) : QWidget(parent), ui_(new Ui::EnvelopeGenerator) {
|
||||
|
||||
ui_->setupUi(this);
|
||||
|
||||
@@ -46,7 +46,7 @@ void Scope::paintEvent(QPaintEvent*) {
|
||||
|
||||
// got caught playing around
|
||||
QPen pen;
|
||||
pen.setWidthF(2.0f);
|
||||
pen.setWidthF(3.0f);
|
||||
QColor green(50, 255, 70);
|
||||
pen.setColor(green);
|
||||
p.setPen(pen);
|
||||
@@ -54,9 +54,9 @@ void Scope::paintEvent(QPaintEvent*) {
|
||||
for (int32_t i = 1; i < samples_.size(); i++) {
|
||||
p.drawLine(
|
||||
(i) * width() / samples_.size(),
|
||||
midY - samples_[i - 1] * scaleY,
|
||||
midY + samples_[i - 1] * scaleY,
|
||||
i * width() / samples_.size(),
|
||||
midY - samples_[i] * scaleY
|
||||
midY + samples_[i] * scaleY
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user