print "#!bin/bash\n\n#Generated by tab2beep.pl by Axioplase\n#Under GNU\/GPL\n#Author is not responsible in anyway to damage caused or not to your good
s by this software\n\n";
while (chomp ($foo=)) {
$foo=~s/\s//g;
if (""ne$foo){
($thisfreq,$thislength,$thistune)=split /:/,$foo;
$thisfreq=$gamme{"$thisfreq"};
$thisfreq*=$thistune;
print "beep -f $thisfreq -l $duree{$thislength}\n";
}
}
----snip-----
tiens, j ai oublié les dieses/bémols :/
qq1 me fait une interface GTK ? (si on gere bien les slides/bends/témolos, y a de quoi faire une petite concurence au format midi et powertab/guitar pro :)
mais pour le piano, ca va!
[^] # Re: Lovestory en bash
Posté par Axioplase ıɥs∀ (site web personnel) . En réponse au journal Scripts cools. Évalué à 2.
die "Usage: cat source.msc | 0ドル > output_file" if ($#ARGV!=-1);
chomp($_=);
$rythme= 6000/$_; # c est pas des BPM mais bon :)
%gamme=(
"do"=>132,
"re"=>148.5,
"mi"=>165,
"fa"=>176,
"sol"=>198,
"la"=>220,
"si"=>247.5,
"silence"=>1,
);
%duree=(
"d"=>$rythme /4,
"c"=>$rythme /2,
"cp"=>$rythme *2/3,
"n"=>$rythme,
"np"=>$rythme*1.5,
"b"=>$rythme*2,
"bp"=>$rythme*3,
"r"=>$rythme*4,
);
print "#!bin/bash\n\n#Generated by tab2beep.pl by Axioplase\n#Under GNU\/GPL\n#Author is not responsible in anyway to damage caused or not to your good
s by this software\n\n";
while (chomp ($foo=)) {
$foo=~s/\s//g;
if (""ne$foo){
($thisfreq,$thislength,$thistune)=split /:/,$foo;
$thisfreq=$gamme{"$thisfreq"};
$thisfreq*=$thistune;
print "beep -f $thisfreq -l $duree{$thislength}\n";
}
}
---- fichier de test ---
60
la:c:1
do:c:2
mi:c:2
la:c:2
do:c:3
mi:c:3
la:c:3
do:c:4
la:c:3
mi:c:3
do:c:3
la:c:2
mi:c:2
do:c:2
do:c:2
mi:c:2
la:c:2
do:c:3
mi:c:3
la:c:3
do:c:4
mi:c:4
do:c:4
la:c:3
mi:c:3
do:c:3
la:c:2
mi:c:2
do:c:2
la:c:1
----snip-----
tiens, j ai oublié les dieses/bémols :/
qq1 me fait une interface GTK ? (si on gere bien les slides/bends/témolos, y a de quoi faire une petite concurence au format midi et powertab/guitar pro :)
mais pour le piano, ca va!