mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 17:19:13 +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
Notes:
sideshowbarker
2024-07-19 09:39:49 +09:00
Author: https://github.com/willmcpherson2
Commit: 421a340572
Pull-request: https://github.com/SerenityOS/serenity/pull/1178
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