Contents - Index - Previous - Next


Text Variables


The program can display note names that change depending on the Recorder Type being displayed (alto, bass, or soprano/tenor) and the Enharmonics setting. This is done through the use of "text variables."

The purpose of text variables is to improve the display of text that mentions notes by name, avoiding the clumsy double specification of both F-notation and C-notation names. They are also the mechanism that makes the Enharmonic setting work. 

Text variables can be used on I (Information) Record records, on F Record - Message records, on F Record - Label records, and on H (Heading) Record records.
 
Format 1:   
%%sxx
where
s = + or - to go up or down half steps from the current note
xx = how many half steps to go (00-11)

Format 1 records (with %%) are the "standard" text variables - the note name will vary depending on both the recorder type and the Enharmonic setting. See below for examples.

Format 2:   
%bsxx
where
s = + or - to go up or down half steps from the current note
xx = how many half steps to go (00-11)

Format 2 records (with %b) will produce note names that only vary depending on the recorder type. The enharmonic name will always be the flat name (the 2nd character in "%b" is supposed to stand for a flat sign, although it is the letter b). The "b" must be in lowercase. This gives the fingering file author the ability to force a flat enharmonic name (e.g. Gb), overriding whatever the user's Enharmonic name setting is. The use of this type of record is not recommended in most instances, where the user's Enharmonic setting should take effect. 

Format 3:   
%#sxx
where
s = + or - to go up or down half steps from the current note
xx = how many half steps to go (00-11)

Format 3 records (with %#) will produce note names that only vary depending on the recorder type. The enharmonic name will always be the sharp name. This gives the fingering file author the ability to force a sharp enharmonic name (e.g. A#), overriding whatever the user's Enharmonic name setting is. The use of this type of record is not recommended in most instances, where the user's Enharmonic setting should take affect. 

Examples
For example, before version 2.40, if you were discussing the lowest note on the recorder, you  had to say "F(C)".  Now you would use a text variable and it would read either "F" or "C" depending on the recorder type being displayed.

An example of an Information record using 2 text variables, from NORMTRIL.TXT, note A#/Bb, Octave 2:
I%%+00 is flat - necessary to get a true %%+01 during trill

If the recorder type is alto or bass and the Enharmonic setting is Full names, when the Info button is clicked, the text that would be displayed is:
A#/Bb is flat - necessary to get a true B during trill

whereas if the recorder type is soprano/tenor, the text would read:
F is flat - necessary to get a true F#/Gb during trill

If the Enharmonic setting is Flat names, the text for alto/bass that would be displayed is:
Bb is flat - necessary to get a true B during trill

or if the recorder type is soprano/tenor, the text would read:
F is flat - necessary to get a true Gb during trill

As always, the total length of the original record (before the substitution) should not exceed 200 characters. Otherwise it will truncate without a warning or error condition. Note that the length of one of these text variables is always 5 characters (e.g. %%+00). The longest string it will ever become is also 5 characters (e.g. A#/Bb). Therefore, as long as you don't exceed 200 characters in the original record, the resulting string after substitution cannot exceed 200 characters either. This was deliberate, to simplify the programming and protect against strings that could get too long.

There is no limit to the number of text variables you use on a particular record (within the 200  total character limit).

For a good idea of how these work, you can look at the NORMTRIL.TXT file. Also, if you save the builtin fingerings (see Getting Started - Saving Built-In Fingerings), you will see numerous examples in the resulting file.

Text variables necessarily require more processing time than regular text - the program has to search through all text before displaying it, looking for any variables and doing any necessary substitution. However, in use the program does not seem any slower, except if you ask for a report for all notes (see Report). In this case, I did notice that the program takes longer than it used to. Of course, this is because it has to do hundreds of substitutions.

Linefeeds 

While not strictly speaking a "text variable," you can cause a line break (a linefeed) by using the special sequence %n . The "n" must be in lowercase. For example, the code:
F35dmLine 1%nLine 2%n%nLine 3 with 2 linefeeds before it.

would result in:



In technical terms, this %n is converted into a cursor-return/linefeed 2-character combination (hex 0d 0a). Since these are the same number of characters (2) as the variable being converted, you can easily count to stay within the 200 limit.