mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
Piano: Make decay more accurate
1. Make decay sample-granular rather than buffer-granular You only have ~43 buffers per second which can make a jagged signal. 2. Calculate decay in milliseconds Decay is supposed to be a time value.
This commit is contained in:
parent
44c81ee9db
commit
421a340572
3 changed files with 21 additions and 12 deletions
|
@ -91,7 +91,7 @@ KnobsWidget::KnobsWidget(GUI::Widget* parent, AudioEngine& audio_engine, MainWid
|
|||
m_wave_value->set_text(wave_strings[new_wave]);
|
||||
};
|
||||
|
||||
constexpr int max_decay = 20;
|
||||
constexpr int max_decay = 1000;
|
||||
m_decay_knob = GUI::Slider::construct(Orientation::Vertical, m_knobs_container);
|
||||
m_decay_knob->set_range(0, max_decay);
|
||||
m_decay_knob->set_value(max_decay - m_audio_engine.decay());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue