+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.
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.
# 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:=""}
%{
-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
%}
+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
+ >
+ >
+}
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;
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 ))
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");
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());
\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 {
% No accidental in tablature !
Accidental = \turnOff
+
+ stringTunings = #'(-8 -3 2 7 11 16)
+ tablatureFormat = #fret-number-tablature-format
}
(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))))
))
(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.")
(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
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']