[PATCH] Docs: Added snippet for numbers as easy note heads.

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]


---
 .../snippets/new/numbers-as-easy-note-heads.ly     |   51 ++++++++++++++++++
 .../snippets/numbers-as-easy-note-heads.ly         |   56 ++++++++++++++++++++
 Documentation/snippets/pitches.snippet-list        |    1 +
 3 files changed, 108 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/snippets/new/numbers-as-easy-note-heads.ly
 create mode 100644 Documentation/snippets/numbers-as-easy-note-heads.ly

diff --git a/Documentation/snippets/new/numbers-as-easy-note-heads.ly b/Documentation/snippets/new/numbers-as-easy-note-heads.ly
new file mode 100644
index 0000000..2df46c5
--- /dev/null
+++ b/Documentation/snippets/new/numbers-as-easy-note-heads.ly
@@ -0,0 +1,51 @@
+\version "2.13.11"
+
+\header {
+  lsrtags = "pitches"
+  texidoc = "
+Easy notation note heads use the @code{note-names} property
+of the @code{NoteHead} object to determine what appears inside
+the note head.  By overriding this property, it is possible
+to print numbers representing the scale-degree.
+
+A simple engraver can be created to do this for every note head
+object it sees.
+"
+  doctitle = "Numbers as easy note heads"
+}
+
+#(define Ez_numbers_engraver (list
+  (cons 'acknowledgers
+   (list
+     (cons 'note-head-interface
+       (lambda (engraver grob source-engraver)
+         (let* (
+           (context (ly:translator-context engraver))
+           (tonic-pitch (ly:context-property context 'tonic))
+           (tonic-name (ly:pitch-notename tonic-pitch))
+           (grob-pitch (ly:event-property (event-cause grob) 'pitch))
+           (grob-name (ly:pitch-notename grob-pitch))
+           (delta (modulo (- grob-name tonic-name) 7))
+           (note-names (make-vector 7 (number->string (+ 1 delta)))))
+        (ly:grob-set-property! grob 'note-names note-names))))))))
+
+\layout {
+  \context {
+    \Voice
+    \consists \Ez_numbers_engraver
+  }
+}
+
+\relative c' {
+  \easyHeadsOn
+  c4 d e f
+  g4 a b c \break
+
+  \key a \major
+  a,4 b cis d
+  e4 fis gis a \break
+
+  \key d \dorian
+  d,4 e f g
+  a4 b c d
+}
diff --git a/Documentation/snippets/numbers-as-easy-note-heads.ly b/Documentation/snippets/numbers-as-easy-note-heads.ly
new file mode 100644
index 0000000..9ccb261
--- /dev/null
+++ b/Documentation/snippets/numbers-as-easy-note-heads.ly
@@ -0,0 +1,56 @@
+% Do not edit this file; it is automatically
+% generated from Documentation/snippets/new
+% This file is in the public domain.
+%% Note: this file works from version 2.13.11
+\version "2.13.11"
+
+\header {
+  lsrtags = "pitches"
+  texidoc = "
+Easy notation note heads use the @code{note-names} property
+of the @code{NoteHead} object to determine what appears inside
+the note head.  By overriding this property, it is possible
+to print numbers representing the scale-degree.
+
+A simple engraver can be created to do this for every note head
+object it sees.
+"
+  doctitle = "Numbers as easy note heads"
+} % begin verbatim
+
+
+#(define Ez_numbers_engraver (list
+  (cons 'acknowledgers
+   (list
+     (cons 'note-head-interface
+       (lambda (engraver grob source-engraver)
+         (let* (
+           (context (ly:translator-context engraver))
+           (tonic-pitch (ly:context-property context 'tonic))
+           (tonic-name (ly:pitch-notename tonic-pitch))
+           (grob-pitch (ly:event-property (event-cause grob) 'pitch))
+           (grob-name (ly:pitch-notename grob-pitch))
+           (delta (modulo (- grob-name tonic-name) 7))
+           (note-names (make-vector 7 (number->string (+ 1 delta)))))
+        (ly:grob-set-property! grob 'note-names note-names))))))))
+
+\layout {
+  \context {
+    \Voice
+    \consists \Ez_numbers_engraver
+  }
+}
+
+\relative c' {
+  \easyHeadsOn
+  c4 d e f
+  g4 a b c \break
+
+  \key a \major
+  a,4 b cis d
+  e4 fis gis a \break
+
+  \key d \dorian
+  d,4 e f g
+  a4 b c d
+}
diff --git a/Documentation/snippets/pitches.snippet-list b/Documentation/snippets/pitches.snippet-list
index d6f0217..496bd05 100644
--- a/Documentation/snippets/pitches.snippet-list
+++ b/Documentation/snippets/pitches.snippet-list
@@ -8,6 +8,7 @@ dodecaphonic-style-accidentals-for-each-note-including-naturals.ly
 generating-random-notes.ly
 makam-example.ly
 non-traditional-key-signatures.ly
+numbers-as-easy-note-heads.ly
 ottava-text.ly
 preventing-extra-naturals-from-being-automatically-added.ly
 preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly
-- 
1.6.0.4


------=_Part_6835_8396940.1263406927045--


---
----
Join the Frogs!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/