* Maintainer: none */ function chords_load() { register_hook('app_menu', 'addon/chords/chords.php', 'chords_app_menu'); } function chords_unload() { unregister_hook('app_menu', 'addon/chords/chords.php', 'chords_app_menu'); } function chords_app_menu($a,&$b) { $b['app_menu'][] = '
Guitar Chords
'; } function chords_module() {} function chords_content($a) { $o .= '

Guitar Chords

'; $o .= 'The complete online guitar chord dictionary
'; $args = ''; $l = ''; if($_SERVER['REQUEST_METHOD'] == 'POST') { if(isset($_POST['chord']) && strlen($_POST['chord'])) $args .= escapeshellarg(ucfirst(trim($_POST['chord']))); if((strlen($args)) && (isset($_POST['tuning'])) && (strlen($_POST['tuning']))) $args .= ' '.escapeshellarg($_POST['tuning']); if((strlen($args)) && (isset($_POST['lefty']))) $args .= ' lefty'; } if((! strlen($args)) && (! stristr(basename($_SERVER['QUERY_STRING']),'chords')) && strlen(basename($_SERVER['QUERY_STRING']))) $args = escapeshellarg(ucfirst(basename($_SERVER['QUERY_STRING']))); $tunings = array("","openg", "opene", "dadgad"); $tnames = array("Em11 [Standard] (EADGBE)", "G/D [Drop D] (DGDGBD)","Open E (EBEG#BE)","Dsus4 (DADGAD)"); $t = ((isset($_POST['tuning'])) ? $_POST['tuning'] : ''); if(isset($_POST['lefty']) && $_POST['lefty'] == '1') $l = 'checked="checked"'; $ch = ((isset($_POST['chord'])) ? $_POST['chord'] : ''); $o .= <<< EOT
Chord name: (ex: Em7)   Tuning: Left-Handed:


EOT; if(strlen($args)) { $o .= '
';
  $o .= shell_exec("addon/chords/chord ".$args);
  $o .=  '
'; } else { $o .= <<< EOT

This is a fairly comprehensive and complete guitar chord dictionary which will list most of the available ways to play a certain chord, starting from the base of the fingerboard up to a few frets beyond the twelfth fret (beyond which everything repeats). A couple of non-standard tunings are provided for the benefit of slide players, etc.

Chord names start with a root note (A-G) and may include sharps (#) and flats (b). This software will parse most of the standard naming conventions such as maj, min, dim, sus(2 or 4), aug, with optional repeating elements.

Valid examples include A, A7, Am7, Amaj7, Amaj9, Ammaj7, Aadd4, Asus2Add4, E7b13b11 ...

Quick Reference:
EOT; $keys = array('A','Bb','B', 'C','Db','D','Eb','E','F','Gb','G','Ab'); $o .= ''; $o .= ""; foreach($keys as $k) $o .= ""; $o .= ""; foreach($keys as $k) $o .= ""; $o .= ""; foreach($keys as $k) $o .= ""; $o .= ""; $o .= "
$k
{$k}m
{$k}7
"; } return $o; }