From 310795d8aba8ae709e7ff59d179add3664395282 Mon Sep 17 00:00:00 2001 From: spazzylemons <25674682+spazzylemons@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:10:24 -0500 Subject: [PATCH] Convert attenuation from centibels to decibels --- tsf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsf.h b/tsf.h index a2d59fc..471621a 100644 --- a/tsf.h +++ b/tsf.h @@ -1610,7 +1610,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) {