From: Rudolf Polzer Date: Wed, 17 Oct 2012 13:46:34 +0000 (+0200) Subject: midichannels: support multiple inputs X-Git-Tag: xonotic-v0.7.0~34^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7fe9e97884efcde522479f8f606fe5556ace3416;p=xonotic%2Fxonotic.git midichannels: support multiple inputs --- diff --git a/misc/tools/midi2cfg/tuba-record.cfg b/misc/tools/midi2cfg/tuba-record.cfg index 6bd27b94..81275e4f 100644 --- a/misc/tools/midi2cfg/tuba-record.cfg +++ b/misc/tools/midi2cfg/tuba-record.cfg @@ -3,9 +3,9 @@ menu_vid_height 720 vid_width 1280 vid_height 720 -cl_capturevideo_framestep 4 +cl_capturevideo_framestep 1 cl_capturevideo_fps 25 -r_motionblur 2 +r_motionblur 0 bind x "toggle cl_capturevideo" exec effects-normal.cfg diff --git a/misc/tools/midichannels.pl b/misc/tools/midichannels.pl index dcc7812b..bcfe6265 100644 --- a/misc/tools/midichannels.pl +++ b/misc/tools/midichannels.pl @@ -5,7 +5,7 @@ use warnings; use MIDI; use MIDI::Opus; -my ($filename) = @ARGV; +my ($filename, @others) = @ARGV; my $opus = MIDI::Opus->new({from_file => $filename}); my %chanpos = ( @@ -42,6 +42,20 @@ sub clean(@) return reltime grep { ($isclean{$_->[0]} // sub { 0; })->(@$_) } abstime @_; } +for(@others) +{ + my $opus2 = MIDI::Opus->new({from_file => $_}); + if($opus2->ticks() != $opus->ticks()) + { + my $tickfactor = $opus->ticks() / $opus2->ticks(); + for($opus2->tracks()) + { + $_->events(reltime map { $_->[1] = int($_->[1] * $tickfactor + 0.5); $_; } abstime $_->events()); + } + } + $opus->tracks($opus->tracks(), $opus2->tracks()); +} + while() { chomp;