From 08fc9267bbef1bd1cae69b8e740e2c0d0cf4b7be Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 27 Sep 2011 10:50:54 +0200 Subject: [PATCH] fixes --- misc/tools/midi2cfg-ng.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/misc/tools/midi2cfg-ng.pl b/misc/tools/midi2cfg-ng.pl index ea1b1e6d..1111f468 100755 --- a/misc/tools/midi2cfg-ng.pl +++ b/misc/tools/midi2cfg-ng.pl @@ -521,7 +521,7 @@ sub botsort($$$$@) } sort { - $a->[1] <=> $b->[1] + $b->[1] <=> $a->[1] or ($a->[0]->{lastuse} // -666) <=> ($b->[0]->{lastuse} // -666) or @@ -544,6 +544,11 @@ sub botsort($$$$@) } } } + else + { + # better leave this one alone + --$q; + } } [$_, $q, rand] } @@ -805,7 +810,7 @@ sub ConvertMIDI($$) if($midinotes{$chan}{$_->[5]}) { --$notes_stuck; - busybot_note_off($t - SYS_TICRATE, $chan, $_->[5]); + busybot_note_off($t - SYS_TICRATE - 0.001, $chan, $_->[5]); } busybot_note_on($t, $chan, $programs{$chan} || 1, $_->[5]); ++$notes_stuck; @@ -817,7 +822,7 @@ sub ConvertMIDI($$) if($midinotes{$chan}{$_->[5]}) { --$notes_stuck; - busybot_note_off($t - SYS_TICRATE, $chan, $_->[5]); + busybot_note_off($t - SYS_TICRATE - 0.001, $chan, $_->[5]); } $midinotes{$chan}{$_->[5]} = 0; } -- 2.39.2