From: hanwen Date: Tue, 4 Jun 2002 18:56:02 +0000 (+0000) Subject: jiba, mats X-Git-Tag: release/1.5.60~9 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=89094621555ed761484bd68c4c9befc8456079d5;p=lilypond.git jiba, mats --- diff --git a/ChangeLog b/ChangeLog index e99714134d..5692f3f029 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-06-04 Mats Bengtsson + + * scripts/ly2dvi.py (non_path_environment): Fix typo + 2002-06-03 Heikki Junes * lilypond-mode.el: Extend "Quick notes" containing note tuples. diff --git a/VERSION b/VERSION index eb707ebb2e..5489b6484c 100644 --- 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. diff --git a/buildscripts/lilypond-profile.sh b/buildscripts/lilypond-profile.sh index a68c2a784a..40e16297a9 100644 --- a/buildscripts/lilypond-profile.sh +++ b/buildscripts/lilypond-profile.sh @@ -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:=""} diff --git a/input/test/tablature.ly b/input/test/tablature.ly index 7f12df0131..03ad815fe7 100644 --- a/input/test/tablature.ly +++ b/input/test/tablature.ly @@ -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 + > + > +} diff --git a/lily/stem.cc b/lily/stem.cc index ef0ed4ec3c..ed154d3860 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -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 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"); diff --git a/lily/tab-note-heads-engraver.cc b/lily/tab-note-heads-engraver.cc index 06690d1fc5..0bae11307e 100644 --- a/lily/tab-note-heads-engraver.cc +++ b/lily/tab-note-heads-engraver.cc @@ -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()); diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index c4781277e7..578d148b6e 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -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 } diff --git a/scm/grob-description.scm b/scm/grob-description.scm index dae0d5d8a2..4ef9555707 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -515,7 +515,6 @@ (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)))) )) @@ -816,6 +815,7 @@ (adjust-if-on-staffline . #t) (font-family . music) (avoid-note-head . #f) + (up-to-staff . #f) (meta . ((interfaces . (stem-interface font-interface)))) )) diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 67e97366f4..005fb86767 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -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.") diff --git a/scm/output-lib.scm b/scm/output-lib.scm index d4374a5974..6f992dd3bb 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -17,22 +17,24 @@ (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 diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py index f0486f091b..7b7baea5f6 100644 --- a/scripts/ly2dvi.py +++ b/scripts/ly2dvi.py @@ -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']