-
Notifications
You must be signed in to change notification settings - Fork 5
/
generatingambdecpreset.pl
59 lines (46 loc) · 1.12 KB
/
generatingambdecpreset.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
# header
#
# you need 3 files:
# a header
# the lf matrix coefficients file (passed as parameter of the script)
# the hf matrix coefficients file (passed as parameter of the script)
use strict;
use warnings;
open(INPUTFILE, "<header.studio.ambdec");
open(OUTPUTFILE, ">studio.out");
while(<INPUTFILE>)
{
my($line) = $_;
chomp($line);
print OUTPUTFILE "$line\n";
}
close(INPUTFILE);
# low frequency
print OUTPUTFILE "/lfmatrix/{ \n";
print OUTPUTFILE "order_gain 1.00000 1.00000 1.00000 1.00000 \n";
my $file_name = shift @ARGV;
open(my $file, '<', $file_name) or die $!;
while(<$file>)
{
my($line) = $_;
chomp($line);
print OUTPUTFILE "add_row $line\n";
}
close($file);
print OUTPUTFILE "/} \n \n";
## high frequency
print OUTPUTFILE "/hfmatrix/{ \n";
print OUTPUTFILE "order_gain 2.05000 1.80000 1.06250 0.15000 \n";
my $file_name = shift @ARGV;
open(my $file, '<', $file_name) or die $!;
while(<$file>)
{
my($line) = $_;
chomp($line);
print OUTPUTFILE "add_row $line\n";
}
close($file);
print OUTPUTFILE "/} \n";
print OUTPUTFILE "\n \n";
print OUTPUTFILE "/end";
close(OUTPUTFILE);