// Track any items that fall between the two notes in the group $NonNoteQ = ""; // function FlushTheGroupingQ() { global $NonNoteQ, $priorNoteObj; if ($priorNoteObj) { echo $priorNoteObj->ReconstructClipText() . "\n"; } if ($NonNoteQ) { echo $NonNoteQ; } $NonNoteQ = ""; $priorNoteObj = false; } echo $clip->GetClipHeader() . "\n"; // foreach ($clip->Items as $item) { $o = new NWC2ClipItem($item); // $is_note = in_array($o->GetObjType(), array("Chord", "Note", "Rest")); $is_rest = $o->GetObjType() == "Rest"; $is_grace = isset($o->Opts["Dur"]["Grace"]); $is_dotted = isset($o->Opts["Dur"]["Dotted"]); $is_dbldotted = isset($o->Opts["Dur"]["DblDotted"]); $is_beamed = isset($o->Opts["Opts"]["Beam"]); $is_beamstart = $is_beamed && $o->Opts["Opts"]["Beam"] == "First"; if ($is_note) { if (!$priorNoteObj) { $starterDuration = array_intersect(array_keys($o->Opts["Dur"]), array_keys($validPairs)); if (count($starterDuration)) {
if (preg_match('/^\\/staffpos\\=(.*)$/i', $v, $m)) { $NOTENAME_POSITION = $m[1]; } } } } $accmap = array("v" => "bb", "b" => "b", "n" => "", "#" => "#", "x" => "x"); $useLyric = $NOTENAME_MODE == "lyric"; $txtFont = str_replace(' ', '', $NOTENAME_FONT); $staffPos = @intval($NOTENAME_POSITION); $abortMsg = false; $txtout = ""; // $clip = new NWC2Clip('php://stdin'); if (!$useLyric) { $txtout .= $clip->GetClipHeader() . "\n"; } if ($clip->Mode != "Single") { trigger_error("Clip mode of {$clip->Mode} is not supported", E_USER_ERROR); } if ($clip->Version > "2.5") { trigger_error("The notation clip uses an unknown format version ({$clip->Version}), so it may not be processed correctly", E_USER_NOTICE); } $barnotecnt = 0; $PlayContext = new NWC2PlayContext(); foreach ($clip->Items as $item) { $o = new NWC2ClipItem($item, true); if ($o->IsContextInfo()) { $PlayContext->UpdateContext($o); continue; }