]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
better percussion
authorRudolf Polzer <divverent@xonotic.org>
Sun, 25 Sep 2011 17:49:53 +0000 (19:49 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 25 Sep 2011 17:49:53 +0000 (19:49 +0200)
misc/tools/midi2cfg-ng.conf
misc/tools/midi2cfg-ng.pl

index b3c94a44dfaffa0333bdd2c912480c1d9cc27b0b..4d9cc6f6c4fe019fdc57433369a13eb94ff556c8 100644 (file)
@@ -508,7 +508,7 @@ bot uzi
 
 # grenadelauncher = RELOADSOUND RELOADSOUND
 
-# electro = beam BAD
+# electro = beam BADFLYSOUND
 bot electro
        channels 10
        init
@@ -566,6 +566,14 @@ bot crylink
                percussion 34
        percussion 56 # 056_Cow_Bell-0.wav
                percussion 34
+       percussion 67 # 067_Agogo_High-0.wav
+               percussion 34
+       percussion 68 # 068_Agogo_Low-0.wav
+               percussion 45
+       percussion 71 # 071_Whistle_1_High_Short-0.wav
+               percussion 34
+       percussion 72 # 072_Whistle_2_Low_Long-0.wav
+               percussion 45
 
 # nex is nex NONE
 bot nex
@@ -665,6 +673,7 @@ bot hook
                cmd selectweapon 13
                cmd wait 0.5
                raw settemp g_balance_hook_primary_refire 0.3
+               raw settemp g_balance_hook_secondary_refire 0.9
        percussion 62 # 062_Conga_High_1_Mute-0.wav
                time 0
                cmd debug_assert_canfire 1
@@ -676,6 +685,17 @@ bot hook
                busy 0.3
        percussion 63 # 063_Conga_High_2_Open-0.wav
                percussion 62
+       percussion 84 # 084_Belltree-0.wav
+               time 0
+               cmd debug_assert_canfire 1
+               buttons attack2
+               time 0.05
+               cmd debug_assert_canfire 0
+               buttons
+               time 0.1
+               busy 0.9
+       percussion 81 # 081_Triangle_2_Open-0.wav
+               percussion 62
 
 # seeker is BADFLYSOUND tag
 bot seeker
@@ -704,6 +724,10 @@ bot seeker
                percussion 41
        percussion 46 # 046_Hi-Hat_Open-0.wav
                percussion 41
+       percussion 69 # 069_Cabasa-0.wav
+               percussion 41
+       percussion 82 # 069_Shaker-0.wav
+               percussion 41
 
 # rifle is hard soft
 bot rifle
@@ -753,6 +777,20 @@ bot jetpack
        percussion 64 # 064_Conga_Low-0.wav
                percussion 42
 
+bot switcher
+       init
+               time -2
+               cmd aimtarget "tPercussion 1"
+               cmd barrier
+               cmd wait 0.5
+       percussion 29 # not in freepats
+               time 0
+               cmd impulse 10
+               time 0.05
+               busy 0.3
+       percussion 30 # not in freepats
+               percussion 29
+
 bot vocals
        init
                time -2
@@ -921,6 +959,15 @@ bot instance_jetpack
                cmd barrier
                super
 
+bot instance_switcher
+       include switcher
+       include common
+       count 16
+       init
+               cmd movetotarget @places_percussion
+               cmd barrier
+               super
+
 bot instance_vocals
        include vocals
        include common
index 8ed002e27383b66a599a0223001f7cffe3d25808..fad3a4e1028a5ff92d10bfb35da0fb1130dcbd45 100755 (executable)
@@ -750,8 +750,7 @@ sub ConvertMIDI($$)
                if($_->[0] eq 'note_on')
                {
                        my $chan = $_->[4] + 1;
-                       ++$notes_seen{$chan}{($programs{$chan} || 1)}{$_->[5]}
-                               if $chan != 10 and $chan > 0;
+                       ++$notes_seen{$chan}{($programs{$chan} || 1)}{$_->[5]};
                        if($midinotes{$chan}{$_->[5]})
                        {
                                --$notes_stuck;
@@ -789,6 +788,7 @@ sub ConvertMIDI($$)
                my $good = 0;
                for my $channel(sort keys %notes_seen)
                {
+                       next if $channel == 10 or $channel < 0;
                        for my $program(sort keys %{$notes_seen{$channel}})
                        {
                                for my $note(sort keys %{$notes_seen{$channel}{$program}})
@@ -833,6 +833,30 @@ sub ConvertMIDI($$)
                print STDERR "  Transpose $testtranspose: $toohigh too high, $toolow too low, $good good\n";
        }
 
+       for my $program(sort keys %{$notes_seen{10}})
+       {
+               for my $note(sort keys %{$notes_seen{10}{$program}})
+               {
+                       my $cnt = $notes_seen{10}{$program}{$note};
+                       my $votegood = 0;
+                       for(@busybots_allocated)
+                       {
+                               next # I won't play on this channel
+                                       if defined $_->{channels} and not $_->{channels}->{10};
+                               next # I won't play this program
+                                       if defined $_->{programs} and not $_->{programs}->{$program};
+                               if(exists $_->{percussion}{$note})
+                               {
+                                       ++$votegood;
+                               }
+                       }
+                       if(!$votegood)
+                       {
+                               print STDERR "Failed percussion $note ($cnt times)\n";
+                       }
+               }
+       }
+
        while(my ($k1, $v1) = each %midinotes)
        {
                while(my ($k2, $v2) = each %$v1)