& beforetext &>
The Tunes:
Pick your key and click on a format.
More tunes may follow as I get the time to enter them, someday.
<& aftertext &>
%#That's the end of the HTML, everything else is Perl.
%# *********************************************
%# shared
%# *********************************************
<%shared>
my %keypos = (
'A,,' => 0, 'A,' => 12, 'A' => 24,
'A#,,'=> 1, 'A#,'=> 13, 'A#' => 25,
'Bb,,'=> 1, 'Bb,'=> 13, 'Bb' => 25,
'B,,' => 2, 'B,' => 14, 'B' => 26,
'C,' => 3, 'C' => 15, 'c' => 27,
'C#,' => 4, 'C#' => 16, 'c#' => 28,
'Db,' => 4, 'Db' => 16, 'db' => 28,
'D,' => 5, 'D' => 17, 'd' => 29,
'D#,' => 6, 'D#' => 18, 'd#' => 30,
'Eb,' => 6, 'Eb' => 18, 'eb' => 30,
'E,' => 7, 'E' => 19, 'e' => 31,
'F,' => 8, 'F' => 20, 'f' => 32,
'F#,' => 9, 'F#' => 21, 'f#' => 33,
'Gb,' => 9, 'Gb' => 21, 'gb' => 33,
'G,' => 10, 'G' => 22, 'g' => 34,
'G#,' => 11, 'G#' => 23, 'g#' => 35,
'Ab,' => 11, 'Ab' => 23, 'ab' => 36,
);
my %keys_at_pos;
foreach my $key (keys %keypos){
unshift @{$keys_at_pos{$keypos{$key}}}, $key;
}
%shared>
%# *********************************************
%# end shared
%# *********************************************
%# *********************************************
%# dorow METHOD
%# *********************************************
<%method dorow>
<%args>
$id
$key
$title
$notes=>''
%args>
<%init>
my $basedir = $r->dir_config('basedir');
my $conf = $m->comp("/$basedir/config");
%init>
<%$title%>:
%foreach my $o (@{$conf->{outputs}}){
% my ($display_name, $out_type, $ext) = @$o;
% my $base = "$out_type/$id.$ext?key=$key";
<%$display_name%>
%}
<& "/$basedir/index.html:keyselect", key => $key, id=>$id &>
|
<%$notes%> |
%method>
%# *********************************************
%# end dorow
%# *********************************************
%# *********************************************
%# keyselect METHOD
%# *********************************************
<%method keyselect>
<%args>
$key
$id
%args>
%method>
%# *********************************************
%# end keyselect
%# *********************************************