]> git.donarmstrong.com Git - lilypond.git/commitdiff
LSR updates
authorPhil Holmes <mail@philholmes.net>
Wed, 8 Jun 2016 11:08:14 +0000 (12:08 +0100)
committerPhil Holmes <mail@philholmes.net>
Wed, 8 Jun 2016 11:41:27 +0000 (12:41 +0100)
14 files changed:
Documentation/snippets/contemporary-notation.snippet-list
Documentation/snippets/customize-drumpitchnames,-drumstyletable-and-drumpitchtable-in-layout-and-midi.ly [new file with mode: 0644]
Documentation/snippets/flat-ties.ly [new file with mode: 0644]
Documentation/snippets/midi.snippet-list
Documentation/snippets/obtaining-2.12-lyrics-spacing-in-newer-versions.ly
Documentation/snippets/percussion.snippet-list
Documentation/snippets/piano-template-with-centered-lyrics.ly
Documentation/snippets/pitches.snippet-list
Documentation/snippets/scheme-language.snippet-list
Documentation/snippets/simultaneous-notes.snippet-list
Documentation/snippets/specific-notation.snippet-list
Documentation/snippets/staff-notation.snippet-list
Documentation/snippets/tweaks-and-overrides.snippet-list
Documentation/snippets/two--partcombine-pairs-on-one-staff.ly [new file with mode: 0644]

index 098532b9612292a9a54bd76b2c7df02b1abf9026..b12e5980dd81307fd6a8ecd3161a32864da7acf1 100644 (file)
@@ -4,6 +4,7 @@ clusters.ly
 contemporary-glissando.ly
 double-glissando.ly
 flat-flags-and-beam-nibs.ly
+flat-ties.ly
 flute-slap-notation.ly
 heavily-customized-polymetric-time-signatures.ly
 laissez-vibrer-ties.ly
diff --git a/Documentation/snippets/customize-drumpitchnames,-drumstyletable-and-drumpitchtable-in-layout-and-midi.ly b/Documentation/snippets/customize-drumpitchnames,-drumstyletable-and-drumpitchtable-in-layout-and-midi.ly
new file mode 100644 (file)
index 0000000..0d2a8ce
--- /dev/null
@@ -0,0 +1,151 @@
+%% DO NOT EDIT this file manually; it is automatically
+%% generated from LSR http://lsr.di.unimi.it
+%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
+%% and then run scripts/auxiliar/makelsr.py
+%%
+%% This file is in the public domain.
+\version "2.18.0"
+
+\header {
+  lsrtags = "midi, percussion, pitches, specific-notation"
+
+  texidoc = "
+If you want to use customized drum-pitch-names for an own drum-style
+with proper output for layout and midi, follow the steps as
+demonstrated in the code below. In short:
+
+* define the names * define the appearence * tell LilyPond to use it
+for layout * assign pitches to the names * tell LilyPond to use them
+for midi
+
+"
+  doctitle = "Customize drumPitchNames drumStyleTable and drumPitchTable in layout and midi"
+} % begin verbatim
+
+%% This snippet tries to amend
+%% NR 2.5.1 Common notation for percussion - Custom percussion staves
+%% http://lilypond.org/doc/v2.18/Documentation/notation/common-notation-for-percussion#custom-percussion-staves
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% To use custom drum-pitch-names for your score and midi you need to follow
+%% this route:
+%%
+%%%%%%%%%%%%
+%% LAYOUT:
+%%%%%%%%%%%%
+%%
+%% (1) Define a name and put it in `drumPitchNames'
+%%     This can be done at toplevel with
+%%         drumPitchNames #'my-name  = #'my-name
+%%     or shorter:
+%%         drumPitchNames.my-name  = #'my-name
+%%     It's possible to add an alias as well.
+%% (2) Define how it should be printed
+%%     Therefore put them into a toplevel-list, where each entry should look:
+%%         (my-name
+%%           note-head-style-or-default
+%%             articulation-string-or-#f
+%%               staff-position)
+%%     Example:
+%%         #(define my-style
+%%           '(
+%%             (my-name default "tenuto" -1)
+%%             ; ...
+%%             ))
+%% (3) Tell LilyPond to use this custom-definitions, with
+%%         drumStyleTable = #(alist->hash-table my-style)
+%%     in a \layout or \with
+%%
+%%     Now we're done for layout, here a short, but complete example:
+%%         \new DrumStaff
+%%           \with { drumStyleTable = #(alist->hash-table my-style) }
+%%           \drummode { my-name }
+%%
+%%%%%%%%%%%%
+%% MIDI:
+%%%%%%%%%%%%
+%%
+%% (1) Again at toplvel, assign a pitch to your custom-note-name
+%%         midiDrumPitches #'my-name = #(ly:make-pitch -1 4 FLAT)
+%%     or shorter:
+%%         midiDrumPitches.my-name = ges
+%%     Note that you have to use the name, which is in drumPitchNames, no alias
+%% (2) Tell LilyPond to use this pitch(es), with
+%%         drumPitchTable = #(alist->hash-table midiDrumPitches)
+%%
+%%     Example:
+%%         \score {
+%%            \new DrumStaff
+%%             \with {
+%%               drumStyleTable = #(alist->hash-table my-style)
+%%               drumPitchTable = #(alist->hash-table midiDrumPitches)
+%%             }
+%%             \drummode { my-name4 }
+%%           \layout {}
+%%           \midi {}
+%%         }
+%%
+%%%%%%%%%%%%
+%% TESTING
+%%%%%%%%%%%%
+%%
+%% To test whether all is fine, run the following sequence in terminal:
+%%         lilypond my-file.ly
+%%         midi2ly my-file.midi
+%%         gedit my-file-midi.ly
+%%
+%% Which will do:
+%% 1. create pdf and midi
+%% 2. transform the midi back to a .ly-file
+%%    (note: midi2ly is not always good in correctly identifying enharmonic pitches)
+%% 3. open this file in gedit (or use another editor)
+%% Now watch what you've got.
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% FULL EXAMPLE
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+drumPitchNames.dbass      = #'dbass
+drumPitchNames.dba        = #'dbass  % 'db is in use already
+drumPitchNames.dbassmute  = #'dbassmute
+drumPitchNames.dbm        = #'dbassmute
+drumPitchNames.do         = #'dopen
+drumPitchNames.dopenmute  = #'dopenmute
+drumPitchNames.dom        = #'dopenmute
+drumPitchNames.dslap      = #'dslap
+drumPitchNames.ds         = #'dslap
+drumPitchNames.dslapmute  = #'dslapmute
+drumPitchNames.dsm        = #'dslapmute
+
+#(define djembe
+  '((dbass      default  #f         -2)
+    (dbassmute  default  "stopped"  -2)
+    (dopen      default  #f          0)
+    (dopenmute  default  "stopped"   0)
+    (dslap      default  #f          2)
+    (dslapmute  default  "stopped"   2)))
+
+midiDrumPitches.dbass = g
+midiDrumPitches.dbassmute = fis
+midiDrumPitches.dopen =  a
+midiDrumPitches.dopenmute = gis
+midiDrumPitches.dslap =  b
+midiDrumPitches.dslapmute = ais
+
+one = \drummode { r4 dba4 do ds r dbm dom dsm }
+
+\score {
+   \new DrumStaff
+    \with {
+      \override StaffSymbol.line-count =  #3
+      instrumentName = #"Djembe "
+      drumStyleTable = #(alist->hash-table djembe)
+      drumPitchTable = #(alist->hash-table midiDrumPitches)
+    }
+    \one
+  \layout {}
+  \midi {}
+}
diff --git a/Documentation/snippets/flat-ties.ly b/Documentation/snippets/flat-ties.ly
new file mode 100644 (file)
index 0000000..db63fb4
--- /dev/null
@@ -0,0 +1,117 @@
+%% DO NOT EDIT this file manually; it is automatically
+%% generated from LSR http://lsr.di.unimi.it
+%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
+%% and then run scripts/auxiliar/makelsr.py
+%%
+%% This file is in the public domain.
+\version "2.18.0"
+
+\header {
+  lsrtags = "contemporary-notation, scheme-language, staff-notation, tweaks-and-overrides"
+
+  texidoc = "
+The function takes the default @code{Tie.stencil} as an argument,
+calculating the result relying on the extents of this default. Further
+tweaking is possible by overriding @code{Tie.details.height-limit} or
+with @code{\\shape}. It's also possible to change the custom-definition
+on the fly.
+
+"
+  doctitle = "Flat Ties"
+} % begin verbatim
+
+%% http://lsr.di.unimi.it/LSR/Item?id=1031
+
+#(define ((flared-tie coords) grob)
+
+  (define (pair-to-list pair)
+     (list (car pair) (cdr pair)))
+
+  (define (normalize-coords goods x y dir)
+    (map
+      (lambda (coord)
+        ;(coord-scale coord (cons x (* y dir)))
+        (cons (* x (car coord)) (* y dir (cdr coord))))
+      goods))
+
+  (define (my-c-p-s points thick)
+    (make-connected-path-stencil
+      points
+      thick
+      1.0
+      1.0
+      #f
+      #f))
+
+  ;; outer let to trigger suicide
+  (let ((sten (ly:tie::print grob)))
+    (if (grob::is-live? grob)
+        (let* ((layout (ly:grob-layout grob))
+               (line-thickness (ly:output-def-lookup layout 'line-thickness))
+               (thickness (ly:grob-property grob 'thickness 0.1))
+               (used-thick (* line-thickness thickness))
+               (dir (ly:grob-property grob 'direction))
+               (xex (ly:stencil-extent sten X))
+               (yex (ly:stencil-extent sten Y))
+               (lenx (interval-length xex))
+               (leny (interval-length yex))
+               (xtrans (car xex))
+               (ytrans (if (> dir 0)(car yex) (cdr yex)))
+               (uplist
+                 (map pair-to-list
+                      (normalize-coords coords lenx (* leny 2) dir))))
+
+   (ly:stencil-translate
+       (my-c-p-s uplist used-thick)
+     (cons xtrans ytrans)))
+   '())))
+
+#(define flare-tie
+  (flared-tie '((0 . 0)(0.1 . 0.2) (0.9 . 0.2) (1.0 . 0.0))))
+
+\layout {
+  \context {
+    \Voice
+    \override Tie.stencil = #flare-tie
+  }
+}
+
+\paper { ragged-right = ##f }
+
+\relative c' {
+  a4~a
+  \override Tie.height-limit = 4
+  a'4~a
+  a'4~a
+  <a,, c e a c e a c e>~ q
+
+  \break
+
+  a'4~a
+  \once \override Tie.details.height-limit = 14
+  a4~a
+
+  \break
+
+  a4~a
+  \once \override Tie.details.height-limit = 0.5
+  a4~a
+
+  \break
+
+  a4~a
+  \shape #'((0 . 0) (0 . 0.4) (0 . 0.4) (0 . 0)) Tie
+  a4~a
+
+  \break
+
+  a4~a
+  \once \override Tie.stencil =
+    #(flared-tie '((0 . 0)(0.1 . 0.4) (0.9 . 0.4) (1.0 . 0.0)))
+  a4~a
+
+  a4~a
+  \once \override Tie.stencil =
+    #(flared-tie '((0 . 0)(0.06 . 0.1) (0.94 . 0.1) (1.0 . 0.0)))
+  a4~a
+}
index ecc73acb4ec684a3a281941deb1d7cc73b8cc445..243a5a03a077a3f4c6cfbddfe3d30480faca3651 100644 (file)
@@ -1,5 +1,6 @@
 changing-midi-output-to-one-channel-per-voice.ly
 changing-the-tempo-without-a-metronome-mark.ly
 creating-custom-dynamics-in-midi-output.ly
+customize-drumpitchnames,-drumstyletable-and-drumpitchtable-in-layout-and-midi.ly
 demo-midiinstruments.ly
 replacing-default-midi-instrument-equalization.ly
index 1b294569e36e422ffde26d600bb93215525f6a25..de3e108a48ddd409f42afcee13e1ec400e16a6d2 100644 (file)
@@ -49,7 +49,7 @@ bassMusic = \relative c {
 }
 
 words = \lyricmode {
-  Great is Thy faith- ful- ness,
+  Great is Thy faith -- ful -- ness,
 }
 
 \score {
index 5a29fb2c15ba4277b065119f7803ae21c2b6efb8..edef3b78e2c16030d4d2501963dcbbf36d4bb1f0 100644 (file)
@@ -1,4 +1,5 @@
 adding-drum-parts.ly
+customize-drumpitchnames,-drumstyletable-and-drumpitchtable-in-layout-and-midi.ly
 heavily-customized-polymetric-time-signatures.ly
 jazz-combo-template.ly
 percussion-beaters.ly
index d1f05af6dcf6d13257a4f06c86539221883519f3..008535e304ef6cdf50082a81294bccd01b208260 100644 (file)
@@ -38,20 +38,11 @@ text = \lyricmode {
 }
 
 \score {
-  \new GrandStaff <<
+  \new PianoStaff <<
     \new Staff = upper { \new Voice = "singer" \upper }
     \new Lyrics \lyricsto "singer" \text
     \new Staff = lower { \lower }
   >>
-  \layout {
-    \context {
-      \GrandStaff
-      \accepts "Lyrics"
-    }
-    \context {
-      \Lyrics
-      \consists "Bar_engraver"
-    }
-  }
+  \layout { }
   \midi { }
 }
index 7410307eb56c51fd12a96bef68c36872d8668d93..ce27407d6774da7489cab95ac2d3a8f3698b3473 100644 (file)
@@ -12,6 +12,7 @@ clefs-can-be-transposed-by-arbitrary-amounts.ly
 coloring-notes-depending-on-their-pitch.ly
 creating-a-sequence-of-notes-on-various-pitches.ly
 creating-custom-key-signatures.ly
+customize-drumpitchnames,-drumstyletable-and-drumpitchtable-in-layout-and-midi.ly
 forcing-a-clef-symbol-to-be-displayed.ly
 generating-random-notes.ly
 hiding-accidentals-on-tied-notes-at-the-start-of-a-new-system.ly
index 2513ba46821897a6c08c4b9fcd31f2ebf82ee258..a963aea6be9089a9804e0b2f30b2484975d7e58a 100644 (file)
@@ -11,6 +11,7 @@ customizing-the-position-and-number-of-dots-in-repeat-sign-bar-lines.ly
 displaying-grob-ancestry.ly
 drawing-boxes-around-grobs.ly
 drawing-circles-around-various-objects.ly
+flat-ties.ly
 generating-random-notes.ly
 generating-whole-scores-also-book-parts-in-scheme-without-using-the-parser.ly
 outputting-the-version-number.ly
index c2be0bb2e3db035d22068fe9b09b930e74390bf8..cd3e01f1de44b8af34317100b364052adc55ed29 100644 (file)
@@ -9,3 +9,4 @@ forcing-horizontal-shift-of-notes.ly
 making-an-object-invisible-with-the-transparent-property.ly
 moving-dotted-notes-in-polyphony.ly
 suppressing-warnings-for-clashing-note-columns.ly
+two--partcombine-pairs-on-one-staff.ly
index b372f9879f5fdb373bc50a5524c0dd0186add950..bc43d7d3ba6e1594b5f4fcbf8ac5ba2130d78eae 100644 (file)
@@ -15,6 +15,7 @@ contemporary-glissando.ly
 controlling-the-placement-of-chord-fingerings.ly
 creating-blank-staves.ly
 custodes.ly
+customize-drumpitchnames,-drumstyletable-and-drumpitchtable-in-layout-and-midi.ly
 demo-midiinstruments.ly
 embedding-native-postscript-in-a--markup-block.ly
 engravers-one-by-one.ly
index 0322a423b049fc0f76149c9d0682a6a62e8d47b2..bfb3706161f78a4ce689d99cc3e14f4862298ff2 100644 (file)
@@ -16,6 +16,7 @@ cross-staff-stems.ly
 display-bracket-with-only-one-staff-in-a-system.ly
 extending-a-trillspanner.ly
 extending-glissandi-across-repeats.ly
+flat-ties.ly
 forcing-measure-width-to-adapt-to-metronomemarks-width.ly
 glissandi-can-skip-grobs.ly
 how-to-print-two-rehearsal-marks-above-and-below-the-same-barline-method-1.ly
@@ -43,6 +44,7 @@ tick-bar-lines.ly
 time-signature-in-parentheses---method-3.ly
 time-signature-in-parentheses.ly
 tweaking-clef-properties.ly
+two--partcombine-pairs-on-one-staff.ly
 use-square-bracket-at-the-start-of-a-staff-group.ly
 using-autochange-with-more-than-one-voice.ly
 vertical-aligned-staffgroups-without-connecting-systemstartbar.ly
index ed848f2c0a4941d07a3cefb7e3ec2ea32cad677d..b0bf51340d84c1233da34532774be4cb0e5ae1c6 100644 (file)
@@ -42,6 +42,7 @@ dynamics-text-spanner-postfix.ly
 extending-a-trillspanner.ly
 extending-glissandi-across-repeats.ly
 fine-tuning-pedal-brackets.ly
+flat-ties.ly
 forcing-horizontal-shift-of-notes.ly
 fret-diagrams-explained-and-developed.ly
 generating-custom-flags.ly
diff --git a/Documentation/snippets/two--partcombine-pairs-on-one-staff.ly b/Documentation/snippets/two--partcombine-pairs-on-one-staff.ly
new file mode 100644 (file)
index 0000000..da3d7b3
--- /dev/null
@@ -0,0 +1,101 @@
+%% DO NOT EDIT this file manually; it is automatically
+%% generated from LSR http://lsr.di.unimi.it
+%% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
+%% and then run scripts/auxiliar/makelsr.py
+%%
+%% This file is in the public domain.
+\version "2.19.22"
+
+\header {
+  lsrtags = "simultaneous-notes, staff-notation"
+
+  texidoc = "
+The @code{\\partcombine} function takes two music expressions each
+containing a part, and distributes them among four @code{Voice}s named
+@qq{two} @qq{one} @qq{solo} and @qq{chords} depending on when and how
+the parts merged into a common voice.   The voices output from
+@code{\\partcombine} can have their layout properties adjusted in the
+usual way.  Here we define extensions of @code{\\partcombine} to make
+it easier to put four voices on a staff.
+
+soprano = @{ d'4 | cis'  b  e'  d'8 cis' | cis'2 b @} alto = @{ fis4 |
+e8 fis gis ais b4 b | b ais fis2 @} tenor = @{ a8 b | cis' dis' e'4 b8
+cis' d'4 | gis cis' dis'2 @} bass = @{ fis8 gis | a4 gis g fis | eis
+fis b,2 @}
+
+\\new Staff <<
+  \\key b\\minor
+  \\clef alto
+  \\partial 4
+  \\transpose b b'
+  \\partcombineUp \\soprano \\alto
+  \\partcombineDown \\tenor \\bass >>
+
+"
+  doctitle = "Two \\partcombine pairs on one staff"
+} % begin verbatim
+
+\layout {
+  \context {
+    \Staff
+    \accepts "VoiceBox"
+  }
+  \context {
+    \name "VoiceBox"
+    \type "Engraver_group"
+    \defaultchild "Voice"
+    \accepts "Voice"
+  }
+}
+
+partcombineUp =
+#(define-music-function (partOne partTwo)
+  (ly:music? ly:music?)
+"Take the music in @var{partOne} and @var{partTwo} and return
+a @code{VoiceBox} named @q{Up} containing @code{Voice}s
+that contain @var{partOne} and @var{partTwo} merged into one
+voice where feasible.  This variant sets the default voicing
+in the output to use upward stems."
+#{
+  \new VoiceBox = "Up" <<
+    \context Voice = "one" { \voiceOne }
+    \context Voice = "two" { \voiceThree }
+    \context Voice = "shared" { \voiceOne }
+    \context Voice = "solo" { \voiceOne }
+    \partcombine #partOne #partTwo
+  >>
+#})
+
+partcombineDown = #
+(define-music-function (partOne partTwo)
+  (ly:music? ly:music?)
+"Take the music in @var{partOne} and @var{partTwo} and return
+a @code{VoiceBox} named @q{Down} containing @code{Voice}s
+that contain @var{partOne} and @var{partTwo} merged into one
+voice where feasible.  This variant sets the default voicing
+in the output to use downward stems."
+#{
+  \new VoiceBox = "Down" <<
+    \set VoiceBox.soloText = #"Solo III"
+    \set VoiceBox.soloIIText = #"Solo IV"
+    \context Voice ="one" { \voiceFour }
+    \context Voice ="two" { \voiceTwo }
+    \context Voice ="shared" { \voiceFour }
+    \context Voice ="solo" { \voiceFour }
+    \partcombine #partOne #partTwo
+  >>
+#})
+
+soprano = { d'4 | cis'  b  e'  d'8 cis' | cis'2 b }
+alto = { fis4 | e8 fis gis ais b4 b | b ais fis2 }
+tenor = { a8 b | cis' dis' e'4 b8 cis' d'4 | gis cis' dis'2 }
+bass = { fis8 gis | a4 gis g fis | eis fis b,2 }
+
+\new Staff <<
+  \key b\minor
+  \clef alto
+  \partial 4
+  \transpose b b'
+  \partcombineUp \soprano \alto
+  \partcombineDown \tenor \bass
+>>