diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-13 20:54:16 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-13 20:54:16 +0200 |
commit | ec7b98f07984f492e4a3c567bad4d05ff02499ca (patch) | |
tree | 4a7d4eb3df2725716d5599b495c9ed7f18128ecd | |
parent | 02c3c737f66fd9f737d46df560abd46d6fd3e6cd (diff) | |
download | serenity-ec7b98f07984f492e4a3c567bad4d05ff02499ca.zip |
Piano: Take down the baseline "volume" from 3000 to 1800.
I have no idea what a good value for this would be. This seems to do better
when playing many notes at once.
-rw-r--r-- | Applications/Piano/PianoWidget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Applications/Piano/PianoWidget.cpp b/Applications/Piano/PianoWidget.cpp index 7b8084a2db..de3b394ef7 100644 --- a/Applications/Piano/PianoWidget.cpp +++ b/Applications/Piano/PianoWidget.cpp @@ -58,17 +58,17 @@ void PianoWidget::fill_audio_buffer(uint8_t* stream, int len) auto* sst = (Sample*)stream; for (int i = 0; i < m_sample_count; ++i) { - static const double VOLUME = 3000; + static const double volume = 1800; for (size_t n = 0; n < (sizeof(m_note_on) / sizeof(bool)); ++n) { if (!m_note_on[n]) continue; double val = 0; if (m_wave_type == WaveType::Sine) - val = ((VOLUME * m_power[n]) * w_sine(n)); + val = ((volume * m_power[n]) * w_sine(n)); else if (m_wave_type == WaveType::Saw) - val = ((VOLUME * m_power[n]) * w_saw(n)); + val = ((volume * m_power[n]) * w_saw(n)); else if (m_wave_type == WaveType::Square) - val = ((VOLUME * m_power[n]) * w_square(n)); + val = ((volume * m_power[n]) * w_square(n)); if (sst[i].left == 0) sst[i].left = val; else |