From ef99e2a6a974bbabab79c1052019a78b1a835c8d Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Mon, 14 May 2007 20:58:16 -0700 Subject: [PATCH] LSR: minor tweaks. Rename "pitches" to "pitch" because lilypond makefiles barf on the plural form. (?!) --- input/lsr/GNUmakefile | 2 +- input/lsr/LSR.ly | 2 +- .../{pitches => pitch}/AAA-intro-advanced.ly | 0 input/lsr/{pitches => pitch}/GNUmakefile | 0 input/lsr/{pitches => pitch}/SConscript | 0 .../{pitches => pitch}/AAA-intro-advanced.ly | 0 input/new/{pitches => pitch}/GNUmakefile | 0 input/new/{pitches => pitch}/SConscript | 0 input/{test => new/pitch}/makam.ly | 0 input/test/smart-transpose.ly | 82 ------------------- 10 files changed, 2 insertions(+), 84 deletions(-) rename input/lsr/{pitches => pitch}/AAA-intro-advanced.ly (100%) rename input/lsr/{pitches => pitch}/GNUmakefile (100%) rename input/lsr/{pitches => pitch}/SConscript (100%) rename input/new/{pitches => pitch}/AAA-intro-advanced.ly (100%) rename input/new/{pitches => pitch}/GNUmakefile (100%) rename input/new/{pitches => pitch}/SConscript (100%) rename input/{test => new/pitch}/makam.ly (100%) delete mode 100644 input/test/smart-transpose.ly diff --git a/input/lsr/GNUmakefile b/input/lsr/GNUmakefile index 4a706f8bc7..951962ec08 100644 --- a/input/lsr/GNUmakefile +++ b/input/lsr/GNUmakefile @@ -1,7 +1,7 @@ depth = ../../ SUBDIRS = ancient chords connecting contemporary education expressive -SUBDIRS += guitar parts pitches repeats spacing staff text vocal scheme other +SUBDIRS += guitar parts pitch repeats spacing staff text vocal scheme other STEPMAKE_TEMPLATES=documentation texinfo tex LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc diff --git a/input/lsr/LSR.ly b/input/lsr/LSR.ly index 40f5c0d897..dfeb0b6fa1 100644 --- a/input/lsr/LSR.ly +++ b/input/lsr/LSR.ly @@ -21,7 +21,7 @@ These pages show LilyPond examples (snippets) from the @strong{@uref{parts/collated-files.html,Preparing parts}} -@strong{@uref{pitches/collated-files.html,Pitches}} +@strong{@uref{pitch/collated-files.html,Pitch}} @strong{@uref{repeats/collated-files.html,Repeats}} diff --git a/input/lsr/pitches/AAA-intro-advanced.ly b/input/lsr/pitch/AAA-intro-advanced.ly similarity index 100% rename from input/lsr/pitches/AAA-intro-advanced.ly rename to input/lsr/pitch/AAA-intro-advanced.ly diff --git a/input/lsr/pitches/GNUmakefile b/input/lsr/pitch/GNUmakefile similarity index 100% rename from input/lsr/pitches/GNUmakefile rename to input/lsr/pitch/GNUmakefile diff --git a/input/lsr/pitches/SConscript b/input/lsr/pitch/SConscript similarity index 100% rename from input/lsr/pitches/SConscript rename to input/lsr/pitch/SConscript diff --git a/input/new/pitches/AAA-intro-advanced.ly b/input/new/pitch/AAA-intro-advanced.ly similarity index 100% rename from input/new/pitches/AAA-intro-advanced.ly rename to input/new/pitch/AAA-intro-advanced.ly diff --git a/input/new/pitches/GNUmakefile b/input/new/pitch/GNUmakefile similarity index 100% rename from input/new/pitches/GNUmakefile rename to input/new/pitch/GNUmakefile diff --git a/input/new/pitches/SConscript b/input/new/pitch/SConscript similarity index 100% rename from input/new/pitches/SConscript rename to input/new/pitch/SConscript diff --git a/input/test/makam.ly b/input/new/pitch/makam.ly similarity index 100% rename from input/test/makam.ly rename to input/new/pitch/makam.ly diff --git a/input/test/smart-transpose.ly b/input/test/smart-transpose.ly deleted file mode 100644 index f6e31ca57d..0000000000 --- a/input/test/smart-transpose.ly +++ /dev/null @@ -1,82 +0,0 @@ -\version "2.10.0" -\sourcefilename "smart-transpose.ly" - -\header { -texidoc="@cindex Smart Transpose - -There is a way to enforce enharmonic modifications for notes in order -to have the minimum number of accidentals. In that case, ``Double -accidentals should be removed, as well as E-sharp (-> F), bC (-> B), -bF (-> E), B-sharp (-> C).'', as proposed by a request for a new feature. -In this manner, the most natural enharmonic notes are chosen in this example. -" -} -% -% Modified to use the standard transpose mechanism. The question is -% how useful these enharmonic modifications are. Mats B. -% -% Why not to have a function that minimizes the number of accidentals? -HJJ -% Works also for quarter tones. -HJJ -% - -#(define (naturalise-pitch p) - (let* ((o (ly:pitch-octave p)) - (a (ly:pitch-alteration p)) - (n (ly:pitch-notename p))) - - (cond - ((and (> a 1) (or (eq? n 6) (eq? n 2))) - (set! a (- a 2)) - (set! n (+ n 1))) - ((and (< a -1) (or (eq? n 0) (eq? n 3))) - (set! a (+ a 2)) - (set! n (- n 1)))) - - (cond - ((> a 2) (set! a (- a 4)) (set! n (+ n 1))) - ((< a -2) (set! a (+ a 4)) (set! n (- n 1)))) - - (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7)))) - (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7)))) - - (ly:make-pitch o n a))) - -#(define (naturalise music) - (let* ((es (ly:music-property music 'elements)) - (e (ly:music-property music 'element)) - (p (ly:music-property music 'pitch))) - - (if (pair? es) - (ly:music-set-property! - music 'elements - (map (lambda (x) (naturalise x)) es))) - - (if (ly:music? e) - (ly:music-set-property! - music 'element - (naturalise e))) - - (if (ly:pitch? p) - (begin - (set! p (naturalise-pitch p)) - (ly:music-set-property! music 'pitch p))) - - music)) - -music = \relative c' { c4 d e f g a b c } - -naturaliseMusic = -#(define-music-function (parser location m) - (ly:music?) - (naturalise m)) - -\score { - \context Staff { - \transpose c ais \music - \naturaliseMusic \transpose c ais \music - \transpose c deses \music - \naturaliseMusic \transpose c deses \music - } - \layout { ragged-right = ##t} -} - -- 2.39.5