-// for walking bots:
-// :%s/cc teleport\(totarget\)/move\1/g
-// for teleporting bots:
-// :%s/move\(totarget\)/cc teleport\1/g
-
timeoffset_preinit 2
timeoffset_postinit 2
timeoffset_predone 2
timeoffset_postdone 2
timeoffset_preintermission 2
timeoffset_postintermission 2
+list WAIT_SELECTWEAPON 0.5
+list WAIT_RELOAD 0.5
+list WAIT_AIMTARGET 1
+
time_forgetfulness 3
list places_tuba tUba1 tUba2 tUba3 tUba4 tUba5 tUba6 tUba7 tUba8 tUba9 tUba10 tUba11 tUba12 tUba13 tUba14 tUba15 tUba16 tUba17 tUba18 tUba19 tUba20 tUba21 tUba22 tUba23 tUba24 tUba25 tUba26 tUba27 tUba28 tUba29 tUba30 tUba31 tUba32
list places_nosteps tNoSteps1 tNoSteps2 tNoSteps3 tNoSteps4
raw settemp bot_ai_thinkinterval 0
-raw settemp bot_sound_monopoly 1
+raw settemp g_balance_tuba_attenuation 0.1
+// raw settemp bot_sound_monopoly 1
bot notebot
note on -18
bot tuba
include notebot
channels 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16
- programs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
+ programs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
transpose 48
init
cmd barrier
cmd selectweapon 15
- cmd wait 0.5
- raw settemp g_balance_tuba_attenuation 0.1
+ cmd wait @WAIT_SELECTWEAPON
bot accordeon
include notebot
init
cmd barrier
cmd selectweapon 15
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
+ cmd impulse 20
+ cmd wait @WAIT_RELOAD
+
+bot kleinbottle
+ include notebot
+ channels 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16
+ programs 81 82
+ transpose 48
+ init
+ cmd barrier
+ cmd selectweapon 15
+ cmd wait @WAIT_SELECTWEAPON
+ cmd impulse 20
+ cmd wait @WAIT_RELOAD
cmd impulse 20
- raw settemp g_balance_tuba_attenuation 0.1
+ cmd wait @WAIT_RELOAD
bot tuba_red
include tuba
cmd cc color 221
super
+bot kleinbottle_red
+ include kleinbottle
+ transpose 0
+ init
+ cmd cc color 68
+ super
+
+bot kleinbottle_blue
+ include kleinbottle
+ transpose 3
+ init
+ cmd cc color 221
+ super
+
// laser = lasershot NONE
bot laser
channels 10
init
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 1
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
raw settemp g_balance_laser_primary_refire 0.3
percussion 38 // 038_Snare_1-0.wav
time 0
bot shotgun
channels 10
init
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 2
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
percussion 74 // 074_Guiro_2_Long-0.wav
time -0.4
cmd debug_assert_canfire 1
bot uzi
channels 10
init
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 3
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
raw settemp g_balance_uzi_reload_ammo 0
raw settemp g_balance_uzi_first_refire 0.1
raw settemp g_balance_uzi_sustained_refire 0.1
channels 10
init
time -2
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 6
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
raw settemp g_balance_electro_primary_refire 0.2
percussion 49 // 049_Cymbal_Crash_1-0.wav
time 0
bot crylink
channels 10
init
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 7
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
raw settemp g_balance_crylink_primary_refire 0.3
raw settemp g_balance_crylink_secondary_refire 0.2
percussion 34 // 034_Metronome_Bell-0.wav
bot nex
channels 10
init
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 8
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
raw settemp g_balance_nex_primary_refire 1.25
percussion 52 // 052_Cymbal_Chinese-0.wav
time 0
bot minstanex
channels 10
init
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 12
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
raw settemp g_balance_minstanex_refire 1
percussion 55 // 055_Cymbal_Splash-0.wav
time 0
bot hagar
channels 10
init
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 9
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
raw settemp g_balance_hagar_primary_refire 0.2
percussion 35 // 035_Kick_1-0.wav
time 0
bot rocket
channels 10
init
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 10
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
raw settemp g_balance_rocketlauncher_refire 1.1
percussion 25 // 025_Snare_Roll-0.wav
time 0
channels 10
init
time -2
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 13
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
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
channels 10
init
time -2
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 18
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
raw settemp g_balance_seeker_tag_refire 0.2
percussion 41 // 041_Tom_Low_2-0.wav
time 0
channels 10
init
time -2
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
cmd selectweapon 16
- cmd wait 0.5
+ cmd wait @WAIT_SELECTWEAPON
raw settemp g_balance_rifle_secondary_refire 0.3
// percussion FIXME
// time 0
channels 10
init
time -2
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
raw settemp g_jetpack_attenuation 0.5
- cmd wait 0.5
percussion 42 // 042_Hi-Hat_Closed-0.wav
time 0
buttons hook
channels 10
init
time -2
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
- cmd wait 0.5
percussion 36 // 036_Kick_2-0.wav
time -0.6666666
buttons jump
channels 10
init
time -2
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
- cmd wait 0.5
percussion 65 // 065_Timbale_High-0.wav
time -0.6666666
buttons jump
channels 10
init
time -2
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
- cmd wait 0.5
percussion 29 // not in freepats
time 0
cmd impulse 10
percussion 29
bot vocals
- channels -1
init
time -2
- cmd aimtarget tPercussion 1
+ cmd aimtarget tPercussion @WAIT_AIMTARGET
cmd barrier
- cmd wait 0.5
- vocals
+ text vocals
time 0
cmd sound %s
buttons left
count 16
init
cmd cc teleporttotarget @places_tuba
+ // cmd movetotarget @places_tuba
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_tuba
+ // cmd movetotarget @places_tuba
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_tuba
+ // cmd movetotarget @places_tuba
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_tuba
+ // cmd movetotarget @places_tuba
+ cmd barrier
+ super
+
+bot instance_kleinbottle_red
+ include kleinbottle_red
+ include common
+ count 16
+ init
+ cmd cc teleporttotarget @places_tuba
+ // cmd movetotarget @places_tuba
+ cmd barrier
+ super
+
+bot instance_kleinbottle_blue
+ include kleinbottle_blue
+ include common
+ count 16
+ init
+ cmd cc teleporttotarget @places_tuba
+ // cmd movetotarget @places_tuba
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_nosteps
+ // cmd movetotarget @places_nosteps
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_metalsteps
+ // cmd movetotarget @places_metalsteps
cmd barrier
super
count 16
init
cmd cc teleporttotarget @places_percussion
+ // cmd movetotarget @places_percussion
cmd barrier
super
init
cmd cc playermodel models/player/suiseiseki.zym
cmd cc teleporttotarget @places_vocals
+ // cmd movetotarget @places_vocals
cmd barrier
super
// TODO jumping?
+
use constant MIDI_FIRST_NONCHANNEL => 17;
use constant MIDI_DRUMS_CHANNEL => 10;
+use constant TEXT_EVENT_CHANNEL => -1;
die "Usage: $0 filename.conf midifile1 transpose1 midifile2 transpose2 ..."
unless @ARGV > 1 and @ARGV % 2;
$super = $currentbot->{percussion}->{$1};
$currentbot->{percussion}->{$1} = $appendref = [];
}
- elsif(/^vocals$/)
+ elsif(/^text (.*)$/)
{
- $super = $currentbot->{vocals};
- $currentbot->{vocals} = $appendref = [];
+ $super = $currentbot->{text}->{$1};
+ $currentbot->{text}->{$1} = $appendref = [];
}
else
{
- print "unknown command: $_\n";
+ print STDERR "unknown command: $_\n";
}
}
elsif(/^bot (.*)/)
}
else
{
- print "unknown command: $_\n";
+ print STDERR "unknown command: $_\n";
}
}
{
my ($bot, $time, $channel, $note) = @_;
#print STDERR "note off $bot:$time:$channel:$note\n";
+ return 1
+ if not $bot->{busy};
my ($busychannel, $busynote, $cmds) = @{$bot->{busy}};
return 1
if not defined $cmds; # note off cannot fail
{
my ($bot, $channel, $note) = @_;
my ($k0, $k1, $cmds, $cmds_off) = (undef, undef, undef, undef);
- if($channel <= 0)
+ if($channel == TEXT_EVENT_CHANNEL)
{
# vocals
- $cmds = $bot->{vocals};
+ $note =~ /^([^:]*):(.*)$/;
+ my $name = $1;
+ my $data = $2;
+ $cmds = $bot->{text}->{$name};
if(defined $cmds)
{
- $cmds = [ map { [ map { $_ eq '%s' ? $note : $_ } @$_ ] } @$cmds ];
+ $cmds = [ map { [ map { $_ eq '%s' ? $data : $_ } @$_ ] } @$cmds ];
}
- $k0 = "vocals";
- $k1 = $channel;
+ $k0 = "text";
+ $k1 = $name;
}
elsif($channel == 10)
{
sub busybot_note_on_bot($$$$$$$)
{
my ($bot, $time, $channel, $program, $note, $init, $force) = @_;
+
return -1 # I won't play on this channel
if defined $bot->{channels} and not $bot->{channels}->{$channel};
return -1 # I won't play this program
if not busybot_cmd_bot_test $bot, $time + $notetime, $force, @$cmds;
busybot_cmd_bot_execute $bot, $time + $notetime, @$cmds;
}
- if(defined $cmds and defined $cmds_off)
+ if(defined $cmds_off)
{
$bot->{busy} = [$channel, $note, $cmds_off];
}
# print STDERR "note off $time:$channel:$note\n";
- return 0
- if $channel <= 0;
- return 0
- if $channel == 10;
-
if(my $bot = $notechannelbots{$channel}{$note})
{
busybot_note_off_bot $bot, $time, $channel, $note;
if($notechannelbots{$channel}{$note})
{
+ print STDERR "THIS SHOULD NEVER HAPPEN\n";
busybot_note_off $time, $channel, $note;
}
my ($command, $delta, @data) = @$_;
$command = 'note_off' if $command eq 'note_on' and $data[2] == 0;
$tick += $delta;
+ next
+ if $command eq 'text_event' && $data[0] !~ /:/;
push @allmidievents, [$command, $tick, $sequence++, $track, @data];
}
}
}
else
{
- push @allmidievents, ['note_on', $tick * $scale + $shift, $sequence++, -1, -1, $file];
- push @allmidievents, ['note_off', $tick * $scale + $shift, $sequence++, -1, -1, $file];
+ push @allmidievents, ['text_event', $tick * $scale + $shift, $sequence++, -1, "vocals:$file"];
}
}
}
+ # HACK for broken rosegarden export: put patch changes first by clearing their sequence number
+ for(@allmidievents)
+ {
+ if($_->[0] eq 'patch_change')
+ {
+ $_->[2] = -1;
+ }
+ }
+
# sort events
@allmidievents = sort { $a->[1] <=> $b->[1] or $a->[2] <=> $b->[2] } @allmidievents;
# find the first interesting event
- my $shift = [grep { $_->[0] eq 'note_on' } @allmidievents]->[0][1];
+ my $shift = [grep { $_->[0] eq 'note_on' || $_->[0] eq 'text_event' } @allmidievents]->[0][1];
die "No notes!"
unless defined $shift;
$midinotes{$chan}{$ev->[5]} = 0;
};
+ my $text_event = sub
+ {
+ my ($ev) = @_;
+
+ my $chan = TEXT_EVENT_CHANNEL;
+
+ busybot_note_on($t, TEXT_EVENT_CHANNEL, -1, $ev->[4]);
+ busybot_note_off($t, TEXT_EVENT_CHANNEL, $ev->[4]);
+ };
+
my $patch_change = sub
{
my ($ev) = @_;
{
$note_off->($_);
}
+ elsif($_->[0] eq 'text_event')
+ {
+ $text_event->($_);
+ }
elsif($_->[0] eq 'patch_change')
{
$patch_change->($_);
my $good = 0;
for my $channel(sort keys %notes_seen)
{
- next if $channel == 10 or $channel < 0;
+ next if $channel == 10;
for my $program(sort keys %{$notes_seen{$channel}})
{
for my $note(sort keys %{$notes_seen{$channel}{$program}})
print STDERR "$counthash{$cn} bots of $cn have played:\n";
for my $type(sort keys %{$notehash{$cn}})
{
- for my $note(sort { $a <=> $b } keys %{$notehash{$cn}{$type}})
+ for my $note(sort keys %{$notehash{$cn}{$type}})
{
my $cnt = $notehash{$cn}{$type}{$note};
print STDERR " $type $note ($cnt times)\n";
my @preallocate_new = map { $_->{classname} } @busybots_allocated;
if(@preallocate_new == @preallocate)
{
- print "sv_cmd bot_cmd reset\n";
print "sv_cmd bot_cmd setbots @{[scalar @preallocate_new]}\n";
print "$precommands$commands";
exit 0;