]> git.donarmstrong.com Git - lilypond.git/commitdiff
jiba, mats
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 4 Jun 2002 18:56:02 +0000 (18:56 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 4 Jun 2002 18:56:02 +0000 (18:56 +0000)
ChangeLog
VERSION
buildscripts/lilypond-profile.sh
input/test/tablature.ly
lily/stem.cc
lily/tab-note-heads-engraver.cc
ly/engraver-init.ly
scm/grob-description.scm
scm/grob-property-description.scm
scm/output-lib.scm
scripts/ly2dvi.py

index e99714134dc5d49a6a32bd8ff4cb04092ea4a662..5692f3f029cbb3d318e0d12cbc7e0d0e44597daa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-06-04  Mats Bengtsson  <mats.bengtsson@s3.kth.se>
+
+       * scripts/ly2dvi.py (non_path_environment): Fix typo
+
 2002-06-03  Heikki Junes  <heikki.junes@hut.fi>
 
        * lilypond-mode.el: Extend "Quick notes" containing note tuples.
diff --git a/VERSION b/VERSION
index eb707ebb2e329de993c308a16e7b9fd95d5f6c55..5489b6484ce9f4916e615e1469a4ca2d84bfbb86 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
 PATCH_LEVEL=59
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=mb1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index a68c2a784a7dbb81bd448a632f8315ea8ccab0c4..40e16297a90a2b7c3f4933b5c52582f8fc8fe15b 100644 (file)
@@ -19,14 +19,13 @@ export GS_LIB
 # same purpose, but is more likely to be correct (think multiple
 # versions of lilypond).
 # LILYPONDPREFIX="$datadir"
+# export LILYPONDPREFIX
 
 # Add the installation directory to the teTeX system tree, 
 # see Documentation/misc/fontinstallation
 TEXMF="{$datadir,"`kpsexpand  \\$TEXMF`"}"
 export TEXMF
 
-# LILYPONDPREFIX="$datadir"
-# export LILYPONDPREFIX
 
 # For direct ps output fonts. Add all available TeX Type1 fonts
 GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}
index 7f12df01312e989c0f7e8d83c4e5d61e2ddcdc57..03ad815fe7e923c4417a58a2b9ffbe58fd21cb41 100644 (file)
@@ -2,7 +2,7 @@
 
 %{
 
-A sample tablature.
+A sample tablature, with both normal staff and tab.
 
 Tablature is done by overriding the note-head formatting function, and
 putting it on a 6-line staff. A special engraver takes care of going
@@ -10,7 +10,18 @@ from string-number + pitch to number.
 
 %}
 
+partition = \notes { ces'16^2 d'^2 e'8^2 g'2.^3  \times 2/3 { c'8^2 e'8^3 d'8^3 } e'4^2 }
+
 \score {
-  \notes  \context TabStaff { ces'16-2 d'-2 e'8-2 g'2.-3  c'4-1 c''8-5 b'-5 }
-  
- }
+  \context StaffGroup <
+    \context Staff <
+      % Hide fingering number (used for string number) for the "normal" staff
+      \property Staff.Fingering \override #'transparent = ##t
+      
+      \partition
+    >
+    \context TabStaff <
+      \partition
+    >
+  >
+}
index ef0ed4ec3c6b6ea7a87d22d6f3598e74cd1d86f0..ed154d38600eafea92d9b4f09e665ac08e8bd8d7 100644 (file)
@@ -274,6 +274,16 @@ Stem::get_default_dir (Grob*me)
 Real
 Stem::get_default_stem_end_position (Grob*me) 
 {
+  SCM up_to_staff = me->get_grob_property ("up-to-staff");
+  if (to_boolean(up_to_staff))
+    {
+      int line_count = Staff_symbol_referencer::line_count (me);
+    
+      Direction dir = get_direction (me);
+    
+      return dir*  (line_count + 1.5);
+    }
+  
   bool grace_b = to_boolean (me->get_grob_property ("grace"));
   SCM s;
   Array<Real> a;
@@ -750,6 +760,27 @@ Stem::beam_l (Grob*me)
 Stem_info
 Stem::calc_stem_info (Grob*me) 
 {
+  SCM up_to_staff = me->get_grob_property ("up-to-staff");
+  if (gh_scm2bool(up_to_staff)) {
+    
+    // Up-to-staff : the stem end out of the staff.
+
+    /*
+      FIXME: duplicate code.
+     */
+    int line_count = Staff_symbol_referencer::line_count (me);
+    
+    Stem_info si ;
+    
+    Direction dir = get_direction (me);
+    
+    si.ideal_y_ = dir*  (line_count + 1.5);
+    si.dir_ = dir;
+    si.shortest_y_ = si.ideal_y_; 
+    
+    return si;
+  }
+  
   SCM scm_info = me->get_grob_property ("stem-info");
 
   if (gh_pair_p (scm_info ))
@@ -884,5 +915,5 @@ Stem::calc_stem_info (Grob*me)
 
 ADD_INTERFACE (Stem,"stem-interface",
   "A stem",
-  "avoid-note-head adjust-if-on-staffline thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head note-heads direction length style no-stem-extend flag-style dir-forced");
+  "up-to-staff avoid-note-head adjust-if-on-staffline thickness stem-info beamed-lengths beamed-minimum-lengths lengths beam stem-shorten duration-log beaming neutral-direction stem-end-position support-head note-heads direction length style no-stem-extend flag-style dir-forced");
 
index 06690d1fc55495448187261d0c0d28bc24fa74e4..0bae11307e8c9425dfafee2c203d213a31c6e677 100644 (file)
@@ -114,7 +114,10 @@ Tab_note_heads_engraver::process_music ()
       SCM c0 = get_property ("centralCPosition");
       if (gh_number_p (c0)) pos += gh_scm2int (c0);
       
-      note_p->set_grob_property ("tab-string", gh_int2scm (tab_string));
+      SCM scm_pitch = req->get_mus_property ("pitch");
+      SCM proc      = get_property ("tablatureFormat");
+      SCM text      = gh_call3 (proc, gh_int2scm (tab_string), get_property ("stringTunings"), scm_pitch);
+      note_p->set_grob_property ("text", text);
       
       note_p->set_grob_property ("staff-position", gh_int2scm (pos));
       announce_grob (note_p, req->self_scm());
index c4781277e719e934446b9bcc746e647415cd4be7..578d148b6e18f82dcd962a7d6274c25cacb84525 100644 (file)
@@ -450,6 +450,10 @@ TabVoiceContext =   \translator {
       \name "TabVoice"
       \denies "Thread"
       \consists "Tab_note_heads_engraver"
+      
+      % 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
 }
 
 TabStaffContext = \translator {
@@ -476,5 +480,8 @@ TabStaffContext = \translator {
       
       % No accidental in tablature !
       Accidental  = \turnOff 
+      
+      stringTunings = #'(-8 -3 2 7 11 16)
+      tablatureFormat = #fret-number-tablature-format
 }
    
index dae0d5d8a207d8d6b3c4efaf9c9e574fee800e8a..4ef9555707e2c54d5773583627bff66769f4af14 100644 (file)
        (molecule-callback . ,tablature-molecule-callback)
        (Y-offset-callbacks  . (,Staff_symbol_referencer::callback))
        (stem-attachment-function . ,tablature-stem-attachment-function)
-  (string-tunings . (-8 -3 2 7 11 16))
        (meta . ((interfaces . (rhythmic-head-interface font-interface note-head-interface staff-symbol-referencer-interface))))
        ))
 
        (adjust-if-on-staffline . #t)
        (font-family . music)      
        (avoid-note-head . #f)
+       (up-to-staff . #f)
        (meta . ((interfaces . (stem-interface  font-interface))))
        ))
 
index 67e97366f41cad13a72f8a90581b9a2562a81ea0..005fb86767999a79540390e672d553288b7418da 100644 (file)
@@ -467,4 +467,4 @@ functions set spanner positions.")
 
 (grob-property-description 'tab-string number?       "The tablature string of a TabNoteHead.")
 (grob-property-description 'avoid-note-head boolean? "if set, the stem of a chord does not pass through all note head, but start at the last note head. Used by tablature.")
-(grob-property-description 'string-tunings list?     "The strings tuning, in semi-tons from the middle C. Used by tablature.")
+(grob-property-description 'up-to-staff boolean? "if set, stems' lengths are set so as stems end out of the staff. Used by tablature.")
index d4374a5974d3a802a2c765cf62588d8313299b26..6f992dd3bb1263683710ca0e548ce79c06d2310f 100644 (file)
 (define (tablature-molecule-callback grob)
   (let ((molecule (fontify-text
                    (ly-get-default-font grob)
-                   (string-append
-                    (number->string
-                     (- (pitch-semitones (ly-get-mus-property (ly-get-grob-property grob 'cause) 'pitch))
-                        (list-ref
-                         (ly-get-grob-property grob 'string-tunings)
-                         (- (ly-get-grob-property grob 'tab-string)
-                            1 ; remove 1 because list index starts at 0 and guitar string at 1.
-                            ))
-                        )
-                     )
-                    )
+                   (ly-get-grob-property grob 'text)
                    )))
     molecule ; return the molecule.
     )
   )
 
+; The TabNoteHead tablatureFormat callback.
+; Compute the text grob-property
+(define (fret-number-tablature-format string tuning pitch)
+  (number->string
+   (- (pitch-semitones pitch)
+      (list-ref tuning
+                (- string 1) ; remove 1 because list index starts at 0 and guitar string at 1.
+                )
+      )
+   )
+  )
+
 ; end of tablature functions
 
 
index f0486f091be23d3b9d0cad468eb05cfb974b92bb..7b7baea5f6f2b971ea4f6cac065293d26cf18499 100644 (file)
@@ -401,7 +401,7 @@ non_path_environment = {
 
 def setup_environment ():
        # $TEXMF is special, previous value is already taken care of
-       if os.environ.has_key ('TEXM'):
+       if os.environ.has_key ('TEXMF'):
                del os.environ['TEXMF']