1 |
<? |
2 |
#!/usr/bin/php |
3 |
#--------------------------------------------------------------------------- |
4 |
# chord2html.php - A PHP script to convert CHORD input files to HTML |
5 |
# Copyright (C) 2002 Andreas Motl <andreas.motl@ilo.de> |
6 |
# |
7 |
# idea to port it to php and integrate with phpWiki: |
8 |
# Copyright (C) 2002 Christoph Drieschner <christoph.drieschner@texorama.de> |
9 |
# |
10 |
# original perl version (chord2html.pl): |
11 |
# Copyright (C) 1998,2002 Claudio Matsuoka <claudio@helllabs.org> |
12 |
# with contributions from: |
13 |
# Per Egil Kummervold <peregil@abex.no> and Erwin Burgstaller <i@wuell.net> |
14 |
# |
15 |
# This program is free software; you can redistribute it and/or modify |
16 |
# it under the terms of the GNU General Public License as published by |
17 |
# the Free Software Foundation; either version 2 of the License, or |
18 |
# (at your option) any later version. |
19 |
# |
20 |
# This program is distributed in the hope that it will be useful, |
21 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
22 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23 |
# GNU General Public License for more details. |
24 |
# |
25 |
# You should have received a copy of the GNU General Public License |
26 |
# along with this program; if not, write to the Free Software |
27 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
28 |
#--------------------------------------------------------------------------- |
29 |
|
30 |
// pre-set some of the formerly expected options ... |
31 |
$opt_d = "img"; |
32 |
// ... and introduce some new ones |
33 |
$opt_i = $input; |
34 |
$opt_i = "itgwo.chopro"; |
35 |
$opt_v = 1; |
36 |
$opt_t = 1; |
37 |
$opt_s = "chord2html.css"; |
38 |
$opt_T = "png"; |
39 |
|
40 |
//use GD; |
41 |
//use Getopt::Std; |
42 |
|
43 |
//getopts ('d:hlno:qs:T:tVv'); |
44 |
|
45 |
// Defaults |
46 |
// gnu date formats its date this way (by default): "Fri Oct 25 08:50:55 CEST 2002" |
47 |
$date = date("D M d H:m:s T Y"); |
48 |
$version = "0.1"; |
49 |
$bg_color = "white"; |
50 |
$format = "png"; |
51 |
$color = "color=\"blue\""; |
52 |
$style = $opt_s; |
53 |
//$me = $0; |
54 |
|
55 |
//$opt_q && ($opt_v = 0); |
56 |
|
57 |
//if ($opt_V) { |
58 |
print "chord2html.php $version<br>\n"; |
59 |
//exit; |
60 |
//} |
61 |
|
62 |
/* |
63 |
if ($opt_h) { |
64 |
print STDERR <<EOF; |
65 |
chord2html $version |
66 |
Copyright (C) 1998,2002 Claudio Matsuoka <claudio\@helllabs.org>, |
67 |
(C) 2002 Per Egil Kummervold <peregil\@abex.no>, (C) 2002 Erwin |
68 |
Burgstaller <ber\@aon.at> |
69 |
|
70 |
Usage: $me [options] input_file |
71 |
Options: |
72 |
-d dirname Create images in the given directory (default is current) |
73 |
-h Print a summary of the command line options |
74 |
-l Print lyrics only |
75 |
-n Don\'t overwrite chord images that already exist |
76 |
-o name Write output to file (default is stdout) |
77 |
-q Quiet mode (turn off warnings) |
78 |
-s filename Style sheet name (default is $style) |
79 |
-T format Image format for generated chord grids (default is $format) |
80 |
-t Add timestamp at the end of the generated page |
81 |
-V Print version number |
82 |
-v Verbose mode |
83 |
|
84 |
This program is free software; you can redistribute it and/or modify it |
85 |
under the terms of the GNU General Public License as published by the |
86 |
Free Software Foundation; either version 2 of the License, or (at your |
87 |
option) any later version. |
88 |
|
89 |
This program is distributed in the hope that it will be useful, but |
90 |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
91 |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
92 |
for more details. |
93 |
EOF |
94 |
exit 0; |
95 |
} |
96 |
*/ |
97 |
|
98 |
//$opt_o && (open (STDOUT, ">$opt_o") || die "$me: Can't create $opt_o\n"); |
99 |
|
100 |
if ($opt_d) { |
101 |
/* |
102 |
if (opendir TESTDIR, $opt_d) { |
103 |
closedir TESTDIR; |
104 |
} else { |
105 |
mkdir ($opt_d, 0755) || die "$me: Can't create directory $opt_d\n"; |
106 |
} |
107 |
*/ |
108 |
if (!preg_match('/\/$/', $opt_d)) { $opt_d .= "/"; } |
109 |
} |
110 |
|
111 |
function m($pattern, &$matches) { |
112 |
global $line; |
113 |
if (preg_match($pattern, $line, $matches)) { |
114 |
return 1; |
115 |
} |
116 |
} |
117 |
|
118 |
function mg($pattern, &$matches) { |
119 |
global $line; |
120 |
if (preg_match_all($pattern, $line, $matches)) { |
121 |
return 1; |
122 |
} |
123 |
} |
124 |
|
125 |
function r($pattern, $replacement) { |
126 |
global $line; |
127 |
if ($line = preg_replace($pattern, $replacement, $line)) { |
128 |
return 1; |
129 |
} |
130 |
} |
131 |
|
132 |
function logp($logstring) { |
133 |
global $opt_v, $log; |
134 |
if (!$opt_v) return; |
135 |
$log .= " =>" . $logstring . "\n"; |
136 |
//print $logstring . "<br>"; |
137 |
} |
138 |
|
139 |
function done() { |
140 |
$space = 0; |
141 |
$opt_l && print "<br>"; |
142 |
} |
143 |
|
144 |
|
145 |
|
146 |
# ======================================= |
147 |
# main |
148 |
# ======================================= |
149 |
|
150 |
learn_chords(); |
151 |
|
152 |
$log = ""; |
153 |
$line = ""; |
154 |
$space = 1; # Initialize as 1 to remove garbage before {t: } |
155 |
$line_nr = 0; |
156 |
$header = array(); |
157 |
|
158 |
// Parse input file |
159 |
print "parsing input file $opt_i ...<br><hr>"; |
160 |
$file = file($opt_i); |
161 |
foreach ($file as $line) { |
162 |
$line_nr++; |
163 |
|
164 |
r("/\n/", ""); |
165 |
|
166 |
$opt_t && logp(" --->" . $line); |
167 |
|
168 |
r("/^\s*#.*/", ""); // Clean up comments |
169 |
|
170 |
// TODO: |
171 |
// if (/{eot}/) { $tab = 0; %opt_l && next; print "\n</pre>\n"; next; } |
172 |
// $opt_l && $tab && next; |
173 |
// $tab && goto done; |
174 |
|
175 |
if (m("/{t:(.*)}/", $r) || m("/{title:(.*)}/", $r)) { |
176 |
logp("Title: $r[1]"); |
177 |
$header['title'] = $r[1]; |
178 |
continue; |
179 |
} |
180 |
|
181 |
if (m("/{st:(.*)}/", $r) || m("/{subtitle:(.*)}/", $r)) { |
182 |
logp("Subtitle: $r[1]"); |
183 |
$header['subtitle'] = $r[1]; |
184 |
continue; |
185 |
} |
186 |
|
187 |
if (is_array($header) && count($header) != -1) { |
188 |
do_header($header); |
189 |
unset($header); |
190 |
} |
191 |
|
192 |
// TODO: |
193 |
// Print lyrics only if -l is used |
194 |
/* |
195 |
if ($opt_l) { |
196 |
m!{c[ib]?:(.*)}! && next; |
197 |
m!{comment\w*:(.*)}! && next; |
198 |
} else { |
199 |
s!{c[ib]?:(.*)}!<h3>$1</h3>! && goto done; |
200 |
s!{comment\w*:(.*)}!<p class="comment">$1</p>! && goto done; |
201 |
} |
202 |
*/ |
203 |
|
204 |
// Handle chord definition in old & new formats |
205 |
|
206 |
if (m("/{define:\s*([^\s]+) (\w) (\w) (\w) (\w) (\w) (\w) (\w)}/", $r)) { |
207 |
logp("Chord $r[8]$r[7]$r[6]$r[5]$r[4]$r[3]:$r[2]: $r[1] (old format)"); |
208 |
$chord[$r[1]] = array( "$r[8]$r[7]$r[6]$r[5]$r[4]$r[3]", $r[2] ); |
209 |
continue; |
210 |
} |
211 |
|
212 |
if (m("/{define\s*([^\s]+) base-fret (.) frets (.) (.) (.) (.) (.) (.)}/", $r)) { |
213 |
logp("Chord $r[8]$r[7]$r[6]$r[5]$r[4]$r[3]:$r[2]: $r[1] (new format)"); |
214 |
$chord[$r[1]] = array( "$r[8]$r[7]$r[6]$r[5]$r[4]$r[3]", $r[2] ); |
215 |
continue; |
216 |
} |
217 |
|
218 |
// TODO: |
219 |
// if (/{sot}/) { $tab = 1; $opt_l && next; print "\n<pre>\n"; next; } |
220 |
|
221 |
if (m("/{soc}/", $r)) { |
222 |
r("/{soc}/", '/\n<div class="chorus">\n/'); |
223 |
logp("{soc} -> div"); |
224 |
done(); |
225 |
continue; |
226 |
} |
227 |
if (m("/{eoc}/", $r)) { |
228 |
r("/{eoc}/", "/\n</div>\n/"); |
229 |
logp("{eoc} -> /div"); |
230 |
done(); |
231 |
continue; |
232 |
} |
233 |
|
234 |
if (m("/^\s*{(.*)}\s*$/", $r)) { |
235 |
logp("Warning: $line: unknown directive \"$r[1]\""); |
236 |
continue; |
237 |
} |
238 |
|
239 |
if (!$space && m("/^\s*$/", $r)) { |
240 |
r("/^\s*$/", "/\n<p>\n/"); |
241 |
$space = 1; |
242 |
done(); |
243 |
continue; |
244 |
} |
245 |
|
246 |
if (m("/^\s*$/", $r)) continue; |
247 |
$space = 0; |
248 |
|
249 |
// TODO: |
250 |
// Lyrics only mode |
251 |
if ($opt_l) { |
252 |
//s!\[[^\]]+\]!!g; |
253 |
//goto done; |
254 |
} |
255 |
|
256 |
// Extract chords |
257 |
//@c = /\[([^\]]+)\]/g; |
258 |
$pattern_chord = "/\[([^\]]+)\]/"; |
259 |
|
260 |
print "<table cellspacing=0 cellpadding=0 border=0><tr>\n"; |
261 |
$td = ""; if (!m("/^\s*\[/", $r)) { print $td = "<td>\n"; } |
262 |
|
263 |
if (mg($pattern_chord, $r)) { |
264 |
$entries = $r[0]; |
265 |
foreach ($entries as $entry) { |
266 |
$entry = str_replace("[", "", $entry); |
267 |
$entry = str_replace("]", "", $entry); |
268 |
$h[$entry] = 1; |
269 |
print "<td class=\"chord\">$entry</td>\n"; |
270 |
} |
271 |
} |
272 |
|
273 |
r("/\[[^\]]+\]\s\s+/", "<td> "); |
274 |
r("/\[[^\]]+\]\s+/", "<td> "); |
275 |
r("/\[[^\]]+\]/", "<td>"); |
276 |
r("/ <td>/", " <td>"); |
277 |
|
278 |
print "<tr>\n$td$line</tr></table>\n\n"; |
279 |
|
280 |
|
281 |
} |
282 |
|
283 |
print "<hr>"; |
284 |
print "<pre style=\"font-size:10px;\">log-output:\n\n$log</pre><hr>"; |
285 |
|
286 |
//unless ($opt_l) { |
287 |
// Display chord grids |
288 |
print "<div class=\"grids\">\n"; |
289 |
foreach ($h as $key => $value) { |
290 |
//print "key: $key<br>"; |
291 |
if (!$chord[$key]) { |
292 |
logp("Warning: unknown chord '$i'"); |
293 |
continue; |
294 |
} |
295 |
$tmp = "chord_" . $chord[$key][0] . "_" . $chord[$key][1] . "." . $format; |
296 |
print "<img alt=\"$key\" src=\"$opt_d$tmp\"> \n"; |
297 |
build_chord($key, $tmp); |
298 |
} |
299 |
print "</div>\n"; |
300 |
// |
301 |
|
302 |
|
303 |
//if ($opt_t) { |
304 |
?> |
305 |
<br> |
306 |
<div class="timestamp"> |
307 |
Generated with chord2html.php <?= $version ?>, <?= $date ?>. |
308 |
</div> |
309 |
<? |
310 |
//} |
311 |
|
312 |
?> |
313 |
</body> |
314 |
</html> |
315 |
<? |
316 |
|
317 |
#--------------------------------------------------------------------------- |
318 |
# Create html header |
319 |
#--------------------------------------------------------------------------- |
320 |
|
321 |
function do_header($t) { |
322 |
global $version, $bg_color, $style; |
323 |
if ($header_done) return; |
324 |
|
325 |
?> |
326 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
327 |
<html> |
328 |
<head> |
329 |
<title><?= $t[title] ?></title> |
330 |
<meta name="generator" content="chord2html <?= $version ?>"> |
331 |
<meta name="description" content="<?= $t[subtitle] ?>"> |
332 |
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"> |
333 |
<link rel="StyleSheet" href="<?= $style ?>" type="text/css"> |
334 |
</head> |
335 |
<body bgcolor="<?= $bg_color ?>"> |
336 |
<? |
337 |
|
338 |
$opt_l || print "<h1>$t[title]</h1>\n<h2>$t[subtitle]</h2>\n"; |
339 |
|
340 |
$header_done = 1; |
341 |
} |
342 |
|
343 |
#--------------------------------------------------------------------------- |
344 |
# Create PNG image of chord using GD |
345 |
#--------------------------------------------------------------------------- |
346 |
|
347 |
function build_chord($c, $image) { |
348 |
global $chord, $opt_d, $format; |
349 |
|
350 |
$s = $chord[$c][0]; |
351 |
$f = $chord[$c][1]; |
352 |
|
353 |
$imgfile = "$opt_d$image"; |
354 |
|
355 |
// TODO: introduce an argument "rebuild" |
356 |
if (0 && file_exists($imgfile)) { |
357 |
logp("chord image $s:$f already exists -- skipping"); |
358 |
return; |
359 |
} |
360 |
|
361 |
$im = ImageCreate(64, 64); |
362 |
$white = ImageColorAllocate ($im, 0xff, 0xff, 0xff); |
363 |
$black = ImageColorAllocate ($im, 0, 0, 0); |
364 |
//$h = gdLargeFont->height + 7; |
365 |
$h = 12 + 7; |
366 |
$i; |
367 |
|
368 |
ImageColorTransparent($im, $white); |
369 |
|
370 |
ImageInterlace($im, 0); |
371 |
ImageString($im, gdSmallFont, 12, 0, $c, $black); |
372 |
($f != 1) && ImageString($im, gdSmallFont, 0, $h, $f, $black); |
373 |
|
374 |
for ($i = 0; $i < 6; $i++) { |
375 |
$c = substr($s, $i, 1); |
376 |
if (preg_match("/[NnXx-]/", $c)) { |
377 |
ImageLine($im, 10 + $i * 8, $h - 7, 14 + $i * 8, $h - 3, $black); |
378 |
ImageLine($im, 14 + $i * 8, $h - 7, 10 + $i * 8, $h - 3, $black); |
379 |
} elseif (preg_match("/[1234]/", $c)) { |
380 |
ImageArc($im, 12 + $i * 8, $h + $c * 10 - 5, 5, 6, 0, 360, $black); |
381 |
ImageFill($im, 12 + $i * 8, $h + $c * 10 - 5, $black); |
382 |
} elseif (preg_match("/0/", $c)) { |
383 |
ImageArc($im, 12 + $i * 8, $h - 5, 6, 6, 0, 360, $black); |
384 |
} |
385 |
} |
386 |
|
387 |
for ($i = 12; $i < 60; $i += 8) { |
388 |
ImageLine($im, $i, $h, $i, 64, $black); |
389 |
} |
390 |
|
391 |
for ($i = $h; $i <= 64; $i += 10) { |
392 |
ImageLine($im, 12, $i, 52, $i, $black); |
393 |
} |
394 |
|
395 |
logp("Creating chord image $s:$f > $imgfile"); |
396 |
|
397 |
#$fp = fopen($imgfile); |
398 |
#binmode FILE; |
399 |
if ($format == "png") { |
400 |
logp("Writing png to $imgfile"); |
401 |
ImagePng($im, $imgfile); |
402 |
} elseif ($format == "gif") { |
403 |
logp("Writing gif to $imgfile"); |
404 |
ImageGif($im, $imgfile); |
405 |
} else { |
406 |
logp("Unknown image format: $format"); |
407 |
} |
408 |
#fclose($fp); |
409 |
|
410 |
} |
411 |
|
412 |
|
413 |
#--------------------------------------------------------------------------- |
414 |
# Chord definitions from CHORD 3.5 |
415 |
# CHORD is Copyright (C) 1991-1993 by Martin Leclerc & Mario Dorion |
416 |
#--------------------------------------------------------------------------- |
417 |
|
418 |
function learn_chords() { |
419 |
global $chord; |
420 |
$chord = array( |
421 |
"Ab" => array( "133211", 4 ), |
422 |
"Ab+" => array( "NN2110", 1 ), |
423 |
"Ab4" => array( "NN1124", 1 ), |
424 |
"Ab7" => array( "NN1112", 1 ), |
425 |
"Ab11" => array( "131311", 4 ), |
426 |
"Absus" => array( "NN1124", 1 ), |
427 |
"Absus4" => array( "NN1124", 1 ), |
428 |
"Abdim" => array( "NN0101", 1 ), |
429 |
"Abmaj" => array( "133211", 4 ), |
430 |
"Abmaj7" => array( "NN1113", 1 ), |
431 |
"Abmin" => array( "133111", 4 ), |
432 |
"Abm" => array( "133111", 4 ), |
433 |
"Abm7" => array( "NN1111", 4 ), |
434 |
"A" => array( "N02220", 1 ), |
435 |
"A+" => array( "N03221", 1 ), |
436 |
"A4" => array( "002200", 1 ), |
437 |
"A6" => array( "NN2222", 1 ), |
438 |
"A7" => array( "N02020", 1 ), |
439 |
"A7+" => array( "NN3221", 1 ), |
440 |
"A7(9+)" => array( "N22223", 1 ), |
441 |
"A9" => array( "N02100", 1 ), |
442 |
"A11" => array( "N42433", 1 ), |
443 |
"A13" => array( "N01231", 5 ), |
444 |
"A7sus4" => array( "002030", 1 ), |
445 |
"A9sus" => array( "N02100", 1 ), |
446 |
"Asus" => array( "NN2230", 1 ), |
447 |
"Asus2" => array( "002200", 1 ), |
448 |
"Asus4" => array( "NN2230", 1 ), |
449 |
"Adim" => array( "NN1212", 1 ), |
450 |
"Amaj" => array( "N02220", 1 ), |
451 |
"Amaj7" => array( "N02120", 1 ), |
452 |
"Adim" => array( "NN1212", 1 ), |
453 |
"Amin" => array( "N02210", 1 ), |
454 |
"A/D" => array( "NN0022", 1 ), |
455 |
"A/F#" => array( "202220", 1 ), |
456 |
"A/G#" => array( "402220", 1 ), |
457 |
"Am" => array( "N02210", 1 ), |
458 |
"Am#7" => array( "NN2110", 1 ), |
459 |
"Am(7#)" => array( "N02214", 1 ), |
460 |
"Am6" => array( "N02212", 1 ), |
461 |
"Am7" => array( "N02213", 1 ), |
462 |
"Am7sus4" => array( "000030", 1 ), |
463 |
"Am9" => array( "N01113", 5 ), |
464 |
"Am/G" => array( "302210", 1 ), |
465 |
"Amadd9" => array( "022210", 1 ), |
466 |
"Am(add9)" => array( "022210", 1 ), |
467 |
"A#" => array( "N13331", 1 ), |
468 |
"A#+" => array( "NN0332", 1 ), |
469 |
"A#4" => array( "NN3341", 1 ), |
470 |
"A#7" => array( "NN1112", 3 ), |
471 |
"A#sus" => array( "NN3341", 1 ), |
472 |
"A#sus4" => array( "NN3341", 1 ), |
473 |
"A#maj" => array( "N13331", 1 ), |
474 |
"A#maj7" => array( "N1323N", 1 ), |
475 |
"A#dim" => array( "NN2323", 1 ), |
476 |
"A#min" => array( "N13321", 1 ), |
477 |
"A#m" => array( "N13321", 1 ), |
478 |
"A#m7" => array( "N13121", 1 ), |
479 |
"Bb" => array( "N13331", 1 ), |
480 |
"Bb+" => array( "NN0332", 1 ), |
481 |
"Bb4" => array( "NN3341", 1 ), |
482 |
"Bb6" => array( "NN3333", 1 ), |
483 |
"Bb7" => array( "NN1112", 3 ), |
484 |
"Bb9" => array( "131213", 6 ), |
485 |
"Bb11" => array( "131341", 6 ), |
486 |
"Bbsus" => array( "NN3341", 1 ), |
487 |
"Bbsus4" => array( "NN3341", 1 ), |
488 |
"Bbmaj" => array( "N13331", 1 ), |
489 |
"Bbmaj7" => array( "N1323N", 1 ), |
490 |
"Bbdim" => array( "NN2323", 1 ), |
491 |
"Bbmin" => array( "N13321", 1 ), |
492 |
"Bbm" => array( "N13321", 1 ), |
493 |
"Bbm7" => array( "N13121", 1 ), |
494 |
"Bbm9" => array( "NNN113", 6 ), |
495 |
"B" => array( "N24442", 1 ), |
496 |
"B+" => array( "NN1004", 1 ), |
497 |
"B4" => array( "NN3341", 2 ), |
498 |
"B7" => array( "021202", 1 ), |
499 |
"B7+" => array( "N21203", 1 ), |
500 |
"B7+5" => array( "N21203", 1 ), |
501 |
"B7#9" => array( "N2123N", 1 ), |
502 |
"B7(#9)" => array( "N2123N", 1 ), |
503 |
"B9" => array( "131213", 7 ), |
504 |
"B11" => array( "133200", 7 ), |
505 |
"B11/13" => array( "N11113", 2 ), |
506 |
"B13" => array( "N21204", 1 ), |
507 |
"Bsus" => array( "NN3341", 2 ), |
508 |
"Bsus4" => array( "NN3341", 2 ), |
509 |
"Bmaj" => array( "N2434N", 1 ), |
510 |
"Bmaj7" => array( "N2434N", 1 ), |
511 |
"Bdim" => array( "NN0101", 1 ), |
512 |
"Bmin" => array( "N24432", 1 ), |
513 |
"B/F#" => array( "022200", 2 ), |
514 |
"BaddE" => array( "N24400", 1 ), |
515 |
"B(addE)" => array( "N24400", 1 ), |
516 |
"BaddE/F#" => array( "2N4400", 1 ), |
517 |
"Bm" => array( "N24432", 1 ), |
518 |
"Bm6" => array( "NN4434", 1 ), |
519 |
"Bm7" => array( "N13121", 2 ), |
520 |
"Bmmaj7" => array( "N1443N", 1 ), |
521 |
"Bm(maj7)" => array( "N1443N", 1 ), |
522 |
"Bmsus9" => array( "NN4422", 1 ), |
523 |
"Bm(sus9)" => array( "NN4422", 1 ), |
524 |
"Bm7b5" => array( "124231", 1 ), |
525 |
"C" => array( "N32010", 1 ), |
526 |
"C+" => array( "NN2110", 1 ), |
527 |
"C4" => array( "NN3013", 1 ), |
528 |
"C6" => array( "N02213", 1 ), |
529 |
"C7" => array( "032310", 1 ), |
530 |
"C9" => array( "131213", 8 ), |
531 |
"C9(11)" => array( "N3333N", 1 ), |
532 |
"C11" => array( "N13141", 3 ), |
533 |
"Csus" => array( "NN3013", 1 ), |
534 |
"Csus2" => array( "N3001N", 1 ), |
535 |
"Csus4" => array( "NN3013", 1 ), |
536 |
"Csus9" => array( "NN4124", 7 ), |
537 |
"Cmaj" => array( "032010", 1 ), |
538 |
"Cmaj7" => array( "N32000", 1 ), |
539 |
"Cmin" => array( "N13321", 3 ), |
540 |
"Cdim" => array( "NN1212", 1 ), |
541 |
"C/B" => array( "N22010", 1 ), |
542 |
"Cadd2/B" => array( "N20010", 1 ), |
543 |
"CaddD" => array( "N32030", 1 ), |
544 |
"C(addD)" => array( "N32030", 1 ), |
545 |
"Cadd9" => array( "N32030", 1 ), |
546 |
"C(add9)" => array( "N32030", 1 ), |
547 |
"Cm" => array( "N13321", 3 ), |
548 |
"Cm7" => array( "N13121", 3 ), |
549 |
"Cm11" => array( "N1314N", 3 ), |
550 |
"C#" => array( "NN3121", 1 ), |
551 |
"C#+" => array( "NN3221", 1 ), |
552 |
"C#4" => array( "NN3341", 4 ), |
553 |
"C#7" => array( "NN3424", 1 ), |
554 |
"C#7(b5)" => array( "N21212", 1 ), |
555 |
"C#sus" => array( "NN3341", 4 ), |
556 |
"C#sus4" => array( "NN3341", 4 ), |
557 |
"C#maj" => array( "N43111", 1 ), |
558 |
"C#maj7" => array( "N43111", 1 ), |
559 |
"C#dim" => array( "NN2323", 1 ), |
560 |
"C#min" => array( "NN2120", 1 ), |
561 |
"C#add9" => array( "N13311", 4 ), |
562 |
"C#(add9)" => array( "N13311", 4 ), |
563 |
"C#m" => array( "NN2120", 1 ), |
564 |
"C#m7" => array( "NN2424", 1 ), |
565 |
"Db" => array( "NN3121", 1 ), |
566 |
"Db+" => array( "NN3221", 1 ), |
567 |
"Db7" => array( "NN3424", 1 ), |
568 |
"Dbsus" => array( "NN3341", 4 ), |
569 |
"Dbsus4" => array( "NN3341", 4 ), |
570 |
"Dbmaj" => array( "NN3121", 1 ), |
571 |
"Dbmaj7" => array( "N43111", 1 ), |
572 |
"Dbdim" => array( "NN2323", 1 ), |
573 |
"Dbmin" => array( "NN2120", 1 ), |
574 |
"Dbm" => array( "NN2120", 1 ), |
575 |
"Dbm7" => array( "NN2424", 1 ), |
576 |
"D" => array( "NN0232", 1 ), |
577 |
"D+" => array( "NN0332", 1 ), |
578 |
"D4" => array( "NN0233", 1 ), |
579 |
"D6" => array( "N00202", 1 ), |
580 |
"D7" => array( "NN0212", 1 ), |
581 |
"D7#9" => array( "N21233", 4 ), |
582 |
"D7(#9)" => array( "N21233", 4 ), |
583 |
"D9" => array( "131213",10 ), |
584 |
"D11" => array( "300210", 1 ), |
585 |
"Dsus" => array( "NN0233", 1 ), |
586 |
"Dsus2" => array( "000230", 1 ), |
587 |
"Dsus4" => array( "NN0233", 1 ), |
588 |
"D7sus2" => array( "N00210", 1 ), |
589 |
"D7sus4" => array( "N00213", 1 ), |
590 |
"Dmaj" => array( "NN0232", 1 ), |
591 |
"Dmaj7" => array( "NN0222", 1 ), |
592 |
"Ddim" => array( "NN0101", 1 ), |
593 |
"Dmin" => array( "NN0231", 1 ), |
594 |
"D/A" => array( "N00232", 1 ), |
595 |
"D/B" => array( "N20232", 1 ), |
596 |
"D/C" => array( "N30232", 1 ), |
597 |
"D/C#" => array( "N40232", 1 ), |
598 |
"D/E" => array( "N1111N", 7 ), |
599 |
"D/G" => array( "3N0232", 1 ), |
600 |
"D5/E" => array( "0111NN", 7 ), |
601 |
"Dadd9" => array( "000232", 1 ), |
602 |
"D(add9)" => array( "000232", 1 ), |
603 |
"D9add6" => array( "133200",10 ), |
604 |
"D9(add6)" => array( "133200",10 ), |
605 |
"Dm" => array( "NN0231", 1 ), |
606 |
"Dm6(5b)" => array( "NN0101", 1 ), |
607 |
"Dm7" => array( "NN0211", 1 ), |
608 |
"Dm#5" => array( "NN0332", 1 ), |
609 |
"Dm(#5)" => array( "NN0332", 1 ), |
610 |
"Dm#7" => array( "NN0221", 1 ), |
611 |
"Dm(#7)" => array( "NN0221", 1 ), |
612 |
"Dm/A" => array( "N00231", 1 ), |
613 |
"Dm/B" => array( "N20231", 1 ), |
614 |
"Dm/C" => array( "N30231", 1 ), |
615 |
"Dm/C#" => array( "N40231", 1 ), |
616 |
"Dm9" => array( "NN3210", 1 ), |
617 |
"D#" => array( "NN3121", 3 ), |
618 |
"D#+" => array( "NN1004", 1 ), |
619 |
"D#4" => array( "NN1344", 1 ), |
620 |
"D#7" => array( "NN1323", 1 ), |
621 |
"D#sus" => array( "NN1344", 1 ), |
622 |
"D#sus4" => array( "NN1344", 1 ), |
623 |
"D#maj" => array( "NN3121", 3 ), |
624 |
"D#maj7" => array( "NN1333", 1 ), |
625 |
"D#dim" => array( "NN1212", 1 ), |
626 |
"D#min" => array( "NN4342", 1 ), |
627 |
"D#m" => array( "NN4342", 1 ), |
628 |
"D#m7" => array( "NN1322", 1 ), |
629 |
"Eb" => array( "NN3121", 3 ), |
630 |
"Eb+" => array( "NN1004", 1 ), |
631 |
"Eb4" => array( "NN1344", 1 ), |
632 |
"Eb7" => array( "NN1323", 1 ), |
633 |
"Ebsus" => array( "NN1344", 1 ), |
634 |
"Ebsus4" => array( "NN1344", 1 ), |
635 |
"Ebmaj" => array( "NN1333", 1 ), |
636 |
"Ebmaj7" => array( "NN1333", 1 ), |
637 |
"Ebdim" => array( "NN1212", 1 ), |
638 |
"Ebadd9" => array( "N11341", 1 ), |
639 |
"Eb(add9)" => array( "N11341", 1 ), |
640 |
"Ebmin" => array( "NN4342", 1 ), |
641 |
"Ebm" => array( "NN4342", 1 ), |
642 |
"Ebm7" => array( "NN1322", 1 ), |
643 |
"E" => array( "022100", 1 ), |
644 |
"E+" => array( "NN2110", 1 ), |
645 |
"E5" => array( "0133NN", 7 ), |
646 |
"E6" => array( "NN3333", 9 ), |
647 |
"E7" => array( "022130", 1 ), |
648 |
"E7#9" => array( "022133", 1 ), |
649 |
"E7(#9)" => array( "022133", 1 ), |
650 |
"E7(5b)" => array( "N10130", 1 ), |
651 |
"E7b9" => array( "020132", 1 ), |
652 |
"E7(b9)" => array( "020132", 1 ), |
653 |
"E7(11)" => array( "022230", 1 ), |
654 |
"E9" => array( "131213", 1 ), |
655 |
"E11" => array( "111122", 1 ), |
656 |
"Esus" => array( "022200", 1 ), |
657 |
"Esus4" => array( "022200", 0 ), |
658 |
"Emaj" => array( "022100", 1 ), |
659 |
"Emaj7" => array( "02110N", 1 ), |
660 |
"Edim" => array( "NN2323", 1 ), |
661 |
"Emin" => array( "022000", 1 ), |
662 |
"Em" => array( "022000", 1 ), |
663 |
"Em6" => array( "022020", 1 ), |
664 |
"Em7" => array( "022030", 1 ), |
665 |
"Em/B" => array( "N22000", 1 ), |
666 |
"Em/D" => array( "NN0000", 1 ), |
667 |
"Em7/D" => array( "NN0000", 1 ), |
668 |
"Emsus4" => array( "002000", 1 ), |
669 |
"Em(sus4)" => array( "002000", 1 ), |
670 |
"Emadd9" => array( "024000", 1 ), |
671 |
"Em(add9)" => array( "024000", 1 ), |
672 |
"F" => array( "133211", 1 ), |
673 |
"F+" => array( "NN3221", 1 ), |
674 |
"F+7+11" => array( "133200", 1 ), |
675 |
"F4" => array( "NN3311", 1 ), |
676 |
"F6" => array( "N3323N", 1 ), |
677 |
"F7" => array( "131211", 1 ), |
678 |
"F9" => array( "242324", 1 ), |
679 |
"F11" => array( "131311", 1 ), |
680 |
"Fsus" => array( "NN3311", 1 ), |
681 |
"Fsus4" => array( "NN3311", 1 ), |
682 |
"Fmaj" => array( "133211", 1 ), |
683 |
"Fmaj7" => array( "N33210", 1 ), |
684 |
"Fdim" => array( "NN0101", 1 ), |
685 |
"Fmin" => array( "133111", 1 ), |
686 |
"F/A" => array( "N03211", 1 ), |
687 |
"F/C" => array( "NN3211", 1 ), |
688 |
"F/D" => array( "NN0211", 1 ), |
689 |
"F/G" => array( "333211", 1 ), |
690 |
"F7/A" => array( "N03011", 1 ), |
691 |
"Fmaj7/A" => array( "N03210", 1 ), |
692 |
"Fmaj7/C" => array( "N33210", 1 ), |
693 |
"Fmaj7(+5)" => array( "NN3220", 1 ), |
694 |
"Fadd9" => array( "303211", 1 ), |
695 |
"F(add9)" => array( "303211", 1 ), |
696 |
"FaddG" => array( "1N3213", 1 ), |
697 |
"FaddG" => array( "1N3213", 1 ), |
698 |
"Fm" => array( "133111", 1 ), |
699 |
"Fm6" => array( "NN0111", 1 ), |
700 |
"Fm7" => array( "131111", 1 ), |
701 |
"Fmmaj7" => array( "N33110", 1 ), |
702 |
"F#" => array( "244322", 1 ), |
703 |
"F#+" => array( "NN4332", 1 ), |
704 |
"F#7" => array( "NN4320", 1 ), |
705 |
"F#9" => array( "N12122", 1 ), |
706 |
"F#11" => array( "242422", 1 ), |
707 |
"F#sus" => array( "NN4422", 1 ), |
708 |
"F#sus4" => array( "NN4422", 1 ), |
709 |
"F#maj" => array( "244322", 0 ), |
710 |
"F#maj7" => array( "NN4321", 1 ), |
711 |
"F#dim" => array( "NN1212", 1 ), |
712 |
"F#min" => array( "244222", 1 ), |
713 |
"F#/E" => array( "044322", 1 ), |
714 |
"F#4" => array( "NN4422", 1 ), |
715 |
"F#m" => array( "244222", 1 ), |
716 |
"F#m6" => array( "NN1222", 1 ), |
717 |
"F#m7" => array( "NN2222", 1 ), |
718 |
"F#m7-5" => array( "102333", 2 ), |
719 |
"F#m/C#m" => array( "NN4222", 1 ), |
720 |
"Gb" => array( "244322", 1 ), |
721 |
"Gb+" => array( "NN4332", 1 ), |
722 |
"Gb7" => array( "NN4320", 1 ), |
723 |
"Gb9" => array( "N12122", 1 ), |
724 |
"Gbsus" => array( "NN4422", 1 ), |
725 |
"Gbsus4" => array( "NN4422", 1 ), |
726 |
"Gbmaj" => array( "244322", 1 ), |
727 |
"Gbmaj7" => array( "NN4321", 1 ), |
728 |
"Gbdim" => array( "NN1212", 1 ), |
729 |
"Gbmin" => array( "244222", 1 ), |
730 |
"Gbm" => array( "244222", 1 ), |
731 |
"Gbm7" => array( "NN2222", 1 ), |
732 |
"G" => array( "320003", 1 ), |
733 |
"G+" => array( "NN1004", 1 ), |
734 |
"G4" => array( "NN0013", 1 ), |
735 |
"G6" => array( "3N0000", 1 ), |
736 |
"G7" => array( "320001", 1 ), |
737 |
"G7+" => array( "NN4332", 1 ), |
738 |
"G7b9" => array( "NN0101", 1 ), |
739 |
"G7(b9)" => array( "NN0101", 1 ), |
740 |
"G7#9" => array( "13N244", 3 ), |
741 |
"G7(#9)" => array( "13N244", 3 ), |
742 |
"G9" => array( "3N0201", 1 ), |
743 |
"G9(11)" => array( "131313", 3 ), |
744 |
"G11" => array( "3N0211", 1 ), |
745 |
"Gsus" => array( "NN0013", 1 ), |
746 |
"Gsus4" => array( "NN0011", 1 ), |
747 |
"G6sus4" => array( "020010", 1 ), |
748 |
"G6(sus4)" => array( "020010", 1 ), |
749 |
"G7sus4" => array( "330011", 1 ), |
750 |
"G7(sus4)" => array( "330011", 1 ), |
751 |
"Gmaj" => array( "320003", 1 ), |
752 |
"Gmaj7" => array( "NN1234", 2 ), |
753 |
"Gmaj7sus4" => array( "NN0012", 1 ), |
754 |
"Gmaj9" => array( "114121", 2 ), |
755 |
"Gmin" => array( "133111", 3 ), |
756 |
"Gdim" => array( "NN2323", 1 ), |
757 |
"Gadd9" => array( "13N213", 3 ), |
758 |
"G(add9)" => array( "13N213", 3 ), |
759 |
"G/A" => array( "N00003", 1 ), |
760 |
"G/B" => array( "N20003", 1 ), |
761 |
"G/D" => array( "N22100", 4 ), |
762 |
"G/F#" => array( "220003", 1 ), |
763 |
"Gm" => array( "133111", 3 ), |
764 |
"Gm6" => array( "NN2333", 1 ), |
765 |
"Gm7" => array( "131111", 3 ), |
766 |
"Gm/Bb" => array( "3221NN", 4 ), |
767 |
"G#" => array( "133211", 4 ), |
768 |
"G#+" => array( "NN2110", 1 ), |
769 |
"G#4" => array( "133111", 4 ), |
770 |
"G#7" => array( "NN1112", 1 ), |
771 |
"G#sus" => array( "NN1124", 1 ), |
772 |
"G#sus4" => array( "NN1124", 1 ), |
773 |
"G#maj" => array( "133211", 4 ), |
774 |
"G#maj7" => array( "NN1113", 1 ), |
775 |
"G#dim" => array( "NN0101", 1 ), |
776 |
"G#min" => array( "133111", 4 ), |
777 |
"G#m" => array( "133111", 4 ), |
778 |
"G#m6" => array( "NN1101", 1 ), |
779 |
"G#m7" => array( "NN1111", 4 ), |
780 |
"G#m9maj7" => array( "NN1303", 1 ), |
781 |
"G#m9(maj7)" => array( "NN1303", 1 ) |
782 |
); |
783 |
} |
784 |
|