Ejemplo n.º 1
0
nwsw_Unjazzify Version 1.11

This script will find note pairs where the first note is a dotted note, 
and the second is half the notehead duration of the first and is not dotted.
It will convert the pair into two notes of equal duration.

Copyright © 2006 by NoteWorthy Software, Inc.
All Rights Reserved

History:
[2006-05-12] Version 1.11 - Include in starter kit
[2006-05-09] Version 1.10 - Process rests, unbeamed notes, and quarter notes
[2006-05-09] Version 1.00 - Initial release
*******************************************************************************/
require_once "lib/nwc2clips.inc";
$clip = new NWC2Clip('php://stdin');
//
$validPairs = array("4th" => "8th", "8th" => "16th", "16th" => "32nd", "32nd" => "64th");
//
// Track the number of conversions
$numConvertedPairs = 0;
//
// Track the previous note if it is eligible for conversion
$priorNoteObj = false;
$targetEndingDuration = false;
//
// Track any items that fall between the two notes in the group
$NonNoteQ = "";
//
function FlushTheGroupingQ()
{
Ejemplo n.º 2
0
This script demonstrates how to work with bar numbers from within a user tool.
It adds a hidden text instruction to the start of every measure in a staff of
the form: "Bar #"

Copyright © 2010 by NoteWorthy Software, Inc.
All Rights Reserved

HISTORY:
================================================================================
[2010-02-27] Version 1.0: Initial release
*******************************************************************************/
require_once "lib/nwc2clips.inc";
$abortMsg = false;
//
$clip = new NWC2Clip('php://stdin');
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);
}
function IsPossibleBarNumber(&$o)
{
    return $o->GetObjType() == "Text" && preg_match('/^Bar [0-9]+$/', $o->GetTaggedOpt('Text', ""));
}
$pendingOutput = array();
$priorBarIndex = -1;
//
echo $clip->GetClipHeader() . "\n";
$PlayContext = new NWC2PlayContext();
Ejemplo n.º 3
0
and <digits> indicate how far from the centre line
eg
#0 means notes that are on the centre line but have a single sharp accidental
bb-1 means double flat notes in the space below the centre line
7 means notes an octave above the centre line');
    }
}
// process other optional arguments, in no particular order
foreach ($argv as $arg) {
    if (preg_match("/^nosingle\$/", $arg)) {
        $single = 0;
    } else {
        abort("Unrecognised parameter '{$arg}'");
    }
}
$clip = new NWC2Clip('php://stdin');
echo $clip->GetClipHeader() . "\n";
$nothingToDo = TRUE;
foreach ($clip->Items as $item) {
    $nothingToDo = FALSE;
    $o = new NWC2ClipItem($item);
    $oType = $o->GetObjType();
    if (!in_array($oType, array("Note", "Chord", "Rest", "RestChord"))) {
        // not an item of interest, pass it thru
        echo $item;
    } elseif ($gobbleTime > 0) {
        // run down the gobble clock, don't print the item
        $gobbleTime -= timeTaken($o);
    } elseif ($passTime > 0) {
        $passTime -= timeTaken($o);
        echo $item;
Ejemplo n.º 4
0
            $NOTENAME_FONT = $m[1];
        } else {
            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);