lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Choice of pitch input mode


From: Jeff Olson
Subject: Re: Choice of pitch input mode
Date: Fri, 29 Apr 2016 16:56:36 -0600
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

On 4/29/2016 5:58 AM, Matt Hood wrote:
What does everyone prefer? Relative, absolute, or a mix of both?

Summary: For my work, a perl script confimed my choice of absolute
         mode in conjunction with judicious use of \transpose,
         but for other people it suggests relative is better.

Details:
I started with relative, to conserve line width and minimize input effort,
but soon realized that was a premature optimization.

In my transcriptions of Beethoven and Bach for guitar duos, most of the
input effort and line width is attributable to chords, fingerings, string
indications and other annotations.

And for the limited range of a guitar (3.5 octaves) I can \transpose c c'
to minimize the number of octave marks in absolute mode (so range is e, to b'').
Thus I never encounter long high runs of 32nds above c'''.

I also found that, for the limited range of the guitar, it was easier to think
in absolute (you're always aware of your octave on a guitar) than in relative
(especially in the frequent case where a pitch and its octave are in the same
chord or arpeggio, yet with identical pitch symbols).  Doing global replacements
in vi is also a bit easier in absolute than in relative.

To satisfy my curiousity about the "relative frequency" of octave marks,
both between files in relative vs files in absolute mode, and compared to
other annotations that seem to overwhelm octave marks, I wrote a little
perl script (included below) to count selected characters in ly files.

The script confirmed my intial impression that (a) octave marks are a trivial
contributor to line width (in my work) but also suprised me that (b) using
absolute mode on average only added one more octave mark per measure than
using relative mode (probably because I used \transpose to simplify input).

For fun, here are some specific test runs.

The first example is from when I used only relative mode.  FYI, I habitually
use measure marks (|) and try for one measure per line.  I also use lots
of abbreviations to shorten things where I can (see large number of "=" signs).

The results below for relative mode show only about 1 octave mark per measure
for a typical piece of about 6 pages:

$ ly-chars mypubs/pathetique-2-guitar-duo-2064/pathetique-2-guitar-duo.ly
In a file of 214 measure marks, 710 lines, 26458 characters and 3 \relatives ...
octave marks (,') are 1.0 per measure mark, 0.3 per line, 0.8 percent of file.

Here's a count of selected characters (X represents all others):
' 68
) 78
( 78
^ 121
# 124
_ 138
, 142
= 156
{ 204
} 204
| 214
[ 215
] 216
% 256
\ 735
< 940
940
- 998
X 20631
$


The second example is from recent one-page piece in absolute mode.
The surprise here is that there are only about 2 octave marks per measure.
While that's twice as many as for relative, it's still only one extra character
per measure:

$ ly-chars mypubs/lagrima-duo-2103/lagrima-duo.ly
In a file of 55 measure marks, 338 lines, 10634 characters and 0 \relatives ...
octave marks (,') are 2.1 per measure mark, 0.3 per line, 1.1 percent of file.

Here's a count of selected characters (X represents all others):
, 32
[ 33
] 33
_ 35
) 49
( 49
| 55
^ 63
' 85
# 86
% 89
{ 123
} 123
< 130
130
= 156
- 176
\ 351
X 8836
$

So that's just for my work.  To see an average over other people's work,
here are analogous runs over all the 455 Beethoven files in mutopia, first
on the ones that use relative (at least once) and then those that don't.

$ cd /f/MutopiaProject/ftp/BeethovenLv
$ ly-chars `find -type f -name '*.ly' -exec grep -q relative '{}' \; -print `
In 99 files of 11756 measure marks, 28834 lines, 752704 characters and 158 
\relatives ...
octave marks (,') are 1.6 per measure mark, 0.7 per line, 2.6 percent of file.

Here's a count of selected characters (X represents all others):
^ 841
= 1296
_ 1863
# 2374
{ 3327
} 3327
[ 4839
] 4842
) 8804
( 8805
% 8853
' 9625
, 9675
| 11756
11848
< 11890
- 14235
\ 18339
X 616165
$
$ ly-chars `find -type f -name '*.ly' ! -exec grep -q relative '{}' \; -print `
In 356 files of 1350 measure marks, 33854 lines, 2139195 characters and 0 
\relatives ...
octave marks (,') are 205.5 per measure mark, 8.2 per line, 13.0 percent of 
file.

Here's a count of selected characters (X represents all others):
| 1350
% 2059
^ 2288
_ 2703
# 3533
- 4021
= 4519
{ 12864
} 12864
[ 15002
] 15033
) 16376
( 16406
, 25594
< 41312
41340
\ 69817
' 251807
X 1600307


Contrary to my personal experience, the above results show a 5 fold increase
in octave marks for absolute files (13.0 percent) vs relative (2.6 percent).
The authors using absolute are also much less likely to use measure marks
so ignore that number.  And who knows about one measure per line.

Perhaps the huge number of octave marks in the absolute files could be
reduced by judicious local use of \transpose.

Since I've already taken up so much space, I may as well include perl script:
$ cat ly-chars.pl
   $relatives = 0;
   $files = @ARGV;
   while (<>) {
      #/\|/ or next; # uncomment to consider only lines with measure marks
      /\\relative/ && $relatives++;
      s/#'/#X/g; # dont count single quotes in scheme literals
      s/[^,'<>\-[\]\(\)\\\|\^_\{\}%#=]/X/g;
      $lines++;
      foreach $c (split(//)) {
         $tally{$c}++;
         $total++;
      }
   }

   $meas = $tally{"|"} || 1;
   $octs = ($tally{","}+$tally{"'"}) || 0;
   $opm = $octs / $meas;
   $opl = $octs / $lines;
   $opct = 100 * $octs / $total;
   $intro = ($files eq 1)? "In a file" : "In $files files";
   print "$intro of $meas measure marks, $lines lines, $total characters and 
$relatives \\relatives ...\n";
   printf "octave marks (,') are %.1f per measure mark, %.1f per line, %.1f percent 
of file.\n", $opm, $opl, $opct;

   print "\nHere's a count of selected characters (X represents all others):\n";
   foreach $c (sort { $tally{$a} <=> $tally{$b} } keys %tally) {
      print "$c $tally{$c}\n";
   }

Thank you for your patience.  This is my first post to the list
so I'd welcome any comments on replying to posts.

Jeff




reply via email to

[Prev in Thread] Current Thread [Next in Thread]