]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/output-lib.scm: Support of hammers and pulls in tablature
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 14 Aug 2002 12:45:44 +0000 (12:45 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 14 Aug 2002 12:45:44 +0000 (12:45 +0000)
-- Hammers and pulls are inserted exactly like slurs, and a "H" or
a "P" is added over the slur as needed.  The file

* ./input/test/tablature-hammer.ly: example of hammer, pull and
legato in a tablature.

* ly/engraver-init.ly: Stem.up-to-staff is now disabled by
default, since it appears that most of the published tablatures
are not like that.

ChangeLog
Documentation/user/introduction.itely
input/test/tablature-hammer.ly [new file with mode: 0644]
lily/beam.cc
ly/engraver-init.ly
scm/output-lib.scm

index 0ef0d168eebe3926475c7f89ad18afe270ffada9..75b33f2d0c8e0cd2d9e1f03cccdd2a76b6b81876 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2002-08-14  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+        * scm/output-lib.scm: Support of hammers and pulls in tablature
+       -- Hammers and pulls are inserted exactly like slurs, and a "H" or
+       a "P" is added over the slur as needed.  The file
+
+       * ./input/test/tablature-hammer.ly: example of hammer, pull and
+       legato in a tablature.
+
+       * ly/engraver-init.ly: Stem.up-to-staff is now disabled by
+       default, since it appears that most of the published tablatures
+       are not like that.
+
+2002-08-13  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
+
+       * lily/beam.cc (brew_molecule): use
+       Staff_symbol_referencer::staff_space for thickness.
+
 2002-08-14  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * Documentation/user/lilypond.tely: Add dir entries for
@@ -80,7 +98,7 @@
        (set_stem_shorten): Integer divide bug fix.
 
        * input/mutopia/J.S.Bach/baerenreiter-sarabande.ly: Really expect
-       6 systems, change warning into error.
+       six systems, change warning into error.
 
        * scm/grob-description.scm (beamed-stem-shorten): Shorten 8th
        beams same as normal stem (one staffspace), high order beams less
index 5cf541e666468a4acfcc18679d7caccb3e921f92..bd0cb0913bcd5051b70338f3cffd545a27f9110c 100644 (file)
@@ -148,9 +148,9 @@ engraving. It is a recurring theme with many variations. One of these
 variations is choosing spacing. The distances between notes should
 reflect the durations between notes, but adhering with mathematical
 precision to the duration will lead to a poor result. Shown here is an
-example of a motive, printed four times. It is printed using both
-exact, mathematical spacing, and with some corrections. Can you spot
-which is which?
+example of a motive, printed twice. It is printed using both exact,
+mathematical spacing, and with some corrections. Can you spot which is
+which?
 
 @c I can only see the motive printed two times!!! /Mats
 
diff --git a/input/test/tablature-hammer.ly b/input/test/tablature-hammer.ly
new file mode 100644 (file)
index 0000000..9648592
--- /dev/null
@@ -0,0 +1,14 @@
+\version "1.5.68"
+\header {
+texidoc = "" 
+}
+
+\score{
+  \context TabStaff <
+       \notes\relative c''{
+               c()d
+               d()d
+               d()c
+  }
+  >
+}
index 5f19968e65f345140df834d6acbd2dda5989aab3..4fd696937b34f6b9fd0c42680f9a8544a37c9251 100644 (file)
@@ -316,7 +316,8 @@ Beam::brew_molecule (SCM grob)
   Real dy = pos.delta ();
   Real dydx = dy && dx ? dy/dx : 0;
   
-  Real thick = gh_scm2double (me->get_grob_property ("thickness"));
+  Real thick = gh_scm2double (me->get_grob_property ("thickness"))
+    * Staff_symbol_referencer::staff_space (me);
   Real bdy = get_beam_translation (me);
 
   SCM last_beaming = SCM_EOL;;
index 5577f513b2c4be55b44b0298c382a02739491589..3a869f7e39ec6bed81d3b73c7a10ec884c998eee 100644 (file)
@@ -464,9 +464,14 @@ TabVoiceContext =   \translator {
       \denies "Thread"
       \consists "Tab_note_heads_engraver"
 
+      Slur \override #'font-family       = #'roman
+      Slur \override #'molecule-callback = #hammer-molecule-callback
+      Slur \override #'direction    = #-1
+
       % Draws all stems/beams out of the staff (and not in the middle of the staff !)
-      Beam \override #'damping = #100000
-      Stem \override #'up-to-staff = ##t
+      % This feature is now disabled because most of the tab does not use it.
+      %Beam \override #'damping = #100000
+      %Stem \override #'up-to-staff = ##t
 
       % No accidental in tablature !
       \remove Accidental_engraver
index 52baf2e1be98eff568fe5a379ba1ce9e7edf67a3..58ec903adc5d970595058ae04b92fb4b599116df 100644 (file)
    )
   )
 
+(define (hammer-molecule-callback grob)
+  (let* ((note-collums (ly-get-grob-property grob 'note-columns))
+         (note-column1 (cadr note-collums))
+         (note-column2 (car  note-collums))
+         (note1        (car (ly-get-grob-property note-column1 'note-heads)))
+         (note2        (car (ly-get-grob-property note-column2 'note-heads)))
+         (fret1        (string->number (ly-get-grob-property note1 'text)))
+         (fret2        (string->number (ly-get-grob-property note2 'text)))
+         (letter       (if (< fret1 fret2) "H"
+                       (if (> fret1 fret2) "P"
+                                           "")))
+         )
+    (let ((slur (Slur::brew_molecule grob))
+          (text (fontify-text (ly-get-default-font grob) letter)))
+    
+      (let ((x (/ (- (cdr (ly-get-molecule-extent slur 0)) 
+                     (/ (cdr (ly-get-molecule-extent text 0)) 2.0)
+                     )
+                  -2.0)))
+      
+        (ly-set-molecule-extent! text 0 (cons x x))
+        (ly-align-to! text 0 1)
+        )
+      
+      (ly-combine-molecule-at-edge slur 1 1 text -0.6)
+      )
+    )
+  )
+
+
+
+
 ; end of tablature functions