+2002-09-07 Rune Zedeler <rune@zedeler.dk>
+
+ * lily/parser.yy and lily/lexer.ll: Use E_UNSIGNED instead of E_DIGIT
+
+ * lily/musical-request.cc (String_number_req): Added
+
+ * lily/tab-note-heads-engraver.cc: Use String_number_req instead of Text_script_req;
+ read properties stringOneTopmost and highStringOne.
+
+ * ly/engraver-init.ly (tabStaffContext): Bugfix: remove Key_engraver
+ set stringOneTopmost and highStringOne to #t
+
+ * scm/output-lib.scm (tablature-stem-attachment-function): Changed
+ (guitar-tunings): List added
+ ((every-nth-bar-number-visible n) barnum): Instead of default-bar-number-visibility
+
+ * scm/grob-description.scm (TabNoteHead): Extra-offset added (UGH!)
+
+ * scm/translator-property-description.scm: Added new functions
+
+ * input/test/tablature.ly: Changed to better demonstrate possibilities.
+
+ * input/test/bar-number-every-fifth: Use new function
+
2002-09-07 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* scripts/lilypond-book.py: revert pre use for python
2.2. Document why.
-2002-09-07 J\81ér\81émie Lumbroso <jeremie@lumbroso.fr>
+2002-09-07 Jeremie Lumbroso <jeremie@lumbroso.fr>
* Documentation/user/refman.itely: very minor corrections and
rephrasing of the reference manual -- revision up to line #400.
* lily/parser.yy (chord_inversion): use CHORD_SLASH for '/'
(command_element): use Timing as alias for Score.
-2002-09-06 J\8eér\8eémie Lumbroso <jeremie@lumbroso.fr>
+2002-09-06 Jeremie Lumbroso <jeremie@lumbroso.fr>
* Documentation/user/refman.itely: minor corrections (replacing
`grob' by `object'), addition of an example in the tablature
\score {
\context Staff \notes \transpose c'' {
\property Score.BarNumber \override #'break-visibility = #end-of-line-invisible
- \property Score.barNumberVisibility = #(lambda(n) (= 0 (modulo n 5)))
+ \property Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
\property Score.BarNumber \override #'molecule-callback =
#(make-molecule-boxer 0.1 0.25 0.25 Text_item::brew_molecule)
\property Score.BarNumber \override #'font-relative-size = #1
-\version "1.5.68"
+\version "1.6.2"
%{
%}
partition = \notes {
- a,4-2 c'-5 a-4 e'-6
- e-3 c'-5 a-4 e'-6
- }
+ \key e \major
+ e8\5 fis\5 gis\5 a\5 b\5 cis'\5 dis'\5 e'\5
+ e8\4 fis\4 gis\4 a\4 b\4 cis'\4 dis'\4 e'\4
+ e8 fis gis a b cis' dis' e'
+ \property Score.minimumFret = #5
+ e8 fis gis a b cis' dis' e'
+}
\score {
\context StaffGroup <
\context Staff <
- % Hide fingering number (used for string number) for the "normal" staff
- \property Staff.Fingering \override #'transparent = ##t
-
- \partition
+ \clef "G_8"
+ \partition
>
\context TabStaff <
- \partition
+ \partition
>
>
}
virtual bool do_equal_b (Request const*) const;
};
+class String_number_req : public Script_req
+{
+protected:
+ VIRTUAL_COPY_CONS (Music);
+ virtual bool do_equal_b (Request const*) const;
+};
/// request which has some kind of pitch
struct Melodic_req :virtual Request
ALPHAWORD {A}+
DIGIT {N}
UNSIGNED {N}+
+E_UNSIGNED \\{N}+
FRACTION {N}+\/{N}+
INT -?{UNSIGNED}
REAL ({INT}\.{N}*)|(-?\.{N}+)
yylval.i = String_convert::dec2int (String (YYText ()));
return UNSIGNED;
}
+ {E_UNSIGNED} {
+ yylval.i = String_convert::dec2int (String (YYText () +1));
+ return E_UNSIGNED;
+ }
\" {
start_quote ();
return UNSIGNED;
}
+
[{}] {
return YYText ()[0];
case '\\':
return E_BACKSLASH;
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- yylval.i = c -'0';
- return E_DIGIT;
-
default:
return E_CHAR;
}
t->get_mus_property ("text"));
}
+bool
+String_number_req::do_equal_b (Request const* r) const
+{
+ String_number_req const* s = dynamic_cast<String_number_req const*> (r);
+ return s && gh_equal_p (get_mus_property ("string"),
+ s->get_mus_property ("string"));
+}
+
+
bool
Articulation_req::do_equal_b (Request const* r) const
{
/* escaped */
%token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER E_OPEN E_CLOSE
-%token E_LEFTSQUARE E_RIGHTSQUARE E_TILDE E_DIGIT
+%token E_LEFTSQUARE E_RIGHTSQUARE E_TILDE
%token E_BACKSLASH
+%token <i> E_UNSIGNED
%token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET CHORD_SLASH
%token FIGURE_SPACE
-
%type <i> exclamations questions dots optional_rest
%type <i> bass_number bass_mod
%type <scm> br_bass_figure bass_figure figure_list figure_spec
;
-/*
-TODO.
-*/
string_request:
- E_DIGIT { $$ = new Text_script_req (); }
+ E_UNSIGNED {
+ String_number_req* s = new String_number_req;
+ s->set_mus_property ("string-number", gh_int2scm($1));
+ s->set_spot (THIS->here_input ());
+ $$ = s;
+ }
;
+
request_that_take_dir:
gen_text_def
| verbose_request
Link_array<Item> dots_;
Link_array<Note_req> note_reqs_;
- Link_array<Text_script_req> tabstring_reqs_;
+ Link_array<String_number_req> tabstring_reqs_;
public:
TRANSLATOR_DECLARATIONS(Tab_note_heads_engraver);
note_reqs_.push (n);
return true;
}
- else if (Text_script_req * ts = dynamic_cast<Text_script_req*> (m))
+ else if (String_number_req * ts = dynamic_cast<String_number_req*> (m))
{
- if (m->get_mus_property ("text-type") != ly_symbol2scm ("finger")) return false;
-
while(tabstring_reqs_.size () < note_reqs_.size ()-1)
tabstring_reqs_.push(0);
tabstring_reqs_.push(ts);
{
SCM stringTunings = get_property ("stringTunings");
int number_of_strings = ((int) gh_length(stringTunings));
+ bool high_string_one = to_boolean(get_property ("highStringOne"));
Item * note = new Item (get_property ("TabNoteHead"));
if(tabstring_reqs_.size()>i)
tabstring_req = tabstring_reqs_[i];
// printf("%d %d\n",tabstring_reqs_.size(),i);
- size_t lenp;
+ // size_t lenp;
int tab_string;
bool string_found;
if (tabstring_req) {
- char* tab_string_as_string = gh_scm2newstr(tabstring_req->get_mus_property ("text"), &lenp);
- tab_string = atoi(tab_string_as_string);
+ //char* tab_string_as_string = gh_scm2newstr(tabstring_req->get_mus_property ("text"), &lenp);
+ //tab_string = atoi(tab_string_as_string);
+ tab_string = gh_scm2int(tabstring_req->get_mus_property ("string-number"));
string_found = true;
}
else {
- tab_string = number_of_strings;
+ tab_string = high_string_one ? 1 : number_of_strings;
string_found = false;
}
int fret = unsmob_pitch(scm_pitch)->semitone_pitch()
- gh_scm2int(gh_list_ref(stringTunings,gh_int2scm(tab_string-1)));
if(fret<min_fret)
- tab_string--;
+ tab_string += high_string_one ? 1 : -1;
else
string_found = true;
}
SCM text = gh_call3 (proc, gh_int2scm (tab_string), stringTunings, scm_pitch);
- int pos = 2 * (tab_string-1) - number_of_strings; // No tab-note between the string !!!
-
+ int pos = 2 * tab_string - number_of_strings - 1; // No tab-note between the string !!!
+ if(to_boolean(get_property("stringOneTopmost")))
+ pos = -pos;
note->set_grob_property ("text", text);
/* descr */ "Generate one or more tablature noteheads from Music of type Note_req.",
/* creats*/ "TabNoteHead Dots",
/* acks */ "",
-/* reads */ "centralCPosition stringTunings minimumFret tablatureFormat",
+/* reads */ "centralCPosition stringTunings minimumFret tablatureFormat highStringOne stringOneTopmost",
/* write */ "");
automaticMelismata = ##t
defaultBarType = #"|"
- barNumberVisibility = #default-bar-number-visibility
+ barNumberVisibility = #(every-nth-bar-number-visible 1)
explicitClefVisibility = #all-visible
explicitKeySignatureVisibility = #all-visible
% 6 strings
StaffSymbol \override #'line-count = #6
StaffSymbol \override #'staff-space = #1.5
+
+ stringOneTopmost = ##t
+ highStringOne = ##t
+
% One may change the strings tuning as following :
% The lenght of the list must be equal to the number of string
%TabNoteHead \override #'string-tunings = #'(10 10 10 10 10 10)
clefGlyph = #"clefs-tab"
clefPosition = #0
- % Don't draw stems over the tabature figures !
+ % Don't draw stems over the tablature figures !
Stem \override #'avoid-note-head = ##t
% No accidental in tablature !
\remove Accidental_engraver
- stringTunings = #'(-20 -15 -10 -5 -1 4)
+ \remove Key_engraver
+ stringTunings = #guitar-tunings
tablatureFormat = #fret-number-tablature-format
}
(style . default)
(molecule-callback . ,tablature-molecule-callback)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (extra-offset . (0 . -0.65)) ;; UGH! TODO: Clean this up!
(stem-attachment-function . ,tablature-stem-attachment-function)
(meta . ((interfaces
. (rhythmic-head-interface
; The TabNoteHead stem attachment function.
(define (tablature-stem-attachment-function style duration)
- (cons 0.0 1.0)
+ (cons 0.0 0.5) ;; UGH!
)
; The TabNoteHead molecule callback.
+(define guitar-tunings '(4 -1 -5 -10 -15 -20))
; end of tablature functions
(string-encode-integer (quotient i 26))))))
-(define (default-bar-number-visibility n) (> n 1))
+(define ((every-nth-bar-number-visible n) barnum) (and (> barnum 1) (= 0 (modulo barnum n))))
(translator-property-description 'forceClef boolean? "Show clef symbol, even if it hasn't changed. Only active for the first clef after the property is set, not for the full staff.")
(translator-property-description 'graceAccidentalSpace number? "amount space to alot for an accidental")
(translator-property-description 'graceAlignPosition dir? "put the grace note before or after the main note?")
+(translator-property-description 'highStringOne boolean? "Whether the 1st string is the string with
+highest pitch on the instrument (used by the automatic string selector).")
(translator-property-description 'instr markup? "see @code{instrument}")
(translator-property-description 'instrument markup? " If @code{Instrument_name_engraver}
@cindex Instrument_name_engraver
(translator-property-description 'split-interval boolean? "set if part-combiner separated voices based on splitInterval.")
(translator-property-description 'squashedPosition integer? " Vertical position of
squashing for Pitch_squash_engraver.")
+(translator-property-description 'stringOneTopmost boolean? "Whether the 1st string is printed on the
+top line of the tablature.")
(translator-property-description 'stavesFound list? "list of all staff-symbols found.")
(translator-property-description 'stanza markup? "Stanza `number' to print at start of a verse. Use in LyricsVoice context.")