From 1461b257ccc6ab7976f8bcf4178b4101af8c809a Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Thu, 10 Apr 2025 04:51:11 +0300 Subject: adlmidi_opl3: Fixed the dead loop when tone comes lower than zero --- src/adlmidi_opl3.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/adlmidi_opl3.cpp') diff --git a/src/adlmidi_opl3.cpp b/src/adlmidi_opl3.cpp index be84203..5690721 100644 --- a/src/adlmidi_opl3.cpp +++ b/src/adlmidi_opl3.cpp @@ -1058,6 +1058,9 @@ void OPL3::noteOn(size_t c1, size_t c2, double tone) // Hertz range: 0..131071 double hertz; + if(tone < 0.0) + tone = 0.0; // Lower than 0 is impossible! + // Use different frequency formulas in depend on a volume model switch(m_volumeScale) { -- cgit v1.2.3