From: David Pounder Date: Wed, 13 Jan 2010 18:14:53 +0000 (+0000) Subject: Docs: Added snippet for numbers as easy note heads. X-Git-Tag: release/2.13.11-1~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=24380d779e063f6a77d73693dee81c77f33f0de7;p=lilypond.git Docs: Added snippet for numbers as easy note heads. --- 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 0000000000..2df46c56b3 --- /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 0000000000..9ccb26181a --- /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 d6f0217428..496bd050c5 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