Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - Warren Porter

152
General Discussion / Re: Easy Search-Replace for 1 shape in a 7-shape shape-note score?
I created this a number of years ago, don't know if it will fly or not.
Code: [Select · Download]
/*
 unShape.js  by Warren Porter


                                  Un-shape Tool
 This tool will remove the shape attribute

 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 unShape.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 (/Fake/.test(lines[i]))
    lines[i] = "#";
  else {
    result = lines[i].match(/(\|Note.*Pos:)([n#bvx]?)(-?\d+)([a-h])(\^?)(.*)$/) // 1. Note thru Pos 2. Accidental 3. Position 4. Shape 5. Ties 6. To end of line
if (result != null) {
  lines[i] = result[1] + result[2] + result[3] + result[5] + result[6] }
   } }    // 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);

Save it as unShape.js and follow installation steps at the top.
153
General Discussion / Rest Chords from midi files?
Yesterday, to help celebrate our anniversary, I visited Let Me Call You Sweetheart to get a midi file from which to start.  On the Sheet Music tab, RestChords in the right hand piano part are used in the majority of the song but on the midi file these are nowhere to be found--just a quarter note starting most measures that cuts off on the 2nd beat.  I changed the first measure into the second measure in the following with a recorded keystroke macro working with a nwctxt version of the song.
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.751,Single)
|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
Is there a better way to fix this?

Related to this file, the first time through it is piano, second time forte.  In addition there are crescendos and decrescendos.  Would putting a p just before the open repeat with a f before the close repeat help with hairpins in place?
154
General Discussion / Re: Hidden MMRs and Spacers
When I worked on this a few years ago, I started with "default spacers" that force NWC to do what it would anyway.  From there the script can add or remove spacers as needed.

 Spacer.htm

Sorry I haven't converted that to a function yet.  Open it at the same time NWC is running.
Click on "How to Use" for instructions.  HTH
155
General Discussion / Re: Things I Don't Know
Working example: Download and open vivconc2m.html from Scriptorium. Hide everything except for Tempo and Viola.  Instant viola part. Hide the viola and show 2nd violin. Same thing.  All parts have tempo indications and text from the tempo line.  Although each part has measure numbers, I sometimes add them as text at the start of a phrase where a conductor might want to start in a rehearsal.
156
General Discussion / Re: Things I Don't Know
I find the visibility settings a little complicated for the multibar rest feature.  For me it's always a bit of trial and error.
This is my tool for creating and hiding multi-measure rests: wjporter.com/nwc/mmr.js. That tool didn't include installation instructions.  Back up a level (remove /mmr.js) and look at the right hand column.  It creates MMR's with different levels of visibility and can back out MMRs as well.
157
General Discussion / Re: Things I Don't Know
If your tempo track has the tempos and rehearsal symbols (if needed), it can be layered into the part you are printing.  To print parts for the next instrument, hide the one you just did and unhide the next one.  Mike has good advice on how to hide/unhide staves.
159
General Discussion / Re: Happy Birthday
I've had this arrangement for a while, FWIW:
Code: (nwc) [Select · Download]
!NoteWorthyComposer(2.751)
|Editor|ActiveStaff:1|CaretIndex:1|CaretPos:-1
|SongInfo|Title:"Birthday Cadenza"|Author:"Warren Porter"|Lyricist:""|Copyright1:"Copyright © 2000 by Warren Porter"|Copyright2:"All Rights Reserved"
|PgSetup|StaffSize:26|Zoom:5|TitlePage:Y|JustifyVertically:Y|PrintSystemSepMark:N|ExtendLastSystem:Y|DurationPadding:Y|PageNumbers:0|StaffLabels:None|BarNumbers:None|StartingBar:1|AllowLayering:N
|Font|Style:StaffItalic|Typeface:"Times New Roman"|Size:17|Bold:Y|Italic:Y|CharSet:0
|Font|Style:StaffBold|Typeface:"Times New Roman"|Size:13|Bold:Y|Italic:N|CharSet:0
|Font|Style:StaffLyric|Typeface:"Times New Roman"|Size:12|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:"Times New Roman"|Size:8|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.78|Top:0.25|Right:1.78|Bottom:2.29|Mirror:N
|AddStaff|Name:"Staff"|Label:"Staff"|Group:"Standard"
|StaffProperties|EndingBar:Section Close|Visible:Y|BoundaryTop:15|BoundaryBottom:15|Lines:5|Color:Default
|StaffProperties|Muted:N|Volume:127|StereoPan:64|Device:0|Channel:1
|StaffInstrument|Patch:40|Trans:0|DynVel:10,30,45,60,75,92,108,127
|PerformanceStyle|Style:Legato|Pos:0|Visibility:Never
|Clef|Type:Treble
|Key|Signature:F#|Tonic:G
|TimeSig|Signature:3/4
|Dynamic|Style:f|Opts:Velocity=127,Volume=92|Pos:-8
|Tempo|Tempo:100|Pos:10
|Note|Dur:8th,Dotted|Pos:2|Opts:Stem=Down,Beam=First
|Note|Dur:16th|Pos:2|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:2
|Note|Dur:4th|Pos:5
|Bar
|Tempo|Tempo:48|Pos:10
|Note|Dur:32nd,Triplet=First,Slur|Pos:4|Opts:Stem=Down,Beam=First
|Note|Dur:32nd,Triplet,Slur|Pos:2|Opts:Stem=Down,Beam
|Note|Dur:32nd,Triplet=End,Slur|Pos:-1|Opts:Stem=Down,Beam=End
|Note|Dur:32nd,Triplet=First,Slur|Pos:-3|Opts:Stem=Up,Beam=First
|Note|Dur:32nd,Triplet,Slur|Pos:-5|Opts:Stem=Up,Beam
|Note|Dur:32nd,Triplet=End,Slur|Pos:-8|Opts:Stem=Up,Beam=End
|Note|Dur:32nd,Triplet=First,Slur|Pos:-5|Opts:Stem=Up,Beam=First
|Note|Dur:32nd,Triplet,Slur|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:32nd,Triplet=End,Slur|Pos:-1|Opts:Stem=Up,Beam=End
|Note|Dur:32nd,Triplet=First,Slur|Pos:2|Opts:Stem=Down,Beam=First
|Note|Dur:16th,Triplet=End|Pos:4^|Opts:Stem=Down,Beam=End
|Tempo|Tempo:100|Pos:10
|Note|Dur:4th|Pos:4
|TempoVariance|Style:Breath Mark|Pause:1|Pos:9
|Note|Dur:8th,Dotted|Pos:2|Opts:Stem=Down,Beam=First
|Note|Dur:16th|Pos:2|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:2
|Note|Dur:4th|Pos:6
|Bar
|Tempo|Tempo:48|Pos:10
|Note|Dur:32nd,Triplet=First,Slur|Pos:5|Opts:Stem=Down,Beam=First
|Note|Dur:32nd,Triplet,Slur|Pos:2|Opts:Stem=Down,Beam
|Note|Dur:32nd,Triplet=End,Slur|Pos:0|Opts:Stem=Down,Beam=End
|Note|Dur:32nd,Triplet=First,Slur|Pos:-2|Opts:Stem=Up,Beam=First
|Note|Dur:32nd,Triplet,Slur|Pos:-5|Opts:Stem=Up,Beam
|Note|Dur:32nd,Triplet=End,Slur|Pos:-7|Opts:Stem=Up,Beam=End
|Note|Dur:32nd,Triplet=First,Slur|Pos:-9|Opts:Stem=Up,Beam=First
|Note|Dur:32nd,Triplet,Slur|Pos:-7|Opts:Stem=Up,Beam
|Note|Dur:32nd,Triplet=End,Slur|Pos:-5|Opts:Stem=Up,Beam=End
|Note|Dur:32nd,Triplet=First,Slur|Pos:-2|Opts:Stem=Down,Beam=First
|Note|Dur:32nd,Triplet,Slur|Pos:0|Opts:Stem=Down,Beam
|Note|Dur:32nd,Triplet=End|Pos:2|Opts:Stem=Down,Beam=End
|Tempo|Tempo:100|Pos:10
|Note|Dur:4th|Pos:5
|TempoVariance|Style:Breath Mark|Pause:1|Pos:8
|Note|Dur:8th,Dotted|Pos:2|Opts:Stem=Down,Beam=First
|Note|Dur:16th|Pos:2|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:4th|Pos:9
|Note|Dur:4th|Pos:7
|Note|Dur:4th|Pos:5
|Bar
|Note|Dur:4th|Pos:4
|TempoVariance|Style:Fermata|Pause:2|Pos:9|Justify:Center|Placement:AtNextNote
|Note|Dur:4th|Pos:3
|TempoVariance|Style:Breath Mark|Pause:1|Pos:4
|Chord|Dur:8th,Staccato,Slur|Pos:3,8|Opts:Stem=Down,Beam=First
|Chord|Dur:16th,Staccato|Pos:3,8|Opts:Stem=Down,Beam=End
|Bar
|Chord|Dur:4th|Pos:2,7
|Chord|Dur:4th|Pos:0,5
|Chord|Dur:4th|Pos:1,6
|Bar
|Dynamic|Style:mp|Opts:Velocity=127,Volume=60|Pos:9
|Chord|Dur:8th,Slur|Pos:-9,-5^|Opts:Stem=Up,Beam=First
|Chord|Dur:16th|Pos:-5,0^|Opts:Stem=Up,Crescendo,Beam=End
|Chord|Dur:Half,Dotted|Pos:0,5|Opts:Crescendo,Lyric=Never
|Dynamic|Style:ff|Opts:Velocity=127,Volume=108|Pos:-5
!NoteWorthyComposer-End
161
Object Plugins / Primer for writing NWC Objects?
I am trying to grasp the trill object and while I understand parts of it, I am a long way for having a handle on it.  Is there a primer or template for creating an object to add, remove, or change what NWC would normally show or print?  Same for what happens during playback?  Is there a library of functions with instructions on how and when to use them?

TIA
162
General Discussion / Slur into grace notes
On bowed string instrument, a slur indicates a number of notes to be played on one bow. In this section, a half note slurs into a number of grace notes but the bow changes direction on the next measure.

Is there any way to notate this?  Any workarounds?

TIA
163
General Discussion / Re: Support???
The noteworthysoftware.com site is paid for through March of 2022.  After that ?!?!?  Is the company for sale?
167
General Discussion / Gliss going the wrong way
In this snippet from Souvenir
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.751,Single)
|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
the violin is sliding from a C# down to a F# but the slide is going up.  How do I fix this?
TIA
171
General Discussion / User tools problem
I just replaced nummeas.js on my NWC Tools page after someone told me it wasn't working.  If you have a problem with something on that page, please let me know and I'll take a look at it.
172
General Discussion / Re: Swing rhythm
If you put them on top, they can also double as a system-break staff; and for collecting other general information - very helpful and organized e.g. if you need to extract voices. One day I'll explain how to work with it (and write a few small tools that should help even more).
If you use NWC to print parts, the Tempo track is indespensible.  Things that all parts need to see like rehearsal symbols and tempo are all on a staff that is layered into the part you are currently printing.
173
General Discussion / Re: Stacked Rests
I don't know what you mean by "write it into the code" as it is not necessary to do this in NWCTXT.  When you select that pale anchor in front of the quarter rest and hit Cntl/E, you see it is a character of text with the Staff Symbols font.  Click on Char Map... and pick the symbol you need--it is not necessary to know its code.

To hide a rest (or just about anything else on the staff) select it, Cntl/E, then Visibility tab.  This is Rick's example hiding the eighth rest:
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.751,Single)
|Text|Text:""|Font:StaffSymbols|Pos:4|Justify:Center|Placement:AtNextNote
|Rest|Dur:8th|Opts:VertOffset=-4|Visibility:Never
|Note|Dur:8th|Pos:0
|Chord|Dur:4th|Pos:-1|Opts:Stem=Down|Dur2:4th|Pos2:4
!NoteWorthyComposerClip-End
You can hide the text rest the same way, but why?  Text is never necessary for NWC to work so to hide it, take it out.
175
General Discussion / Fast forward and wait
When using NWC for accompaniment, there are a capella passages (like a cadenza) or the other instrument hasn't come in yet such as Ashokan Farewell before the guitar enters.  Someone else would hit the "Resume" key (or soloist with a foot pedal) when the accompaniment returns.

Has anyone else run into this problem?  Any workarounds?

TIA
176
General Discussion / Re: Hairpins
The current version of NWC has the hairpins built in--look for them on your toolbars.  Select the notes to be under a hairpin, then click on the appropriate one.  The hairpin will be at the same location on the staff as the last dynamic marking.

HTH
177
General Discussion / Re: An idea
In Tips & Tricks there are quite a few suggestions that don't require any script or plug-in.  Some other topics might be "When to used hidden/played and visible/muted pairs of staves" or "Layered staves: when to use and how to solve problems they cause" to suggest a few.  Of course Tips & Tricks is chronological and some posts are obsolete, wrong, or posted in that section by mistake--however, going through that section as well as its sub-boards is suggested for anyone trying to compile a help page or blog.
178
General Discussion / Re: An idea
Maybe a compilation of the various scripts, plug-ins, and functions that have been developed over the years could be put together.  Ask the writers of these various tools to describe the problem they were trying to solve along with a description on how to install/use their tool(s)--and this documentation would be sent where?  Any volunteers?
180
General Discussion / Re: Italics again
I would start by selecting the notes you want to italicize.  Do Cntl/E and under Notes (click it) there will be a "Lyric Syllable" dropdown near the lower right and select "Never".  Insert your italics as text expressions where the lyrics would normally be.  You might have to do this several times, inserting only a word or two--you will have to experiment to see what works for you in that song.
Good luck!

P.S. You would have to take your italic words out of the staff lyric window.
181
General Discussion / Re: Multiple Rests (Please Help! I'm such a beginner)
There is a tool to create multi measure rests or back them out.  First visit Nwc Page and note the instructions for installing tools on the upper right side.  Then click on Multi Measure Rests.   On the file option of your browser, choose Save As with the name mmr.js and remember where you parked it.  In installing, the line will start with wscript, the location of the script (after choosing browse) and the prompts, copy and paste from near the top of the script.

Mike's method also works, this just automates the process and counts the measures for you.
183
General Discussion / Re: Switching Clef?
Select the entire staff and, holding Cntl/Shift down, press the up arrow or down arrow however many times as needed.  There are tools that can do that for you, handling different octave shifts as well as clef changes like octave down treble to unshifted bass (up five times).
184
User Tools / Turn grace notes into real ones.
This script turns grace notes into real ones and steals time from either the prior note or the following one.

There is no undo with this so either save before using or on a copy from another staff.
Code: [Select · Download]
/* 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);

Edit: Change documentation in first few lines of the script.
185
General Discussion / Re: Looking for portamente
In a violin part to "Cloudburst" from Grand Canyon Suite, there was a low whole note, an empty measure, high whole note, empty measure, and it repeated several times with a zig-zag line connecting them.
186
General Discussion / Re: Tremolo and Note Value.
Can it help the following (from same piece as previous post)?
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.751,Single)
|Clef|Type:Treble
|Key|Signature:Bb,Eb,Ab|Tonic:C
|TimeSig|Signature:6/8
|Note|Dur:16th,Accent|Pos:-9|Opts:Stem=Up,Beam=First
|Note|Dur:16th|Pos:-9|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-9,-4|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-9,-4|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-4,1|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-4,1|Opts:Stem=Up,Beam=End
|Chord|Dur:16th|Pos:-4,1|Opts:Stem=Up,Beam=First
|Chord|Dur:16th|Pos:-4,1|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-9,-4|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-9,-4|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-9|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-9|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:16th,Accent|Pos:-9|Opts:Stem=Up,Beam=First
|Note|Dur:16th|Pos:-9|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-9,-4|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-9,-4|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-4,1|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-4,1|Opts:Stem=Up,Beam=End
|Chord|Dur:16th|Pos:-4,1|Opts:Stem=Up,Beam=First
|Chord|Dur:16th|Pos:-4,1|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-9,-4|Opts:Stem=Up,Beam
|Chord|Dur:16th|Pos:-9,-4|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-9|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-9|Opts:Stem=Up,Beam=End
!NoteWorthyComposerClip-End
188
General Discussion / Re: Tremolo and Note Value.
I was revisiting a piece with some tremelo and thought I would experiment.  It looks good but is a lot faster than nearby measures where it is still written out.  Am I missing something?
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.751,Single)
|Clef|Type:Treble
|Key|Signature:Bb,Eb,Ab|Tonic:E
|Note|Dur:16th|Pos:#-3|Opts:Stem=Up,Beam=First
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam=End
|Bar
|Note|Dur:16th|Pos:#-3|Opts:Stem=Up,Beam=First
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-3|Opts:Stem=Up,Beam
|Note|Dur:16th|Pos:-1|Opts:Stem=Up,Beam=End
|Bar
|RestChord|Dur:4th,Dotted|Opts:Stem=Up,Muted,HideRest|Dur2:Half,Dotted,Accent|Pos2:#4
|User|Tremolo.ms|Pos:0|Beams:2|TripletPlayback:Y
|RestChord|Dur:4th,Dotted|Opts:Stem=Up,Muted,HideRest|Dur2:Half,Dotted|Pos2:6
|Bar
|Note|Dur:16th|Pos:#4|Opts:Stem=Down,Beam=First
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:4|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:4|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:4|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:4|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:4|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam=End
|Bar
|Note|Dur:16th|Pos:#4|Opts:Stem=Down,Beam=First
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:4|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:4|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:4|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:4|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:4|Opts:Stem=Down,Beam
|Note|Dur:16th|Pos:6|Opts:Stem=Down,Beam=End
|Bar
!NoteWorthyComposerClip-End
190
General Discussion / Stuck pedal makes other part stacatto.
I was revisiting a Grieg sonata I worked on quite a few years ago to put pedal markings in it.  The last pedal mark I had was down and until I fixed it the violin part had nothing but short notes, regardless of note lengths and slurs.  A score review showed each staff with a different midi channel (not 10).  Any idea why?

TIA
192
General Discussion / Re: Convert Violin score to Viola score?
In addition to moving the notes, a clef change is involved.  Move the notes up six positions then transpose down 7 half-steps,  This will put notes in their proper places as well as subtract a sharp or add a flat.

Edit: change 'key' to 'clef' in first sentence.
195
Tips & Tricks / Swapping between 4 and 2 staves for a chorus.
Printed scores for (especially) major choral works may alternate between one staff per part (i.e., a fugue) or having sopranos and altos sharing a staff with tenors and basses doing likewise for a chorale.  This may seem impossible to do in NoteWorthy since a staff is either layered or unlayered for the whole file.

The workaround is to give sopranos and tenors an extra staff each--the top one stands alone and the bottom one is layered with the next part.  By using boundary collapse commands and stop boundary collapse commands on either side of a bar line, the two soprano and tenor parts will never be on the printed parts at the same time.  They should also share the same midi channel and use the same midi patch (like Choral Aahs).

When two parts share (by layering) a staff, it will be necessary to force stem direction and perhaps slur and tie direction as well.  Also, extra space may be needed for notes and/or accidentals when the notes are too close to each other otherwise.  See the attachment for an example.
196
User Tools / Re: Is it possible to scale down some of the staffs in a score?
Are there sections where the choir could use just two staves?  You would need to create an extra Alto and Tenor staff (one to be layered, the other not), one staff would be collapsed and the other not.  On a system break where you need to change from one to the other, matching staff collapse and end staff collapse commands would make the switch for you.
200
General Discussion / Recording video and sound from NWC playback
Is there a way to record NWC playback without having to use another camera or cellphone.  I have been trying to use some free products from VSDC, but can't get off the ground.  Also, I don't have the option of recording audio.

Am open to ideas.  TIA