From 5054b257010f76a0a91cfa4d01d5f315daa6558a Mon Sep 17 00:00:00 2001 From: sshlien Date: Fri, 7 Feb 2025 13:41:40 -0500 Subject: [PATCH] 2025.02.07 --- midi2abc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/midi2abc.c b/midi2abc.c index 3d51f2e..8628dff 100644 --- a/midi2abc.c +++ b/midi2abc.c @@ -1002,7 +1002,7 @@ int chan, pitch, vol; int start_time,initvol; int cents,centvalue,pitchbend; int newpitchint; -float newpitch; +float newpitch,fcents; start_time = close_note(chan, pitch, &initvol); if (start_time <= 0) return; @@ -1015,7 +1015,8 @@ if (sysexBentPitches[pitch] >0.0) { } else {pitchbend = chanbend[chan+1]; - cents = (pitchbend - 8192)/200; + fcents = 100.0 * (float) (pitchbend - 8192)/4096.0; + cents = (int) (fcents + 0.5); if (cents < 0) { pitch--; cents +-100;