Skip to content

Commit

Permalink
fix(DmSynth): incorrect integer division in `DmSynth_assignInstrument…
Browse files Browse the repository at this point in the history
…Channels`

This patch changes an integer division in `DmSynth_assignInstrumentChannels` to a float division to prevent precision loss.
  • Loading branch information
lmichaelis committed Sep 22, 2024
1 parent 7b44736 commit f5f8a1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static DmResult DmSynth_assignInstrumentChannels(DmSynth* slf, DmBand* band) {
}

if (ins->options & DmInstrument_VALID_VOLUME) {
float vol = (float) ins->volume / DmInt_MIDI_MAX;
float vol = (float) ins->volume / (float) DmInt_MIDI_MAX;
tsf_channel_set_volume(fnt->syn, (int) ins->channel, vol);
chan->reset_volume = vol;
}
Expand Down

0 comments on commit f5f8a1d

Please sign in to comment.