4 # gigdump2ahs.pl - Creates a .ahs instr. definition script from gigdump's output
6 # Copyright (C) 2005 Angel Ortega <angel@triptico.com>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 # http://www.triptico.com
40 if(my ($sample, $start, $end) =
41 (/"([^"]+)".*Start=(\d+), End=(\d+),/))
45 $i->{sample
} = $sample;
46 $i->{filename
} = "${num}_${sample}.wav";
58 elsif(my ($sample) = (/^\s+Sample \d+\) "(.+)"/))
62 $i->{sample
} = $sample;
63 $i->{filename
} = "${num}_${sample}.wav";
73 elsif(/^\s+Region \d+\) Sample: "(.+)"/)
77 elsif(/^\s+KeyRange=(\d+)-(\d+)/)
79 $ins{$last_seen}->{min
} = $1 + $offset;
80 $ins{$last_seen}->{max
} = $2 + $offset;
82 # set base as min if it's not looped, as they
83 # seem to have always 60
84 $ins{$last_seen}->{base
} = $ins{$last_seen}->{min
}
85 unless $ins{$last_seen}->{start
};
87 elsif(/^\s+Sample: "$last_seen",.*UnityNote=(\d+)/)
89 # set only if wave is looped
90 if($ins{$last_seen}->{start
})
92 $ins{$last_seen}->{base
} = $1 + $offset;
98 print "/* converted by gigdump2ahs.pl $VERSION */\n\n";
103 print "{ wav \"$i->{filename}\" $i->{base} $i->{min} $i->{max} $i->{start} $i->{end} }\n";