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:
William McPherson 2020-02-05 01:18:25 +11:00 committed by Andreas Kling
parent f909095981
commit 44c81ee9db
Notes: sideshowbarker 2024-07-19 09:39:55 +09:00

View file

@ -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];
}