1
General Discussion / First submission to imslp
The scan of the music plus a pdf that NWC created is on imslp.org .
My NWC transcription has been on Scriptorium for several years.
This section allows you to view all Topics made by this member. Note that you can only see Topics made in areas you currently have access to.
!NoteWorthyComposerClip(2.751,Single)
|Tempo|Tempo:108|Text:"Pas vite (gai)"|Pos:14
|Clef|Type:Treble
|Key|Signature:F#,C#,G#,D#,A#|Tonic:B
|TimeSig|Signature:2/4
|Tempo|Tempo:36|Pos:7
|Note|Dur:8th,Tenuto|Pos:-6|Opts:Stem=Up,Beam=First
|Note|Dur:8th,Tenuto|Pos:-6|Opts:Stem=Up,Beam=End
|Note|Dur:8th|Pos:-9|Opts:Stem=Up,Beam=First
|Note|Dur:64th,Slur|Pos:n-8|Opts:Stem=Up,Beam
|Note|Dur:64th,Slur|Pos:-7|Opts:Stem=Up,Beam
|Note|Dur:64th,Slur|Pos:-6|Opts:Stem=Up,Beam
|Note|Dur:64th,Slur|Pos:-5|Opts:Stem=Up,Beam
|Note|Dur:64th,Slur|Pos:-4|Opts:Stem=Up,Beam
|Note|Dur:64th,Slur|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:64th,Slur|Pos:-2|Opts:Stem=Up,Beam
|Note|Dur:64th,Slur|Pos:n-1|Opts:Stem=Up,Beam=End
|Bar
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet=First|Pos:0|Opts:Stem=Down,Beam=First
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet|Pos:1|Opts:Stem=Down,Beam
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet=End|Pos:n2|Opts:Stem=Down,Beam=End
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet=First|Pos:3|Opts:Stem=Down,Beam=First
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet|Pos:4|Opts:Stem=Down,Beam
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet=End|Pos:n5|Opts:Stem=Down,Beam=End
|Bar
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet=First|Pos:n6|Opts:Stem=Down,Beam=First
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet|Pos:7|Opts:Stem=Down,Beam
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet=End|Pos:8|Opts:Stem=Down,Beam=End
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet=First|Pos:#9|Opts:Stem=Down,Beam=First
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet|Pos:10|Opts:Stem=Down,Beam
|User|TremoloSingle.ms|Pos:-2|Beams:1
|Note|Dur:8th,Triplet=End|Pos:#10|Opts:Stem=Down,Beam=End
|Bar
!NoteWorthyComposerClip-End
function calculate(clip) {
var i, saveDur, saveDurB, saveDurE;
var lines = new Array(), result = new Array();
lines = clip.split("\r\n");
for (i=0; i < lines.length; i++) {
result=lines[i].match(/(.*Dur:)([^\|]*)(.*$)/);
if (result == null)
continue; // No duration, didn't follow grace note.
if (lines[i].indexOf("Grace") > 0) { // Found a grace note/chord
continue; }
if (lines[i].indexOf("Rest") > 0) { // Found a rest, ignore
continue; }
// shell.popUp(lines[i]);
saveDur = result[2];
//shell.popUp(saveDur);
saveDur = saveDur.replace("32nd","64th");
saveDur = saveDur.replace("16th","32nd");
saveDur = saveDur.replace("8th","16th");
saveDur = saveDur.replace("4th","8th");
saveDur = saveDur.replace("Half","4th");
saveDur = saveDur.replace("Whole","Half");
shell.popUp(saveDur);
// thisDur = getNoteLength(saveDur);
// shell.popUp(saveDur);
// Code to manipulate durations goes here
saveDurB = saveDur.replace("=End",""); // In case of triplets.
saveDurE = saveDur.replace("=First",""); // In case of triplets.
lines[i] = "|Rest|Dur:" + saveDurB + "\r\n" + result[1] + saveDurE + result[3];
}
return lines;
So far, so good except it changes a 32nd note to a 68th note.!NoteWorthyComposerClip(2.751,Single)Please hold off 24 hours after this is posted to let others take a shot at it.
|MPC|Controller:vol|Style:Linear Sweep|TimeRes:Sixteenth|SweepRes:1|Pt1:0,127|Pt2:1,123|Pt3:1,120|Pos:-6
|DynamicVariance|Style:Sforzando|Pos:-8
|Note|Dur:8th,DblDotted,Slur|Pos:n-3|Opts:Stem=Up,Beam=First
|Note|Dur:32nd|Pos:-4|Opts:Stem=Up,Beam=End
|Note|Dur:4th|Pos:-4^
|Note|Dur:8th|Pos:-4
|Note|Dur:4th,Tenuto|Pos:-3
|Note|Dur:8th,Tenuto|Pos:-3
|Bar
!NoteWorthyComposerClip-End
!NoteWorthyComposerClip(2.751,Single)
|Clef|Type:Treble
|Key|Signature:F#|Tonic:G
|TimeSig|Signature:5/4
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:-2
|Note|Dur:8th|Pos:-4
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-7
|Note|Dur:4th|Pos:-5
|Bar
!NoteWorthyComposerClip-End
WScript.StdErr.Write(WScript.StdIn.ReadAll());
WScript.quit(1);
!NoteWorthyComposerClip(2.751,Single)
|Rest|Dur:Half,Dotted
|Chord|Dur:4th|Pos:-2,1
|Bar
|Chord|Dur:4th,Dotted|Pos:-1,1
|Chord|Dur:8th|Pos:-1^,1^
|Chord|Dur:4th|Pos:-1,1|Opts:Stem=Down
|Note|Dur:16th|Pos:0|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam
|Note|Dur:64th|Pos:n1|Opts:Stem=Down,Beam
|Note|Dur:32nd,Dotted|Pos:#1|Opts:Stem=Down,Beam=End
|Bar
|Chord|Dur:Half,Dotted|Pos:1,3
|Chord|Dur:8th|Pos:1,3|Opts:Stem=Down,Beam=First
|Chord|Dur:8th|Pos:1,3|Opts:Stem=Down,Beam=End
!NoteWorthyComposerClip-End
!NoteWorthyComposerClip(2.751,Single)Can this be done with an object now? I don't want to add a hidden staff if at all possible.
|Chord|Dur:16th,Slur|Pos:5|Opts:Stem=Up,Beam=First,XDotSpace=-1|Dur2:8th,Dotted|Pos2:-1
|Note|Dur:16th,Slur|Pos:4|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:3|Opts:Stem=Up,Beam=End
|Chord|Dur:16th,Slur|Pos:5|Opts:Stem=Up,Beam=First,XDotSpace=-1|Dur2:8th,Dotted|Pos2:-1
|Note|Dur:16th,Slur|Pos:4|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:3|Opts:Stem=Up,Beam=End
!NoteWorthyComposerClip-End
!NoteWorthyComposerClip(2.751,Single)
|Key|Signature:F#,C#,G#,D#|Tonic:E
|Note|Dur:32nd,Dotted,Slur|Pos:8|Opts:Stem=Down,Beam=First
|Note|Dur:32nd,DblDotted,Slur|Pos:5|Opts:Stem=Down,Beam
|Note|Dur:32nd,Dotted,Slur|Pos:3|Opts:Stem=Down,Beam
|Note|Dur:32nd,DblDotted,Slur|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:32nd,Dotted,Slur|Pos:-2|Opts:Stem=Down,Beam=End
|Note|Dur:32nd,Dotted,Slur|Pos:-6|Opts:Stem=Down,Beam=First
|Note|Dur:32nd,DblDotted,Slur|Pos:-2|Opts:Stem=Down,Beam
|Note|Dur:32nd,Dotted,Slur|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:32nd,DblDotted,Slur|Pos:3|Opts:Stem=Down,Beam
|Note|Dur:32nd,Dotted|Pos:5|Opts:Stem=Down,Beam=End
|Note|Dur:32nd,Dotted,Slur|Pos:8|Opts:Stem=Down,Beam=First
|Note|Dur:32nd,DblDotted,Slur|Pos:5|Opts:Stem=Down,Beam
|Note|Dur:32nd,Dotted,Slur|Pos:3|Opts:Stem=Down,Beam
|Note|Dur:32nd,DblDotted,Slur|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:32nd,Dotted,Slur|Pos:-2|Opts:Stem=Down,Beam=End
|Note|Dur:32nd,Dotted,Slur|Pos:-6|Opts:Stem=Down,Beam=First
|Note|Dur:32nd,DblDotted,Slur|Pos:-2|Opts:Stem=Down,Beam
|Note|Dur:32nd,Dotted,Slur|Pos:1|Opts:Stem=Down,Beam
|Note|Dur:32nd,DblDotted,Slur|Pos:3|Opts:Stem=Down,Beam
|Note|Dur:32nd,Dotted|Pos:5|Opts:Stem=Down,Beam=End
|Bar
!NoteWorthyComposerClip-End
!NoteWorthyComposer(2.751)How do I get the last section to repeat?
|Editor|ActiveStaff:1|CaretIndex:1|CaretPos:0
|SongInfo|Title:"Eine Kleine Nachtmusik K. 525 2 - Romanze"|Author:"Mozart"|Lyricist:""|Copyright1:""|Copyright2:""|Comments:"Transcription: Warren Porter"
|PgSetup|StaffSize:18|Zoom:4|TitlePage:Y|JustifyVertically:Y|PrintSystemSepMark:N|ExtendLastSystem:N|DurationPadding:Y|PageNumbers:1|StaffLabels:First System|BarNumbers:Boxed|StartingBar:0
|Font|Style:StaffItalic|Typeface:"Times New Roman"|Size:11.45|Bold:Y|Italic:Y|CharSet:0
|Font|Style:StaffBold|Typeface:"Times New Roman"|Size:8.18|Bold:Y|Italic:N|CharSet:0
|Font|Style:StaffLyric|Typeface:"Times New Roman"|Size:8.18|Bold:N|Italic:N|CharSet:0
|Font|Style:PageTitleText|Typeface:"Times New Roman"|Size:24|Bold:Y|Italic:N|CharSet:0
|Font|Style:PageText|Typeface:"Times New Roman"|Size:12|Bold:N|Italic:N|CharSet:0
|Font|Style:PageSmallText|Typeface:"Times New Roman"|Size:8|Bold:N|Italic:N|CharSet:0
|Font|Style:User1|Typeface:"AR DECODE"|Size:72|Bold:N|Italic:N|CharSet:1
|Font|Style:User2|Typeface:"Times New Roman"|Size:5|Bold:N|Italic:N|CharSet:0
|Font|Style:User3|Typeface:"Times New Roman"|Size:5|Bold:N|Italic:N|CharSet:0
|Font|Style:User4|Typeface:"Times New Roman"|Size:5|Bold:N|Italic:N|CharSet:0
|Font|Style:User5|Typeface:"Times New Roman"|Size:8|Bold:N|Italic:N|CharSet:0
|Font|Style:User6|Typeface:"Times New Roman"|Size:8|Bold:N|Italic:N|CharSet:0
|PgMargins|Left:2.54|Top:2.54|Right:2.54|Bottom:2.54|Mirror:N
|AddStaff|Name:"Conductor"|Group:"Standard"
|StaffProperties|EndingBar:Master Repeat Close|Visible:Y|BoundaryTop:10|BoundaryBottom:10|Lines:1|WithNextStaff:Layer|Color:Default
|StaffProperties|Muted:N|Volume:127|StereoPan:64|Device:0|Channel:6
|StaffInstrument|Trans:0|DynVel:10,30,45,60,75,92,108,127
|TimeSig|Signature:3/4
|Spacer|Width:125
|Tempo|Tempo:168|Text:"Allegretto"|Pos:10.5
|Rest|Dur:4th|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Whole|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Whole|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Whole|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Half|Visibility:Never
|Bar|Style:MasterRepeatClose|XBarCnt:Y
|Bar|Style:MasterRepeatOpen|XBarCnt:Y
|Rest|Dur:4th|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Whole|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Whole|Visibility:Never
|Bar
|Rest|Dur:Whole|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Half|Visibility:Never
|Flow|Style:Fine|Pos:-8|Wide:Y
|Bar|Style:MasterRepeatClose|XBarCnt:Y
|Bar|Style:MasterRepeatOpen|XBarCnt:Y
|Text|Text:"Trio"|Font:PageTitleText|Pos:10.5
|Rest|Dur:4th|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Whole|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Whole|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Half|Visibility:Never
|Bar|Style:MasterRepeatClose|XBarCnt:Y
|Bar|Style:MasterRepeatOpen|XBarCnt:Y
|Rest|Dur:4th|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Whole|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Whole|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Whole|Visibility:Never
|Bar|Visibility:Never
|Rest|Dur:Half|Visibility:Never
|Flow|Style:DCalFine|Pos:-7|Wide:Y
!NoteWorthyComposer-End
switch(saveText) {
case "e":
case "?":
case "": //Natural
saveAcc = "n";
break;
case "f":
case "": //Flat
saveAcc = "b";
break;
case "d":
case "": //Sharp
saveAcc = "#";
break;
case "g": // Double sharp
case "":
saveAcc = "x";
break;
case "h": // Double Flat
case "":
saveAcc = "v";
break;
default:
errMsg+= ti + "->" + saveText + "<- " + lines[i] + "\n";
errMsg += "Couldn't find accidental in " + lines[ti], rc = 1; return lines; // change += to = when live
}
!NoteWorthyComposerClip(2.751,Single)Is there a better way to fix this?
|Bar
|Note|Dur:4th|Pos:-3
|Chord|Dur:4th|Pos:#-8,-4
|Chord|Dur:4th|Pos:-8,-4,-2
|Bar
|RestChord|Dur:4th|Opts:Stem=Down,ArticulationsOnStem|Dur2:Half|Pos2:-3
|Chord|Dur:4th|Pos:#-8,-4|Opts:Stem=Down
|Chord|Dur:4th|Pos:-8,-4,-2
!NoteWorthyComposerClip-End
!NoteWorthyComposerClip(2.751,Single)the violin is sliding from a C# down to a F# but the slide is going up. How do I fix this?
|Dynamic|Style:f|Pos:-11
|Note|Dur:Half|Pos:10^
|Note|Dur:8th,Dotted|Pos:10|Opts:Stem=Down,Beam=First
|Text|Text:"2"|Font:StaffItalic|Pos:13|Placement:AtNextNote
|Note|Dur:16th,Slur|Pos:7|Opts:Stem=Down,Beam=End
|Bar
|User|Glissando.ms|Pos:8|Text:|Weight:1.4
|Text|Text:"2"|Font:StaffItalic|Pos:14|Placement:AtNextNote
|Note|Dur:Half|Pos:9^|Opts:Diminuendo
|Note|Dur:8th,Dotted|Pos:9|Opts:Stem=Down,Diminuendo,Beam=First
|Text|Text:"1"|Font:StaffItalic|Pos:12|Placement:AtNextNote
|Note|Dur:16th,Slur|Pos:8|Opts:Stem=Down,Diminuendo,Beam=End
|Bar
|Text|Text:"1"|Font:StaffItalic|Pos:8|Placement:AtNextNote
|User|Glissando.ms|Pos:8|Text:|Weight:1.4
|Note|Dur:Half,Dotted|Pos:4^|Opts:Diminuendo
!NoteWorthyComposerClip-End
/* Notes to Rests by Warren Porter "graceFix.js"
After downloading this file, when setting it up in NWC User Tools create this command line:
wscript "'Browse can insert the path for you' \graceFix.js" <PROMPT:Which?:=|Prev|Next>
This converts grace notes to real ones while reducing the duration of the previous object. First, copy an entire staff (which
you will make visible and muted) to the clipboard, create a new staff (will eventually be hidden and played),
then copy the clipboard to the new staff. Run this command on that new staff. Notes, chords, or rests which are followed
by grace notes will be shortened by the (total) duration of the grace notes and the grace attribute will be removed.
The original (and still on the displayed/muted staff) grace notes will now sound BEFORE the beat instead of ON the beat.
Change: You can take time from the note/chord AFTER the grace note(s) by chosing "Next"
*/
// Substitutions: Wscript.Arguments <-> parms
// Item(n) <-> [n]
var rc=0, errMsg="", Wscript_Arguments = new Array();
var NoteLengths = [ "Whole", "Half", "4th", "8th", "16th", "32nd", "64th", "128th", "256th", "512th", "1024th" ] ;
var SearchDur;
function getNoteLength(notelet) { // Returns duration of note , whole = 768
// var shell = new ActiveXObject("WScript.Shell");
parts = notelet.split(","), numParts=1;
var noteLength= -1, searchstr="";
searchstr = parts[0].substr(0,3);
//shell.Popup(parts[0])
switch (searchstr) {
case "Who" : noteLength = 768; break;
case "Hal" : noteLength = 384; break;
case "4th" : noteLength = 192; break;
case "8th" : noteLength = 96; break;
case "16t" : noteLength = 48; break;
case "32n" : noteLength = 24; break;
case "64t" : noteLength = 12; break;
default: noteLength = -1;
}
if (noteLength == -1)
return -1;
for (var i = 1; i < parts.length; i++) {
if (parts[i].substr(0,9) == "DblDotted") {
numParts=2;
noteLength = noteLength * 7 / 4; }
else
if (parts[i].substr(0,6) == "Dotted") {
numParts=2;
noteLength = noteLength * 3 / 2; }
else
if (parts[i].substr(0,7) == "Triplet") {
numParts=2;
noteLength = noteLength * 2 / 3; } }
SearchDur = (numParts == 1)? parts[0]: parts[0] + "," + parts[1]
return noteLength;
}
function doNext(clip) {
var i, durTable = new Array(), newDur, binString="", saveDur, subDur=0, durSub = new Array(), saveOrig, newStrings = new Array();
var lines = new Array(), result = new Array(), lastDur = 0, locDur=0, locGraceFst, locGraceLst, durGrace, sumGrace=0
var saveBar="", locBar= -1, wholeRest=768;
lines = clip.split("\n");
for (i=0; i < lines.length; i++) {
result=lines[i].match(/Dur:([^\|]*)/);
if (sumGrace && (result == null)) {
errMsg="Unattached Grace note";
rc=1;
return lines; }
if (result == null)
continue; // No duration, didn't follow grace note.
if (lines[i].indexOf("Grace") > 0) { // Found a grace note/chord
durGrace = getNoteLength(result[1]); // Find duration
sumGrace+= durGrace; // Sum of grace notes so far
lines[i]=lines[i].replace(",Grace",""); // Remove grace attribute
continue; }
if (!sumGrace) // If has duration, is not grace, and doesn't follow grace
continue; // Ignore
/*
At this point something with a duration follows (a) Grace Note/Chord(s) and its duration must be reduced
by sumGrace.
*/
lastDur = getNoteLength(result[1]);
saveDur = SearchDur;
newDur = (lastDur - sumGrace)
if ((newDur % 3) != 0) {
lines[i]+="\n|Text|Text:\"Can't do triplets.\"|Font:StaffItalic|Pos:10|Color:1"
break; }
newDur /= 3;
if (newDur < 4) {
errMsg="Note to convert isn't long enough, aborting.";
rc=1;
return lines;}
binString=""
for (var ii=0; ii < 9; ii++) { //Convert to binary
binString = (newDur % 2) + binString;
newDur = Math.floor(newDur/2); }
durTable.length = 0, subDur=0;
while (binString != "000000000") {
for (ii=0; ii < 3; ii++)
durSub[ii] = Number.POSITIVE_INFINITY;
result = binString.match("111")
if (result != null)
durSub[0] = result.index;
result = binString.match("110")
if (result != null)
durSub[1] = result.index;
result = binString.match("10")
if (result != null)
durSub[2] = result.index;
if (durSub[0] <= durSub[1] && durSub[0] <= durSub[2]) {
durTable[subDur++] = NoteLengths[durSub[0]] + ",DblDotted";
binString = binString.replace("111","000");
continue;}
if (durSub[1] < durSub[0] && durSub[1] <= durSub[2]) {
durTable[subDur++] = NoteLengths[durSub[1]] + ",Dotted";
binString = binString.replace("11","00");
continue;}
if (durSub[2] < durSub[0] && durSub[2] < durSub[1]) {
durTable[subDur++] = NoteLengths[durSub[2]];
binString = binString.replace("1","0");
continue;} }
// Code to manipulate durations goes here
saveOrig = lines[i]; // Save so can modify it several times if necess;
newStrings.length = 0;
for (ii = 0; ii < subDur;ii++) {
newStrings[ii] = saveOrig.replace(saveDur,durTable[ii]);
if (((subDur - 1) > ii) && (saveOrig.slice(0,6) != "|Rest|")) {
newStrings[ii] = newStrings[ii].replace(/(\d),/g, "$1^,"); ;
newStrings[ii] = newStrings[ii].replace(/$/, "^");
newStrings[ii] = newStrings[ii].replace("^^", "^"); } }
lines[i] = newStrings.join("\r\n");
sumGrace=0; } // So will not try to apply reductions again.
return lines;
}
function doPrev(clip) {
var i, durTable = new Array(), newDur, binString="", saveDur, subDur=0, durSub = new Array(), saveOrig, newStrings = new Array();
var lines = new Array(), result = new Array(), lastDur = 0, locDur=0, locGraceFst, locGraceLst, durGrace, sumGrace=0
var saveBar="", locBar= -1, wholeRest=768;
// lines = clip.split("\r\n");
lines = clip.split("\n");
for (i=0; i < lines.length; i++) {
if (lines[i].slice(0,4) == "|Bar") {
saveBar = lines[i];
locBar=i;
continue;
}
if (lines[i].slice(0,8) == "|TimeSig") {
result = lines[i].match(/re:(\d+)\/(\d+)/);
if (result != null)
wholeRest = 768 * result[1] / result[2];
continue; }
result=lines[i].match(/Dur:([^\|]*)/);
if (result == null)
continue;
if (lines[i].indexOf("Grace") == -1) { // Found something with duration not a grace note
lastDur = getNoteLength(result[1]);
saveDur = SearchDur;
locBar= -1; // This measure didn't start with (a) grace(s) note/chord.
locDur = i;
if (lines[i].slice(0,5) == "|Rest" && lastDur == 768)
lastDur = wholeRest; } // In case we need it.
else { // Found a grace note to convert
locGraceFst=i;
sumGrace=0;
for (locGraceLst=i; locGraceLst < lines.length; locGraceLst++) {
result=lines[locGraceLst].match(/Dur:([^\|]*)/);
var buggy = lines[locGraceLst].indexOf("Grace");
// if ((result == null) || (lines[locGraceLst].indexOf("Grace") > -1)) {// Doesn't have duration or not grace
// break; }
if (result == null)
break;
if (buggy == -1)
break;
durGrace = getNoteLength(result[1]);
sumGrace+= durGrace;}
locGraceLst--;
if (locDur > 0) { //There was something with duration earlier so will have to reduce it.
newDur = (lastDur - sumGrace)
if ((newDur % 3) != 0) {
lines[locGraceLst]+="\n|Text|Text:\"Can't do triplets.\"|Font:StaffItalic|Pos:10|Color:1"
break; }
newDur /= 3;
if (newDur < 4) {
errMsg="Note to convert isn't long enough, aborting.";
rc=1;
return lines;}
binString=""
for (var ii=0; ii < 9; ii++) { //Convert to binary
binString = (newDur % 2) + binString;
newDur = Math.floor(newDur/2); }
durTable.length = 0, subDur=0;
while (binString != "000000000") {
for (ii=0; ii < 3; ii++)
durSub[ii] = Number.POSITIVE_INFINITY;
result = binString.match("111")
if (result != null)
durSub[0] = result.index;
result = binString.match("110")
if (result != null)
durSub[1] = result.index;
result = binString.match("10")
if (result != null)
durSub[2] = result.index;
if (durSub[0] <= durSub[1] && durSub[0] <= durSub[2]) {
durTable[subDur++] = NoteLengths[durSub[0]] + ",DblDotted";
binString = binString.replace("111","000");
continue;}
if (durSub[1] < durSub[0] && durSub[1] <= durSub[2]) {
durTable[subDur++] = NoteLengths[durSub[1]] + ",Dotted";
binString = binString.replace("11","00");
continue;}
if (durSub[2] < durSub[0] && durSub[2] < durSub[1]) {
durTable[subDur++] = NoteLengths[durSub[2]];
binString = binString.replace("1","0");
continue;} }
// Code to manipulate durations goes here
saveOrig = lines[locDur]; // Save so can modify it several times if necess;
newStrings.length = 0;
for (ii = 0; ii < subDur;ii++) {
newStrings[ii] = saveOrig.replace(saveDur,durTable[ii]);
if (((subDur - 1) > ii) && (saveOrig.slice(0,6) != "|Rest|")) {
newStrings[ii] = newStrings[ii].replace(/(\d),/g, "$1^,"); ;
newStrings[ii] = newStrings[ii].replace(/$/, "^");
newStrings[ii] = newStrings[ii].replace("^^", "^"); } }
lines[locDur] = newStrings.join("\r\n"); }
for (ii = locGraceFst; ii <= locGraceLst; ii++)
lines[ii]=lines[ii].replace(",Grace","");
if (locBar > -1) {
lines[locGraceLst]+= "\n" + saveBar; // Add barline after the grace notes
lines[locBar] = "#"; } // Turn original bar into a comment.
if (locDur == 0)
lines[locGraceLst]+="\n|Bar\n|Text|Text:\"New bar added\"|Font:StaffItalic|Pos:8|Color:1";
i=locGraceLst; // So won't try to redo the same string of grace notes.
}
} //End main processing loop
return lines;
}
var myLines;
if (WScript.Arguments.length != 1) {
errMsg="NO Prompt read.";
rc=1; }
else {
if (WScript.Arguments.Item(0).slice(0,4) == "Prev")
myLines=doPrev(WScript.StdIn.ReadAll()).join("\r\n");
else
myLines=doNext(WScript.StdIn.ReadAll()).join("\r\n"); }
if (rc == 0)
WScript.StdOut.Write(myLines);
else
WScript.StdErr.Write(errMsg);
WScript.quit(rc);
!NoteWorthyComposer(2.751)
|Editor|ActiveStaff:1|CaretIndex:5|CaretPos:0
|SongInfo|Title:""|Author:"<Name>"|Lyricist:""|Copyright1:"Copyright © 2008 <Name>"|Copyright2:"All Rights Reserved"
|PgSetup|StaffSize:16|Zoom:4|TitlePage:Y|JustifyVertically:Y|PrintSystemSepMark:N|ExtendLastSystem:N|DurationPadding:Y|PageNumbers:0|StaffLabels:None|BarNumbers:None|StartingBar:1
|Font|Style:StaffItalic|Typeface:"Times New Roman"|Size:10|Bold:Y|Italic:Y|CharSet:0
|Font|Style:StaffBold|Typeface:"Times New Roman"|Size:8|Bold:Y|Italic:N|CharSet:0
|Font|Style:StaffLyric|Typeface:"Times New Roman"|Size:7|Bold:N|Italic:N|CharSet:0
|Font|Style:PageTitleText|Typeface:"Times New Roman"|Size:24|Bold:Y|Italic:N|CharSet:0
|Font|Style:PageText|Typeface:"Times New Roman"|Size:12|Bold:N|Italic:N|CharSet:0
|Font|Style:PageSmallText|Typeface:"Times New Roman"|Size:8|Bold:N|Italic:N|CharSet:0
|Font|Style:User1|Typeface:"Boxmark2"|Size:16|Bold:N|Italic:N|CharSet:0
|Font|Style:User2|Typeface:"Times New Roman"|Size:8|Bold:N|Italic:N|CharSet:0
|Font|Style:User3|Typeface:"Times New Roman"|Size:8|Bold:N|Italic:N|CharSet:0
|Font|Style:User4|Typeface:"Times New Roman"|Size:8|Bold:N|Italic:N|CharSet:0
|Font|Style:User5|Typeface:"Times New Roman"|Size:8|Bold:N|Italic:N|CharSet:0
|Font|Style:User6|Typeface:"Times New Roman"|Size:8|Bold:N|Italic:N|CharSet:0
|PgMargins|Left:1.27|Top:1.27|Right:1.27|Bottom:1.27|Mirror:N
|AddStaff|Name:"Staff"|Group:"Standard"
|StaffProperties|EndingBar:Section Close|Visible:Y|BoundaryTop:12|BoundaryBottom:12|Lines:5|Color:Default
|StaffProperties|Muted:N|Volume:127|StereoPan:64|Device:0|Channel:1
|StaffInstrument|Name:"Violin"|Patch:40|Trans:0|DynVel:10,30,45,60,75,92,108,127
|PerformanceStyle|Style:Legato|Pos:0|Visibility:Never
|Clef|Type:Treble
|TimeSig|Signature:4/4
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-1
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:1
|Bar
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-1
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:1
|Bar|Style:MasterRepeatOpen
|Flow|Style:Segno|Pos:11|Wide:Y
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-1
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:1
|Bar
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-1
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:1
|Flow|Style:ToCoda|Pos:5|Wide:Y
|Bar
|Ending|Endings:1
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-1
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:1
|Bar|Style:MasterRepeatClose
|Ending|Endings:2
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-1
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:1
|Bar
|Note|Dur:4th|Pos:5
|Note|Dur:4th|Pos:6
|Note|Dur:4th|Pos:7
|Note|Dur:4th|Pos:8
|Bar
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=End
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam=End
|Note|Dur:8th|Pos:-2|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=End
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam=End
|Flow|Style:DSalCoda|Pos:8|Justify:Right|Placement:BestFitForward
|Bar|Style:Double
|Flow|Style:Coda|Pos:8|Wide:Y
|Chord|Dur:Whole|Pos:-1,1
|AddStaff|Name:"Staff-1"|Group:"Standard"
|StaffProperties|EndingBar:Section Close|Visible:Y|BoundaryTop:10|BoundaryBottom:22|Lines:5|Color:Default
|StaffProperties|Muted:N|Volume:127|StereoPan:64|Device:0|Channel:2
|StaffInstrument|Trans:0|DynVel:10,30,45,60,75,92,108,127
|Lyrics|Placement:Bottom|Align:Standard Rules|Offset:0
|Lyric1|Text:"verse one verse one verse one verse one verse one verse one verse one verse one verse one verse one\n"
|Lyric2|Text:"verse two verse two verse two verse two verse two verse two verse twoverse two verse two verse two verse two verse two verse two verse two\n"
|Lyric3|Text:"verse three verse three verse three verse three verse three verse three verse three verse three verse three verse three verse three verse three\n"
|Clef|Type:Treble
|TimeSig|Signature:4/4
|Rest|Dur:Whole
|Bar
|Rest|Dur:Half
|Rest|Dur:4th
|Rest|Dur:8th
|Note|Dur:8th|Pos:-2
|Bar|Style:MasterRepeatOpen
|Flow|Style:Segno|Pos:11|Wide:Y
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam=End
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=End
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:2
|Bar
|Note|Dur:8th|Pos:-1|Opts:Stem=Up,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Up,Beam=End
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=End
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:2
|Flow|Style:ToCoda|Pos:5|Wide:Y
|Bar
|Ending|Endings:1
|Note|Dur:8th|Pos:3|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=End
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=End
|Note|Dur:4th|Pos:-1
|Note|Dur:4th|Pos:0
|Bar|Style:MasterRepeatClose
|Ending|Endings:2
|Note|Dur:8th|Pos:3|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:2|Opts:Stem=Down,Beam=End
|Note|Dur:8th|Pos:1|Opts:Stem=Down,Beam=First
|Note|Dur:8th|Pos:0|Opts:Stem=Down,Beam=End
|Note|Dur:Half|Pos:-1
|Bar
|Rest|Dur:Whole
|Bar
|Rest|Dur:Whole
|Flow|Style:DSalCoda|Pos:8|Justify:Right|Placement:BestFitForward
|Bar|Style:Double
|Flow|Style:Coda|Pos:8|Wide:Y
|Note|Dur:Whole|Pos:-1
!NoteWorthyComposer-End
!NoteWorthyComposerClip(2.751,Single)
|Chord|Dur:8th|Pos:n-2,0
|Chord|Dur:4th|Pos:-1,1
|Chord|Dur:8th|Pos:-4^,-1^
|Chord|Dur:Half|Pos:-4^,-1^
|Bar
|Chord|Dur:Half,Dotted|Pos:-4,-1
|Rest|Dur:8th
|Chord|Dur:8th|Pos:-1^,1^
|Bar|Style:MasterRepeatClose
|Chord|Dur:Half|Pos:-8^,-6^,-4^
|Chord|Dur:4th,Dotted|Pos:-8,-6,-4
|Chord|Dur:8th|Pos:-1^,1^
|Bar
|Chord|Dur:8th|Pos:-1,1
|Chord|Dur:4th|Pos:-1,1
|Chord|Dur:8th|Pos:0^,2^
|Chord|Dur:8th|Pos:0,2
|Chord|Dur:4th|Pos:0,2
|Chord|Dur:8th|Pos:n-2^,0^
|Bar
|Chord|Dur:8th|Pos:-2,0
!NoteWorthyComposerClip-End
/*If you have to transpose after running this, run Audit Note Stems and then rerun it.
doStem.js by Warren Porter
Stem Tool
This tool will change all notes on the middle line where no stem direction is specified to stem up.
This tool can operate on ONLY a selected part of a staff, or, if nothing has been selected, the entire staff.
To install:
1) Save this file with the name doStem.js on your computer and remember its location.
2) Start NWC and press Alt/F8. Pick new
3) After choosing a name and group, browse for this file and click "Open".
4) Insert "wscript " at the beginning of the command.
5) Clip text should be selected and check no options.
*/
rc=0, errMsg="";
function doProcess(clip) {
var displ=0, upDispl=0;
var result = new Array();
var lines = clip.split("\r\n");
for (i = 1; i < lines.length; i++) { // Main processing loop
if (lines[i].indexOf("Stem=") > 0) // Already has stem direction specified
continue;
else {
result = lines[i].match(/(\|Note.*Pos:)([n#bvx]?)0/) // 1. Note thru Pos 2. Accidental 3. Position 4. Shape 5. Ties 6. To end of line
if (result != null) {
lines[i] += "|Opts:Stem=Up" }
} } // End main loop
return lines;
}
var myLines;
myLines=doProcess(WScript.StdIn.ReadAll()).join("\r\n");
if (rc == 0)
WScript.StdOut.Write(myLines);
else
WScript.StdErr.Write(errMsg);
WScript.quit(rc);
/* Time Through Current Bar by Warren Porter "TimeText.js"
This script will insert the cumulative time at the beginning of each bar line.
After downloading this file, when setting it up in NWC User Tools create this command line:
wscript "'Browse can insert the path for you' \TimeText.js" <PROMPT:Run?:=|Yes|Undo> <PROMPT:BeginTime:=*00:00.0>
The first parm will run the whole script ("Yes") or simply remove timings from a previous run ("Undo").
Use the second parameter to specify a starting time for the song.
*/
var rc=0, errMsg="";
function getNoteLength(notelet) { // Returns duration of note , whole = 768
var NoteLengths = { "16th":48, "32nd":24, "4th":192, "64th":12, "8th":96, "Half":384, "Whole":768 } ;
parts = notelet.split(",");
var noteLength= -1;
noteLength = NoteLengths[parts[0]];
if (typeof(noteLength) == "undefined")
return -1;
for (var i = 1; i < parts.length; i++) {
if (parts[i].substr(0,9) == "DblDotted") {
noteLength = noteLength * 7 / 4; }
else
if (parts[i].substr(0,6) == "Dotted") {
noteLength = noteLength * 3 / 2; }
else
if (parts[i].substr(0,7) == "Triplet") {
noteLength = noteLength * 2 / 3; } }
return noteLength;
}
function tempoLength(notelet) { // Returns duration of tempo
var NoteLengths = { "Eighth Dotted":144, "Eighth":96, "Quarter Dotted":288, "Quarter":192, "Half Dotted":576, "Half":384}
var noteLength = -1;
noteLength =NoteLengths[notelet];
if (typeof(noteLength) == "undefined")
return -1;
return noteLength; }
function calculate(clip) {
var i, a, cumDur=0, durVal=0, durLen, min, sec, cumTime, wholeMeas=768, preTime=0, unDo=0, doWarn=1;
var base=192; //Default for tempo
var beatletLength=0; //Duration of "768th" note
var result = new Array();
var lines = new Array();
var shell = new ActiveXObject("WScript.Shell");
if (WScript.Arguments.length != 2) {
errMsg = "I need two parms: Yes or Undo and initial time offset";
rc=1;
return; }
if (WScript.Arguments.Item(0) == "Undo")
unDo=1;
result = WScript.Arguments.Item(1).match(/(\d+):(\d+\.*\d*)/)
if (result != null) { // Read starting time
min=parseInt(result[1]);
sec=parseFloat(result[2]);
preTime=min*60 + sec;}
lines = clip.split("\r\n");
for (i=0; i < lines.length; i++) { //Main processing loop
result=lines[i].match(/\|Font:PageSmallText\|Pos:10\|Color:[36]/)
if (result != null) // Remove earlier comments
lines[i] = "#";
if (unDo)
continue;
if (lines[i].slice(0,15) == "|TempoVariance|") { //Found tempo varience, give a warning
if (doWarn) {
shell.Popup("A Tempo Varience has been found, results are unpredictable");
doWarn=0; } // Don't say it more than once.
continue; }
if (lines[i].slice(0,5) == "|Flow") {
errMsg="Repeats or flow changes not allowed";
rc=1;
return;}
if (lines[i].slice(0,7) == "|Tempo|") { //Found tempo, look for base
if (lines[i].substr(6,5) == "|Base") {
result=lines[i].match(/Base:(.+)\|Tempo/)
base= tempoLength(result[1]); }
else
base = 192;
result=lines[i].match(/(\|Tempo.*Tempo:)(\d+)/)
a=parseInt(result[2]);
beatletLength= 60 / (a * base);
continue; } // End of Tempo code
if (lines[i].slice(0,15) == "|Rest|Dur:Whole" && lines[i].indexOf(",") == -1) {
cumDur += wholeMeas; //Found whole rest but use duration of last time signature.
continue;}
result=lines[i].match(/Dur:([^\|]*)/); // Looking for anything with duration not grace
if ((result != null) && (!/Grace/.test(lines[i]))) { // Has duration but is not grace.
var durVal = result[1];
var durLen = getNoteLength(durVal);
cumDur += durLen;
continue; }
result=lines[i].match(/Signature:(\d+)\/(\d+)/)
if (result != null)
wholeMeas = 768 * result[1] / result[2];
result=lines[i].match(/\|RestMultiBar\|NumBars:(\d+)\|/)
if (result != null)
cumDur += wholeMeas * result[1];
if (lines[i].slice(0,4) == "|Bar") { // Found a bar line
if (beatletLength == 0) { // Shouldn't happen
errMsg="Bar before Tempo indication, aborting";
rc=1;
return;}
if (lines[i].search("Repeat") != -1) {
errMsg="Repeats or flow changes not allowed";
rc=1;
return;}
cumTime = preTime + cumDur * beatletLength;
min = Math.floor(cumTime/60);
sec = cumTime;
sec -= min * 60;
smin=min.toString()
if (min < 10)
smin = "0" + smin;
sec = Math.round(sec*1000)/1000;
ssec = sec.toString();
if (sec < 10)
ssec = "0" + ssec;
lines[i] += "\r\n|Text|Text:\"" + smin + ":" + ssec + "\"|Font:PageSmallText|Pos:10|Color:3" }
if (lines[i].slice(0,27) == "!NoteWorthyComposerClip-End") {
cumTime = cumDur * beatletLength;
min = Math.floor(cumTime/60);
sec = cumTime;
sec -= min * 60;
smin=min.toString()
if (min < 10)
smin = "0" + smin;
sec = Math.round(sec*1000)/1000;
ssec = sec.toString();
if (sec < 10)
ssec = "0" + ssec;
lines[i] = "|Text|Text:\"" + smin + ":" + ssec + " " + cumDur + "\"\|Font:PageSmallText|Pos:10|Color:6\n" + lines[i];
break; } // Don't do the end clip again
}
rc = 0;
return lines;
} // End main processing loop
var myLines=calculate(WScript.StdIn.ReadAll()).join("\r\n");
if (rc == 0)
WScript.StdOut.Write(myLines);
else
WScript.StdErr.Write(errMsg);
WScript.quit(rc);