Skip to content

Commit

Permalink
TSFLib: Convert attenuation from centibels to decibels
Browse files Browse the repository at this point in the history
Incorporates this upstream PR which has yet to be merged.

schellingb/TinySoundFont#85
  • Loading branch information
tmyqlfpir authored and dibollinger committed Apr 6, 2024
1 parent 3c35739 commit e464145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/audiolib/src/tsf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit e464145

Please sign in to comment.