Sunday, 26 May 2013

Sorting Out the Hymn Books

The final clip offered on the discussion emails is this:

;Hymn books gaps
^!Replace "^.*\b(HL|SF|LS|CC|HW|HF|NB)\b.*$" >> "\r\n$0\r\n" WARS
^!Replace "\R{3}" >> "\r\n" WARS
^!Replace "^\A\R|\R{1,}\Z" >> "" WARS

What this does is take a list of music and hymns, burnt on a CD, and, after the track numbering, where any hymn books using the identifiers of HL (Hymns for Living), SF (Sing Your Faith), LS (Let us Sing), CC (Christmas carols), HW (Hymns for Worship), HF (Hymns of Faith and Freedom), NB (No book), there is a line space before the hymn book and space after the hymn book, but not if other hymn books come first. This means that via the line space I know the higher volume is needed for hymns and then back to a lower volume for incidental music, like for meditation purposes.

In the correct coding in the previous entry here, the code above is placed just after ^!Clip "Sorting numbers zeros" which is what adds the leading zeros to numbers 1 to 9. At this stage each line of data gets its leading zero as necessary and has already its simplified timings in square brackets. Once the lines of the CD of music are ready to be selected, the new lines of code do the separation by hymn books.

The speed is impressive - the ^!SetHintInfo Working... is not seen because the clip is so fast.

I used to have to merge the PDF list into like a continuous paragraph, separate the tracks by its numbering, so each track was on one line (on three or two once the PDF is pasted to text), add in the zeros for 1 to 9, do the calculation to get tenths of seconds added to minutes and seconds timings, and put square brackets around the end timings.

All these have regular and logical repeat features. What a clip cannot do is mark the various places for meditation, listening and collection, and so I do that by very simple text clips.

No comments: