<?php
set_time_limit(20000);
include_once("../config.php");
include_once("../libDatabase.php");
include_once("../libGeneral.php");
connect();
if(isset($_GET['txtNumIntervalForm']))
{
$txtNumIntervalForm=$_GET['txtNumIntervalForm'];
$spelling=txtNumIntervalForm2spelling($txtNumIntervalForm);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>phpMyChord\pda\txtNumIntervalLookup: find chord or scale name from numeric interval form</title>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=windows-1252">
<meta name="description" content="PDA Web Application
for finding Scale or Chord name from numeric interval form">
</head>
<body style="direction: ltr;" lang="en-US">
<h2>phpMyChord Numeric Interval Form Lookup</h2>
<p>Use this form to find a scale, chord, or interval (sci) type from the numeric interval form.
The numeric interval form entered in this form must be a space-delimited sequence of
interval numbers, starting with the interval of the second scale degree from the first scale degree (the 1).
e.g. 3 4 is the minor chord.
</p>
<p>The results will show <strong>modes</strong> which are the same as inversions.
For each scale degree of the spelling that is the equivalent of the
numeric interval form you entered, the results will
show what the numeric interval form would be if you started at that scale degree.
The <strong>preferred</strong> mode is the mode that phpMyChord considers to be the
most commonly used spelling.
<p>go <a rel="start" rev="section" href="..">back to phpMyChord</a> or <a rel="chapter" rev="section" href="index.php">back to phpMyChord/pda</a></p>
<form name="frm" action="txtNumIntervalFormLookup.php" method="get">
Numeric Interval Form: <input name="txtNumIntervalForm" type="text" value="<?php echo $txtNumIntervalForm;?>" />
<input type="submit" name="submit" value="submit" />
<input type="reset" name="reset" value="reset" />
<input type="button" name="clear" value="clear" onclick="frm.txtNumIntervalForm.value='';" />
</form>
<?php
echo "<h2>$txtNumIntervalForm</h2>";
$result=dbSelect("select * from tblscitype where txtNumIntervalForm='$txtNumIntervalForm'");
$code=$result[1]['txtCode'];
$name=$result[1]['txtName'];
$altNames=$result[1]['txtAltNames'];
$numSymForms=$result[1]['numSymForms'];
if($code<>"")
echo "code: $code<br>";
if($name<>"")
echo "name: $name<br>";
if($altNames<>"")
echo "Alternate Name(s): $altNames<br>";
if($spelling<>"")
echo "Spelling: <a rel=\"section\" rev=\"section\" href=\"spellingLookup.php?spelling=$spelling\">$spelling</a><br>";
if($numSymForms>"0")
echo "Number of Symmetrical Forms: $numSymForms<br>";
$modeArray=getModeArray($spelling);
foreach ($modeArray as $mode)
{
$modeSpelling=$mode[1];
$result=dbSelect("select * from tblscitype where txtSpelling='$modeSpelling'");
$booPrefer=$result[1]['booPrefer'];
$modeTxtNumIntervalForm=spelling2numIntervalForm($modeSpelling);
echo $mode[0]." mode: <a rel=\"section\" rev=\"section\" href=\"txtNumIntervalFormLookup.php?txtNumIntervalForm=$modeTxtNumIntervalForm\">$modeTxtNumIntervalForm</a>";
if($booPrefer)
echo " (preferred)";
echo "<br>";
}
$spellingArray=explode(",",$spelling);
foreach($spellingArray as $spellingArrayElement)
{
$subSpelling=spellingDifference($spelling,$spellingArrayElement);
if($subSpelling<>"")
{
$subTxtNumIntervalForm=spelling2numIntervalForm($subSpelling);
echo "$spellingArrayElement omitted: <a rel=\"section\" rev=\"section\" href=\"txtNumIntervalLookup.php?txtNumIntervalForm=$subTxtNumIntervalForm\">$subTxtNumIntervalForm</a><br>";
}
}
for($i=1;$i<12;$i++)
{
$sciElement=num2spellingElement($i);
$spellingUnion=spellingUnion($spelling,$sciElement);
if($spelling <> $spellingUnion)
{
$txtNumIntervalFormUnion=spelling2numIntervalForm($spellingUnion);
echo "$sciElement added: <a rel=\"section\" rev=\"section\" href=\"txtNumIntervalFormLookup.php?txtNumIntervalForm=$txtNumIntervalFormUnion\">$txtNumIntervalFormUnion</a><br>";
}
}
?>
</body>
</html>