X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=misc%2Ftools%2Fmidi2cfg-ng.pl;h=ad06b746807b931b671d7a59cd148cb38f0cd8dc;hb=075250227575af7127abb3f885a6b0bf60b51d8f;hp=52dbd3a98636fb7f0d5fea2bc8a235b63e8884e0;hpb=4ba4a584242aff4b60f922162a4cc8e4dc518618;p=xonotic%2Fxonotic.git diff --git a/misc/tools/midi2cfg-ng.pl b/misc/tools/midi2cfg-ng.pl index 52dbd3a9..ad06b746 100755 --- a/misc/tools/midi2cfg-ng.pl +++ b/misc/tools/midi2cfg-ng.pl @@ -473,7 +473,7 @@ sub busybot_note_on_bot($$$$$$$) } ++$bot->{seen}{$k0}{$k1}; - if($bot->{lastuse} && $channel == $bot->{lastchannel}) + if(($bot->{lastuse} // -666) >= $time - $time_forgetfulness && $channel == $bot->{lastchannel}) { $bot->{lastchannelsequence} += 1; } @@ -539,16 +539,19 @@ sub botsort($$$$@) map { my $q = 0; - if(($_->{lastuse} // -666) >= $time - $time_forgetfulness) + if($channel != 10) # percussion just should do round robin { - if($channel == $_->{lastchannel}) + if(($_->{lastuse} // -666) >= $time - $time_forgetfulness) { - $q += $_->{lastchannelsequence}; - } - else - { - # better leave this one alone - --$q; + if($channel == $_->{lastchannel}) + { + $q += $_->{lastchannelsequence}; + } + else + { + # better leave this one alone + $q -= $_->{lastchannelsequence}; + } } } [$_, $q, rand] @@ -854,7 +857,7 @@ sub ConvertMIDI($$) my $votehigh = 0; my $votelow = 0; my $votegood = 0; - for(@busybots_allocated) + for(@busybots_allocated, grep { $_->{count} > 0 } values %$busybots) { next # I won't play on this channel if defined $_->{channels} and not $_->{channels}->{$channel};