mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
Piano: Remove phony multiple same note playback
I say "phony" because it's not actually playing the same frequency twice, it's just playing the same frequency at a higher volume. We can properly implement this later but at the moment it'll get in the way of our ADSR implementation.
This commit is contained in:
parent
f909095981
commit
44c81ee9db
Notes:
sideshowbarker
2024-07-19 09:39:55 +09:00
Author: https://github.com/willmcpherson2 Commit: https://github.com/SerenityOS/serenity/commit/44c81ee9db4 Pull-request: https://github.com/SerenityOS/serenity/pull/1178
1 changed files with 2 additions and 3 deletions
|
@ -153,13 +153,12 @@ void AudioEngine::set_note(int note, Switch switch_note)
|
|||
if (switch_note == On) {
|
||||
if (m_note_on[note] == 0) {
|
||||
m_pos[note] = 0;
|
||||
m_power[note] = 0;
|
||||
m_power[note] = 1;
|
||||
}
|
||||
++m_power[note];
|
||||
++m_note_on[note];
|
||||
} else {
|
||||
if (m_note_on[note] >= 1) {
|
||||
if (--m_power[note] < 0)
|
||||
if (m_note_on[note] == 1)
|
||||
m_power[note] = 0;
|
||||
--m_note_on[note];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue