From: Rudolf Polzer Date: Tue, 8 Jan 2013 16:35:34 +0000 (+0100) Subject: better stats X-Git-Tag: xonotic-v0.7.0~16 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=86b5ebb976d464c2a011e60cab169e22c632c446;p=xonotic%2Fxonotic.git better stats --- diff --git a/misc/tools/midichannels.pl b/misc/tools/midichannels.pl index cebf7ec9..f86eae4d 100755 --- a/misc/tools/midichannels.pl +++ b/misc/tools/midichannels.pl @@ -250,6 +250,8 @@ while() my %notehash = (); my $t = 0; my $events = 0; + my $min = undef; + my $max = undef; for($tracks->[$_]->events()) { ++$events; @@ -269,6 +271,11 @@ while() $notehash{$_->[2]}{$_->[3]} = $t if $_->[0] eq 'note_on'; $notehash{$_->[2]}{$_->[3]} = undef if $_->[0] eq 'note_off'; $name = $_->[2] if $_->[0] eq 'track_name'; + if($_->[0] eq 'note_on') + { + $min = $_->[3] if !defined $min || $_->[3] < $min; + $max = $_->[3] if !defined $max || $_->[3] > $max; + } } my $channels = join " ", map { sprintf "%s(%s)", $_, join ",", sort { $a <=> $b } keys %{$channels{$_}} } sort { $a <=> $b } keys %channels; my @stuck = (); @@ -283,7 +290,7 @@ while() print " $name" if defined $name; print " (channel $channels)" if $channels ne ""; print " ($events events)" if $events; - print " ($notes notes)" if $notes; + print " ($notes notes [$min-$max])" if $notes; print " (notes @stuck stuck)" if @stuck; print "\n"; }