From 4ba4a584242aff4b60f922162a4cc8e4dc518618 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 27 Sep 2011 11:05:06 +0200 Subject: [PATCH] stay more on the same bot with a channel --- misc/tools/midi2cfg-ng.pl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/misc/tools/midi2cfg-ng.pl b/misc/tools/midi2cfg-ng.pl index 1111f468..52dbd3a9 100755 --- a/misc/tools/midi2cfg-ng.pl +++ b/misc/tools/midi2cfg-ng.pl @@ -473,10 +473,19 @@ sub busybot_note_on_bot($$$$$$$) } ++$bot->{seen}{$k0}{$k1}; + if($bot->{lastuse} && $channel == $bot->{lastchannel}) + { + $bot->{lastchannelsequence} += 1; + } + else + { + $bot->{lastchannelsequence} = 1; + } $bot->{lastuse} = $time; $bot->{lastchannel} = $channel; - $bot->{lastprogram} = $program; - $bot->{lastnote} = $note; + +# print STDERR "$time $bot->{id} $channel:$note\n" +# if $channel == 11; return 1; } @@ -534,15 +543,7 @@ sub botsort($$$$@) { if($channel == $_->{lastchannel}) { - ++$q; - if($program == $_->{lastprogram}) - { - ++$q; - if($note == $_->{lastnote}) - { - ++$q; - } - } + $q += $_->{lastchannelsequence}; } else { -- 2.39.2