Thursday, 23 May 2013

Clip Way to Make a Music List

Thanks to clever people, and myself, I now have a NoteTab clip that takes the running order (print to PDF of the CD or DVD case) and produces from it a neat page that shows the preacher, Sunday's date, the timing from the start of the CD to the first hymn (actually, when the service begins) and a neat list with leading zeros to single numbers of the tracks.

Then I clean up the timings and another a clip adds square brackets to the end timings.

^!Toolbar New Document

^!Set %Preacher%=^?[Click on the Service Taker's name=_Adrian Worsfold|Barry Cundill|Bernard McHugh|Chris Pilkington|David Arthur|Elizabeth Faiers|Ernest Baker|Jim Timiney|John Midgley|John Williams|June Pettitt|Keith Brown|Marion Baker|Mavis Lake|Michael Tracey|Rosemary Arthur|Stephanie Cage|Stephen Carlile]

^!Info [L]"Print the CD Cover to PDF and copy the tracks.^PAlso note the total time of tracks before the first hymn^P(wipe out first hymn onward - do not save!)."

^!ShellWait "C:\Program Files\CDBurnerXP\cdbxpp.exe"

^!SetScreenUpdate Off

^!InsertHTML ^P^P

^!Set %Date%=^$GetDateFromInt(^$Calc(CEIL((^$GetDateToInt$+6)/7)*7-6)$;yyyymmdd)$
^!Set %Filename%="Service ^%Date%"

^!Toolbar New Document

^!Set %Trackslist1%=^$Getclipboard$
^!InsertText ^%Trackslist1%

^!Replace "\x20+$" >> "" ARSW
;Merge sections
^!Replace "^(\d+)\R(.+)\R(\d.*:.*)$" >> "$1 $2 $3" ARSW

^!Clip "Sorting numbers zeros"

^!Select All
^!Set %Trackslist2%=^$GetSelection$


^!Jump Doc_Start

^!Set %Minutes%=^?{Minutes Long (two digits)=20}
^!Set %Seconds%=^?{Seconds Long (two digits)=00}
^!Set %Minsclock%=^$Calc(60-^%Minutes%)$
^!InsertText "^P^PService ^%Date%^P^P^%Preacher%^P^P^P^P^P"

^!InsertText ^%Trackslist2%

^!Replace " 00:" >> " " WAS
^!IfError Next else Skip_-1

^!Replace ".0^P" >> "^P" WAS
^!IfError Next else Skip_-1

^!Save As "C:\Shared Documents\Music\^%Filename%.txt"

^!SetScreenUpdate On

The clip that this clip uses (to insert leading zeros to the extent of the largest number, thus 3 becomes 03 if there is a 10 or 003 if there is a 100) is this one (not my principal effort):

^!SetHintInfo Working...
^!SetScreenUpdate Off
^!Set %dig%=2
^!Find "^\d{^%dig%}" WRS
^!IfError Skip_2
^!Inc %dig%
^!Goto Skip_-3
^!Dec %dig%
^!Set %q%=^$Calc(^%dig%-1)$
^!Replace "^" >> "^$StrFill(\x30;^%dig%)$" WARS
^!Replace "^\x30+?(.{^%q%}\d\b)" >> "$1" WARS
^!Select All

After this I round up the timings to minutes and whole seconds and then use another clip:


^!InsertText "]"
^!MoveCursor -006
^!InsertText "["
^!Keyboard DOWN
^!IfError Next END
^!Goto FRED


(Incidentally I know that the final :END and final ^!SetScreenUpdate Onare not needed)

An example would look like this (the example is real but the date and name are wrong):

Service 20130526

Adrian Worsfold

01 Temptations Papa was a Rollin Stone [11:46]
02 KamakawiwoOleIsrael Somewhere Over the Rainbow [04:54]
03 SheeranEd A Team [04:21]
04 PresleyElvis In The Ghetto [02:47]
05 Clannad I See Red [04:24]
06 HL 018 Kremser choir [01:26]
07 HL 070 Hanover [02:50]
08 KingCarole Youve Got a Friend [05:09]
09 HL 051 Stuttgart [01:59]
10 Debussy Claire de Lune Suite extract [01:08]
11 HL 210 Jerusalem choir [02:47]
12 CollinsPhil Homeless [04:14]
13 PineCourtney Closer to Home [03:55]
14 PineCourtney GreeneSusaye Children of the Ghetto [07:03]
15 Housemartins I'll be Your Shelter [04:51]
16 Simply Red Moneys Too Tight to Mention [04:14]

And I tend to then add blank lines before and after hymns as a reminder so that they are played at a louder volume than worship based listening tracks.

No comments: