mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +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
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…
Add table
Add a link
Reference in a new issue