"; wc = window.open("","nocren","width=750,height=350,left=250,top=200") wc.document.write(html); wc.document.close(); } function startup() { document.penta.DeBugging.checked=false; var dloc = document.location.toString(); var DeBugging = document.getElementById("DeBugging") if (dloc.slice(0,4) != "file") { DeBugging.style.visibility = 'hidden'; } } /* !NoteWorthyComposerClip(2.5,Single) |Clef|Type:Treble |Key|Signature:F#,C#|Tonic:D |TimeSig|Signature:6/8 |Boundary|Style:Collapse |RestMultiBar|NumBars:3|PrintOnce:Y|WhenHidden:ShowBars,ShowRests |Boundary|Style:Collapse |Bar |RestMultiBar|NumBars:5|PrintOnce:N|Visibility:Never !NoteWorthyComposerClip-End */ function noteTable(thisLine) { if (thisLine == "--") { this.dur = Number.POSITIVE_INFINITY this.begPos = Number.POSITIVE_INFINITY; this.endPos = Number.POSITIVE_INFINITY; } else { this.dur = 0; this.begPos = sumMeasure * 50000 + sumBatch; result=thisLine.match(/Dur:([^\|]*)/); if ((result != null) && (!/Grace/.test(thisLine))) { // Has duration but is not grace. var durVal = result[1]; var durLen = getNoteLength(durVal); this.dur = durLen; if (durLen == -1) { alert("Illegal length: " + thisLine); return 1; } else { sumBatch += durLen; } // Keeping a running total of note durations in 768th notes } // End of object with "Dur:" not a grace note else { if (thisLine.slice(0,4) == "|Bar") { sumBatch=0; sumMeasure++; } else { result = thisLine.match(/RestMultiBar\|NumBars:(\d+)/); if (result != null) { var multRest = Number(result[1]); sumMeasure += multRest - 1; // Counting number of bars, one less than number of rests sumBatch=0; } } } } this.endPos = 50000 * sumMeasure + sumBatch; this.begGroup = this.begPos; this.endGroup = this.endPos; if (thisLine.slice(0,5) == "|Rest") this.dur = 0; } function checkContinue(parm) { var parts = new Array if (parm.slice(0,19) == '!NoteWorthyComposer') return false; parts = parm.split("|"); if (parts.length > 3 && ((parts[2].search("Slur") > -1) || (parts[3].indexOf("^")) > -1)) // Looking for slur or tie return true; else return false; } function doMove() { var result=new Array(), lineL = new Array(), lineU = new Array(), lineUarr=new Array(), lineLarr=new Array(); var upSplit = new Array, dnSplit = new Array, firstI, saveBeg, saveEnd, saveDur, tempI, iU, iL, resetI, tempField; var aNote = /\|Note\|Dur:.*(Grace)?.*Pos:([x#nbv]?)(-?\d+)([\^]?).*Stem=(Up|Down)(.*)/ tempField=document.penta.UPstaff.value; tempField=tempField.replace(/\r/g,""); lineU=tempField.split("\n"); // Upper staff tempField=document.penta.DNstaff.value; tempField=tempField.replace(/\r/g,""); lineL=tempField.split("\n"); // Lower staff sumMeasure = 0, sumBatch = 0; for (iU=0; iU < lineU.length; iU++) { // Initial processing loop on upper staff. lineUarr[iU] = new noteTable(lineU[iU]); } //End of initial processing of upper staff. lineUarr[--iU] = new noteTable("--"); // Prevents crash if there are fewer notes upstairs sumMeasure = 0, sumBatch = 0; for (iL=0; iL < lineL.length; iL++) { // Initial processing loop on lower staff. lineLarr[iL] = new noteTable(lineL[iL]); } //End of initial processing of lower staff. lineLarr[--iL] = new noteTable("--"); // Prevents crash if there are fewer notes downstairs for (iU=0; iU < lineU.length; iU++) { // Determines group begin and end for slurs & ties, upper staff if (checkContinue(lineU[iU])) { firstI = iU; // Save current location for populate group loop saveBeg = lineUarr[iU].begPos; // Save location (measure number plus beatlets) to populate group members tempI = iU + 1; // Initial subscript for discover loop. while (lineUarr[tempI].dur == 0 || checkContinue(lineU[tempI])) tempI++; // tempI points to last member in group resetI = tempI; // To advance iU after populate finished saveEnd = lineUarr[tempI].endPos; // Will be used to populate group objects saveDur = saveEnd - saveBeg; for ( ; tempI >= iU; tempI--) { // Populate group loop lineUarr[tempI].begGroup = saveBeg; lineUarr[tempI].endGroup = saveEnd; lineUarr[tempI].dur = saveDur; } iU = resetI; } // So won't try to revisit these objects again } for (iL=0; iL < lineL.length; iL++) { // Determines group begin and end for slurs & ties, lower staff if (checkContinue(lineL[iL])) { firstI = iL; // Save current location for populate group loop saveBeg = lineLarr[iL].begPos; // Save location (measure number plus beatlets) to populate group members tempI = iL + 1; // Initial subscript for discover loop. while (lineLarr[tempI].dur == 0 || checkContinue(lineL[tempI])) tempI++; // tempI points to last member in group resetI = tempI; // To advance iL after populate finished saveEnd = lineLarr[tempI].endPos; // Will be used to populate group objects saveDur = saveEnd - saveBeg; for ( ; tempI >= iL; tempI--) { // Populate group loop lineLarr[tempI].begGroup = saveBeg; lineLarr[tempI].endGroup = saveEnd; lineLarr[tempI].dur = saveDur; } iL = resetI; } // So won't try to revisit these objects again } iL = 1; // Code to match parts and modify if necessary for (iU=1; iU < lineU.length; iU++) { //First line is NWC header Look for |Note| with Stem=Up specfied, not Grace, no Space= result = lineU[iU].match(aNote); if ((result != null) && (lineUarr[iU].dur) && (!/Space=/.test(lineU[iU]))) { // Has duration, space not overridden. while ((lineLarr[iL].dur == 0) || (lineUarr[iU].begGroup >= lineLarr[iL].endGroup)) iL++; // Advance lower subscript until find same place in score if (lineLarr[iL].begPos == Number.POSITIVE_INFINITY) // Ran out of notes downstairs break; if (lineUarr[iU].endGroup <= lineLarr[iL].begGroup || lineLarr[iL].dur == 0) // If went past it (syncopation?) try next line continue; //////// At this point both staves are pointing the the same place in the score. ///////////// { upSplit = lineU[iU].split("|"); if (upSplit[4].search("Slur=Upward") == -1) upSplit[4] = upSplit[4].replace("Stem=Up","Stem=Up,Slur=Upward"); if (upSplit[4].search("Articulat") == -1) upSplit[4] = upSplit[4] + ",ArticulationsOnStem"; if (upSplit[4].search("Tie=Upward") == -1) upSplit[4] = upSplit[4] + ",Tie=Upward"; lineU[iU] = upSplit.join("|"); } } } ////////////////// The following is done on the bottom loop ///////////////////////// iU = 1; // Code to match parts and modify if necessary for (iL=1; iL < lineL.length; iL++) { //First line is NWC header Look for |Note| with Stem=Down specfied, not Grace, no Space= resultL = lineL[iL].match(aNote); if ((resultL!= null) && (lineLarr[iL].dur) && (!/Space=/.test(lineL[iL]))) { // Has duration, space not overridden. while ((lineUarr[iU].dur == 0) || (lineLarr[iL].begGroup >= lineUarr[iU].endGroup)) iU++; // Advance upper subscript until find same place in score if (lineUarr[iU].begPos == Number.POSITIVE_INFINITY) // Ran out of notes downstairs break; if (lineLarr[iL].endGroup <= lineUarr[iU].begGroup || lineUarr[iU].dur == 0) // If went past it (syncopation?) try next line continue; //////// At this point both staves are pointing the the same place in the score. ///////////// { dnSplit = lineL[iL].split("|"); if (dnSplit[4].search("Slur=Downward") == -1) dnSplit[4] = dnSplit[4].replace("Stem=Down","Stem=Down,Slur=Downward"); if (dnSplit[4].search("Articulat") == -1) dnSplit[4] = dnSplit[4] + ",ArticulationsOnStem"; if (dnSplit[4].search("Tie=Downward") == -1) dnSplit[4] = dnSplit[4] + ",Tie=Downward"; lineL[iL] = dnSplit.join("|"); } } //End of matching loop } // End main processing loop (lower) document.penta.UPstaff.value=""; //Build data in top window for (i=0; i < lineU.length; i++) { //document.penta.UPstaff.value+= i + " " + lineUarr[i].begGroup + " " + lineUarr[i].begPos + " " + lineUarr[i].endPos + " " + lineUarr[i].endGroup + " " + lineU[i] document.penta.UPstaff.value+=lineU[i]; if ((i + 1) < lineU.length) document.penta.UPstaff.value+= "\n"; } document.penta.UPstaff.select(); document.penta.DNstaff.value=""; //Build data in bottom window for (i=0; i < lineL.length; i++) { //document.penta.DNstaff.value+= i + " " + lineLarr[i].begGroup + " " + lineLarr[i].begPos + " " + lineLarr[i].endPos + " " + lineLarr[i].endGroup + " " + lineL[i]; document.penta.DNstaff.value+= lineL[i]; if ((i + 1) < lineL.length) document.penta.DNstaff.value+= "\n"; } }

Clear Mid Staff

 

To move notes and accidentals click here.

       Save your file first!!

Cut Section of upper staff into here.  

 

Cut Section of lower staff into here.         It's a little easier if you load the bottom first.

 

 

This Web Page Created with PageBreeze Free HTML Editor

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License 2013 by Warren Porter