// if ($is_dotted && !$is_grace && $starterDuration && (!$is_beamed || $is_beamstart)) { $targetEndingDuration = $validPairs[$starterDuration]; $priorNoteObj = $o; continue; } // echo $item; } else { if (in_array($targetEndingDuration, array_keys($o->Opts["Dur"])) && !$is_beamstart && !$is_dotted && !$is_dbldotted) { $numConvertedPairs++; unset($priorNoteObj->Opts["Dur"]["Dotted"]); unset($o->Opts["Dur"][$targetEndingDuration]); $o->Opts["Dur"][$starterDuration] = ""; FlushTheGroupingQ(); echo $o->ReconstructClipText() . "\n"; } else { FlushTheGroupingQ(); echo $item; } } continue; } if (in_array($o->GetObjType(), array("Bar", "TimeSig"))) { FlushTheGroupingQ(); echo $item; continue; } if ($priorNoteObj) { $NonNoteQ .= $item; } else {
<?php require_once "lib/nwc2clips.inc"; $clip = new NWC2Clip('php://stdin'); foreach ($clip->Items as $item) { $o = new NWC2ClipItem($item); echo "Ref: {$item}"; echo "New: " . $o->ReconstructClipText() . "\n"; unset($o); } $usermsg = <<<__EOMSG See the standard output file for a comparison of the library output to the input clip. __EOMSG; // fputs(STDERR, $usermsg); exit(NWC2RC_REPORT);
<?php require_once "lib/nwc2clips.inc"; $clip = new NWC2Clip('php://stdin'); foreach ($clip->Items as $item) { $o = new NWC2ClipItem($item); if ($o->IsContextInfo()) { continue; } $origLine = trim($item); $newLine = $o->ReconstructClipText(); if ($newLine != $origLine) { echo "Ref: {$origLine}\nNew: {$newLine}\n\n"; } } $usermsg = <<<__EOMSG See the standard output file for a comparison of the library output to the input clip. __EOMSG; // fputs(STDERR, $usermsg); exit(NWC2RC_REPORT);
require_once "lib/nwc2clips.inc"; $do_warning = false; $numchanges = 0; $zin = gzopen('php://stdin', 'rb'); $zout = gzopen('php://stdout', 'wb'); while (!gzeof($zin)) { $l = gzgets($zin, 32000); if (preg_match('/^\\|Spacer/', $l)) { $spacer = new NWC2ClipItem($l); if (!empty($spacer->Opts["Width"])) { if ($spacer->Opts["Width"] > 60) { $do_warning = true; } $spacer->Opts["Width"] *= 25; $l = $spacer->ReconstructClipText() . "\r\n"; $numchanges++; } } gzwrite($zout, $l); } gzclose($zout); gzclose($zin); if (!$numchanges) { fputs(STDERR, "No spacers were found."); exit(NWC2RC_ERROR); } if ($do_warning) { fputs(STDERR, "A spacer larger than 15 note head widths was encountered in this file. This indicates that this file has already been upgraded to " . "the new spacer width resolution and you should not apply the upgrade conversion again.\n\n" . "Is is recommneded that you press the Cancel button now."); } exit(NWC2RC_SUCCESS);
$Opt_inc = $loop ? "2" : ""; $OptName_Pos = "Pos" . $Opt_inc; $OptName_Dur = "Dur" . $Opt_inc; $pitchpos =& $o_new->GetTaggedOpt($OptName_Pos); if (is_string($pitchpos)) { ProcessNote($pitchpos); } else { if (is_array($pitchpos)) { foreach ($pitchpos as &$notepitchTxt) { ProcessNote($notepitchTxt); } } } } if ($isChanged) { echo $o_new->ReconstructClipText() . "\n"; } } if (!$isChanged) { echo $item; } $PlayContext->UpdateContext($o); } echo NWC2_ENDCLIP . "\n"; //exit(NWC2RC_REPORT); //exit(NWC2RC_ERROR); exit(NWC2RC_SUCCESS); function ProcessNote(&$notepitchTxt) { global $PlayContext, $o, $OptName_Pos, $OptName_Dur, $isChanged, $regexList; static $accmap = array("v" => "bb", "b" => "b", "n" => "n", "#" => "#", "x" => "x");
} if ($PlayContext->IsTieReceiver($notepitchObj)) { $WarnAboutInboundTie = true; } } foreach (array('Color', 'Visibility') as $baseprop) { if (!empty($o->Opts[$baseprop])) { $userObj->Opts[$baseprop] = $o->Opts[$baseprop]; } } if ($ARPEGGIO_SEQUENCE == "down") { $userObj->Opts['Dir'] = 'down'; } $chordDurMinRate = nw_aafield($ARPDURConvert, $baseDur, 32) * 4; $userObj->Opts['Rate'] = max($chordDurMinRate, $ARPEGGIO_DURATION); echo $userObj->ReconstructClipText() . "\n"; // Now mute the chord if (empty($o->Opts['Opts'])) { $o->Opts['Opts'] = array(); } $o->Opts['Opts']['Muted'] = ''; echo $o->ReconstructClipText() . "\n"; } else { echo $item; } if ($o->GetUserObjType() == 'Arpeggio.ms') { $ArpeggioAllowedHere = false; } else { if (in_array($o->GetObjType(), array('Note', 'Chord', 'Rest', 'RestChord'))) { $ArpeggioAllowedHere = !isset($o->Opts["Dur"]["Grace"]); } else {