Modified clipboard to fix triplets and measure numbers 2004-10-25 09:28 pm I have an early experiment of working on the clipboard in this file: !link(Bar7Ch04.nwc,http://bellsouthpwp.net/w/b/wbport/B147Ch04.nwc). Using the Semware Editor, I used these programs:proc Main()integer curr_line = 2integer rc = 0integer measure_numberstring buildline[64] = "2 "Ask("Enter the first measure number: ",buildline)measure_number = Val(buildline)loopGotoLine(curr_line) //Place cursor at beginning of "curr_line"GotoColumn(1)rc = lFind("|Bar","") //Look for next dotted 16thif rc == 0 // If we can't find onebreak // get out of loopendifcurr_line = CurrLine() //Save line number of this setbuildline=Format('|Text|Text:"',measure_number,'"|Font:PageSmallText|Pos:-6|Placement:AtNextNote')InsertLine(buildline)curr_line = curr_line + 2measure_number = measure_number + 1endloopend////////////////// and this one ////////////////////proc Main()string sixteenth[10] = "|Dur:16th"string sixteenthDot[17] = "|Dur:16th,Dotted"integer curr_line = 2integer last_lineinteger find_one = 0integer rc = 0last_line = NumLines() - 4while last_line > curr_lineGotoLine(curr_line) //Place cursor at beginning of "curr_line"GotoColumn(1)rc = lFind(sixteenthDot,"") //Look for next dotted 16thif rc == 0 // If we can't find onebreak // get out of loopendifcurr_line = CurrLine() //Save line number of this setDown()GotoColumn(1)rc = lFind(sixteenthDot,"c") //Look for middle dotted 16thif rc == 0find_one = 0elsefind_one = 1endifDown()GotoColumn(1)rc = lFind(sixteenth,"c") //Look for last 16th note (last of triplet)if rc <>0find_one = find_one + 1 // Will = 3 for a complete setendifGotoColumn(1)rc = lFind("Dotted","c")if rc == 0find_one = find_one + 1 // Did not find last one dottedendifif find_one == 3 // Found set needing to convertGotoLine(curr_line) //Get back to top of setGotoColumn(1)Replace(sixteenthDot,"|Dur:8th,Triplet=First","cn")Down() //2nd line of setGotoColumn(1)Replace(sixteenthDot,"|Dur:8th,Triplet","cn")Down() //3rd (last) line of setGotoColumn(1)Replace(sixteenth,"|Dur:8th,Triplet=End","cn")curr_line = curr_line + 3 //Get ready for next setelsecurr_line = curr_line + 1 //That dotted 16th wasn't a tripletendifendwhileend/////////There is a lot more work to do, but this is a start at least. Quote Selected
Re: Modified clipboard to fix triplets and measure numbers Reply #1 – 2004-10-26 03:45 am I can't write that kind of stuff, but its intent is clear (advantage of the NWC2 clipboard format, also PHP). Good! Quote Selected
Re: Modified clipboard to fix triplets and measure numbers Reply #2 – 2004-10-28 03:07 pm Those programs may be easier to read here:http://www.wjporter.com/nwc/The indented code for certain structures, loops, and conditional instructions didn't show up here. Quote Selected Last Edit: 2016-12-29 10:20 pm by Warren Porter
Re: Modified clipboard to fix triplets and measure numbers Reply #3 – 2004-10-29 02:24 pm Hi, Warren -Nice to see another SemWare Editor user. I've been using various incarnations of editors from SemWare (QEdit up through SemWare Pro) for probably over 15 years now. Best text editor I ever used and the macro feature has saved my butt (and a lot of time) many times.Peace,John Quote Selected
Re: Modified clipboard to fix triplets and measure numbers Reply #4 – 2004-10-29 08:59 pm While it is quite useful (user since 1991- my first PC), The Semware Editor is an extra expense, so the same functions done with another program might be better. I have another script which deletes all digits from the clipboard after entering measure numbers in lyrics. Helps ID the measures where there is an extra or missing hyphen or syllable in a hurry. Quote Selected
Re: Modified clipboard to fix triplets and measure numbers Reply #5 – 2005-04-07 06:23 pm I've added another macro, "tchange" which prompts the user for the current duration of a song and a new duration. It is in the link from reply 2. Tempos from the "Tempo" command and from the "MPC:Tempo" command are converted. Also in that folder are two versions of the Thais Meditation where I tried to change it from a duration of 3:38 to 5:00. Quote Selected
Re: Modified clipboard to fix triplets and measure numbers Reply #6 – 2005-07-07 12:47 am Just added "penta.s" to convert 5 16ths to pentuplets. See earlier link for the file. This is a script for a Semware editor, but it is documented for those wishing to convert it. I will be adding two other parts to it for doing the non-pentuplet staff, both played and muted/display only. Quote Selected