From db04cc7925a9fef08c0b2f92f90c5c3112bb73b6 Mon Sep 17 00:00:00 2001 From: tmyqlfpir <80724828+tmyqlfpir@users.noreply.github.com> Date: Sun, 10 Mar 2024 09:52:42 +1000 Subject: [PATCH] TSFLib: Convert attenuation from centibels to decibels Incorporates this upstream PR which has yet to be merged. https://github.com/schellingb/TinySoundFont/pull/85 --- source/audiolib/src/tsf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/audiolib/src/tsf.h b/source/audiolib/src/tsf.h index b53976d83..0fd263a73 100644 --- a/source/audiolib/src/tsf.h +++ b/source/audiolib/src/tsf.h @@ -1543,7 +1543,7 @@ TSFDEF int tsf_note_on(tsf* f, int preset_index, int key, float vel) voice->playingPreset = preset_index; voice->playingKey = key; voice->playIndex = voicePlayIndex; - voice->noteGainDB = f->globalGainDB - region->attenuation - tsf_gainToDecibels(1.0f / vel); + voice->noteGainDB = f->globalGainDB - (region->attenuation / 10.0f) - tsf_gainToDecibels(1.0f / vel); if (f->channels) {