Skip to content

Commit

Permalink
Merge pull request #527 from ceski-1/midi_volume
Browse files Browse the repository at this point in the history
Midi volume fixes
  • Loading branch information
kraflab authored Nov 1, 2024
2 parents 6622d89 + 121c56e commit 687b10b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions prboom2/src/MUSIC/flplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ static void fl_render (void *vdest, unsigned length)
{
fluid_synth_cc (f_syn, i, 123, 0); // ALL NOTES OFF
fluid_synth_cc (f_syn, i, 121, 0); // RESET ALL CONTROLLERS
fluid_synth_cc (f_syn, i, 7, 100); // reset volume
}
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions prboom2/src/MUSIC/portmidiplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const music_player_t pm_player =

#else // HAVE_LIBPORTMIDI

#include <math.h>
#include <portmidi.h>
#include <porttime.h>
#include <stdio.h>
Expand Down Expand Up @@ -394,7 +393,7 @@ static void pm_setvolume (int v)
return;

pm_volume = v;
volume_scale = sqrtf((float)pm_volume / 15);
volume_scale = pm_volume / 15.0f;
update_volume();
}

Expand Down Expand Up @@ -651,6 +650,7 @@ static void pm_render (void *vdest, unsigned bufflen)
{
writeevent (when, 0xB0, i, 0x7B, 0x00); // all notes off
writeevent (when, 0xB0, i, 0x79, 0x00); // reset all controllers
write_volume (when, i, DEFAULT_VOLUME); // reset volume
}
continue;
}
Expand Down

0 comments on commit 687b10b

Please sign in to comment.