From 8a764f86ee9f1129507f4654d07c7a7cb24cc87e Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 26 Oct 2021 23:34:35 +0200 Subject: [PATCH] fix compile with ESP32 2.0.x --- lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h b/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h index 4ac232d14..e786d1662 100644 --- a/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h +++ b/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h @@ -190,6 +190,7 @@ TSFDEF void tsf_channel_set_bank(tsf* f, int channel, int bank); TSFDEF int tsf_channel_set_bank_preset(tsf* f, int channel, int bank, int preset_number); TSFDEF void tsf_channel_set_pan(tsf* f, int channel, float pan); TSFDEF void tsf_channel_set_volume(tsf* f, int channel, float volume); +TSFDEF void tsf_channel_set_volume_to_one(tsf* f, int channel); // solves a Compiler bug!! TODO: refactor after compiler fix!! TSFDEF void tsf_channel_set_pitchwheel(tsf* f, int channel, int pitch_wheel); TSFDEF void tsf_channel_set_pitchrange(tsf* f, int channel, float pitch_range); TSFDEF void tsf_channel_set_tuning(tsf* f, int channel, float tuning); @@ -2054,6 +2055,10 @@ TSFDEF void tsf_channel_sounds_off_all(tsf* f, int channel) tsf_voice_endquick(v, f->outSampleRate); } +TSFDEF void tsf_channel_set_volume_to_one(tsf* f, int channel){ + tsf_channel_set_volume(f, channel, 1.0f); +} + TSFDEF void tsf_channel_midi_control(tsf* f, int channel, int controller, int control_value) { struct tsf_channel* c = tsf_channel_init(f, channel); @@ -2079,7 +2084,7 @@ TSFDEF void tsf_channel_midi_control(tsf* f, int channel, int controller, int co c->midiVolume = c->midiExpression = 16383; c->midiPan = 8192; c->bank = 0; - tsf_channel_set_volume(f, channel, 1.0f); + tsf_channel_set_volume_to_one(f, channel); tsf_channel_set_pan(f, channel, 0.5f); tsf_channel_set_pitchrange(f, channel, 2.0f); return;