From 890b76e892bd12a8983ac02812e2384caa392d12 Mon Sep 17 00:00:00 2001 From: Mats Bengtsson Date: Wed, 10 May 2000 21:46:32 +0200 Subject: [PATCH] patch::: 1.3.48.mb1 1.3.48.mb1 =========== * Changed noteHeadStyle properties to symbols, for example \property Voice.noteHeadStyle = #'cross --- Generated by (address unknown), From = lilypond-1.3.48, To = lilypond-1.3.48.mb1 usage cd lilypond-source-dir; patch -E -p1 < lilypond-1.3.48.mb1.diff Patches do not contain automatically generated files or (urg) empty directories, i.e., you should rerun autoconf, configure --- CHANGES | 13 +- Documentation/user/properties.itely | 24 ++- VERSION | 2 +- input/test/noteheadstyle.ly | 22 +-- lily/note-head.cc | 6 +- lily/note-heads-engraver.cc | 10 -- scm/generic-property.scm | 7 + scm/generic-property.scm.orig | 255 ++++++++++++++++++++++++++++ scm/lily.scm | 13 +- scripts/convert-mudela.py | 10 +- 10 files changed, 320 insertions(+), 42 deletions(-) create mode 100644 scm/generic-property.scm.orig diff --git a/CHANGES b/CHANGES index 901d0650ab..be6d5a4aa1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,15 @@ -1.3.47.jcn3 +--- ../lilypond-1.3.48/CHANGES Mon May 8 10:48:49 2000 +++ b/CHANGES Wed May 10 21:46:32 2000 +@@ -1,3 +1,9 @@ +1.3.48.mb1 +=========== + +* Changed noteHeadStyle properties to symbols, for example + \property Voice.noteHeadStyle = #'cross + + 1.3.47.mb2 + =========== + 1.3.47.jcn3 =========== * Rewrite of chord-name production in scheme. There are two major styles diff --git a/Documentation/user/properties.itely b/Documentation/user/properties.itely index 815f1a65fb..52af602fee 100644 --- a/Documentation/user/properties.itely +++ b/Documentation/user/properties.itely @@ -47,24 +47,30 @@ TODO: @cindex properties!Thread @table @samp - @item @code{noteheadStyle}@indexcode{noteheadStyle} @propertytype{string} - Selects type of note head. Choices are @code{cross}, - @code{diamond}, @code{harmonic}, @code{transparent}, and @code{""}. - They are shown in that order below. + @item @code{noteHeadStyle}@indexcode{noteHeadStyle} @propertytype{symbol} + Selects type of note head. Choices are @code{'cross}, + @code{'diamond}, @code{'harmonic}, @code{'transparent}, + @code{'mensural}, @code{'baroque}, and @code{'default}. + They are shown in that order below. The @code{'baroque}, + style gives the default symbols except for brevis and + longa notes which are square shaped as in the @code{'mensural} + style. @mudela[center,verbatim] \score { \notes { \property Staff.barNonAuto = 1 - \property Voice.noteHeadStyle = cross + \property Voice.noteHeadStyle = #'cross a' - \property Voice.noteHeadStyle = diamond + \property Voice.noteHeadStyle = #'diamond a' - \property Voice.noteHeadStyle = harmonic + \property Voice.noteHeadStyle = #'harmonic a' - \property Voice.noteHeadStyle = transparent + \property Voice.noteHeadStyle = #'transparent a' - \property Voice.noteHeadStyle = "" + \property Voice.noteHeadStyle = #'mensural + a' + \property Voice.noteHeadStyle = #'default a' } \paper { diff --git a/VERSION b/VERSION index f5024157bd..991b5d3fa3 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=48 -MY_PATCH_LEVEL=jcn1 +MY_PATCH_LEVEL=mb1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/test/noteheadstyle.ly b/input/test/noteheadstyle.ly index 9ff6337dcf..86202823ca 100644 --- a/input/test/noteheadstyle.ly +++ b/input/test/noteheadstyle.ly @@ -1,36 +1,36 @@ \score { \notes \relative c{ c''4 c2 c8 c16 c16 c1 c\breve -\property Voice.noteHeadStyle = "diamond" +\property Voice.noteHeadStyle = #'diamond c4 c2 c8 c16 c16 c1 c\breve -\property Voice.noteHeadStyle = "transparent" +\property Voice.noteHeadStyle = #'transparent c4 c2 c8 c16 c16 c1 c\breve -\property Voice.noteHeadStyle = "cross" +\property Voice.noteHeadStyle = #'cross c4 c2 c8 c16 c16 c1 c\breve -\property Voice.noteHeadStyle = "mensural" +\property Voice.noteHeadStyle = #'mensural c4 c2 c8 c16 c16 c1 c\breve c\longa -\property Voice.noteHeadStyle = "harmonic" +\property Voice.noteHeadStyle = #'harmonic c4 c2 c8 c16 c16 c1 c\breve -\property Voice.noteHeadStyle = "baroque" +\property Voice.noteHeadStyle = #'baroque c4 c2 c8 c16 c16 c1 c\breve c\longa \context Voice < \context Thread = TA - { \property Thread.noteHeadStyle = "cross" + { \property Thread.noteHeadStyle = #'cross \property Voice.verticalDirection = \up c16} \context Thread = TB - { \property Thread.noteHeadStyle = "" a16 } + { \property Thread.noteHeadStyle = #'default a16 } \context Thread = TC - { \property Thread.noteHeadStyle = "mensural" d16 } + { \property Thread.noteHeadStyle = #'mensural d16 } > \context Voice <\context Thread = TA { - \property Thread.noteHeadStyle = #'() + \property Thread.noteHeadStyle = #'default c4 c4 } \context Thread = TB { - \property Thread.noteHeadStyle = "mensural" + \property Thread.noteHeadStyle = #'mensural c'4 \stemdown c } > diff --git a/lily/note-head.cc b/lily/note-head.cc index a89dee5aa0..91dbeec61d 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -87,13 +87,13 @@ Note_head::do_brew_molecule() const SCM style = get_elt_property ("style"); if (style == SCM_UNDEFINED) { - style = ly_str02scm(""); + style = ly_symbol2scm("default"); } Molecule out = lookup_l()->afm_find (String ("noteheads-") + - ly_scm2string (scm_eval (gh_list (ly_symbol2scm("noteheadsymbol"), + ly_scm2string (scm_eval (gh_list (ly_symbol2scm("find-notehead-symbol"), gh_int2scm(balltype_i ()), - style, + ly_quote_scm(style), SCM_UNDEFINED)))); Box ledgerless = out.dim_; diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 9dcc875192..780b642500 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -58,7 +58,6 @@ Note_heads_engraver::do_process_music() if (note_p_arr_.size ()) return ; - SCM noteheadstyle = get_property ("noteHeadStyle"); for (int i=0; i < note_req_l_arr_.size (); i++) { Note_head *note_p = new Note_head; @@ -86,15 +85,6 @@ Note_heads_engraver::do_process_music() } si.set_position(note_req_l->pitch_.steps ()); - /* - TODO: transparent note heads. - */ - - if (gh_string_p (noteheadstyle)) - { - note_p->set_elt_property ("style", noteheadstyle); - } - Score_element_info itinf (note_p,note_req_l); announce_element (itinf); note_p_arr_.push (note_p); diff --git a/scm/generic-property.scm b/scm/generic-property.scm index 1506982fb6..57ef8859ba 100644 --- a/scm/generic-property.scm +++ b/scm/generic-property.scm @@ -132,6 +132,11 @@ (define generic-All-properties (cons "all" (list (list 'fontSize number? 'fontsize)))) + +(define generic-notehead-properties + (cons "Note_head" (list (list 'noteHeadStyle symbol? 'style)))) + + (define generic-rest-properties (cons "Rest" (list (list 'restStyle string? 'reststyle)))) @@ -206,6 +211,7 @@ generic-tie-properties generic-tie-column-properties generic-tuplet-spanner-properties + generic-notehead-properties generic-rest-properties generic-slur-properties generic-beam-properties @@ -239,6 +245,7 @@ (define generic-thread-properties (list generic-All-properties + generic-notehead-properties generic-dot-properties ) diff --git a/scm/generic-property.scm.orig b/scm/generic-property.scm.orig new file mode 100644 index 0000000000..1506982fb6 --- /dev/null +++ b/scm/generic-property.scm.orig @@ -0,0 +1,255 @@ + +; +; Format: +; (cons "Type name" +; (list PROPERTYDESCRIPTIONS)) +; +; where +; PROPERTYDESCRIPTION +; is +; +; (list 'translatorPropertySymbol type-predicate backend-property-symbol) +; +; Descriptions earlier in the list take precedence over later descriptions. +; + + +(define generic-beam-properties + (cons "Beam" + (list + (list 'beamSlopeDamping number? 'damping) + (list 'autoKneeGap number? 'auto-knee-gap) + (list 'autoInterstaffKneeGap number? 'auto-interstaff-knee-gap) + (list 'beamDirAlgorithm symbol? 'beam-dir-algorithm) + (list 'beamHeight number? 'height-hs) + (list 'beamVerticalPosition number? 'y-position-hs) + ) + ) + ) + + +(define generic-stem-properties + (cons "Stem" + (list + (list 'stemVerticalDirection dir? 'direction) + (list 'verticalDirection dir? 'direction) + (list 'stemLength number? 'length) + (list 'flagStyle string? 'flag-style) + (list 'stemCentered boolean? 'stem-centered) + (list 'noStemExtend boolean? 'no-stem-extend) + (list 'stemShorten number? 'shorten) + )) + ) + +(define generic-dot-properties + (cons "Dots" (list + (list 'dotDirection dir? 'direction) + (list 'verticalDirection dir? 'direction) + ) + )) + +(define generic-script-properties + (cons "Script" (list + (list 'articulationScriptVerticalDirection dir? 'direction) + (list 'articulationScriptPadding number? 'padding) + + )) + ) + + + +(define generic-text-properties + (cons "Text_item" (list + (list 'textStyle string? 'style) + (list 'textScriptPadding number? 'padding) + (list 'textVerticalAlignment dir? 'self-alignment-Y) + (list 'textHorizontalAlignment dir? 'self-alignment-X) + (list 'textScriptWordSpace number? 'word-space) + ) + )) + +(define generic-sustain-pedal-properties + (cons "Sustain_pedal" (list + (list 'textScriptPadding number? 'padding) + (list 'sustainPedalPadding number? 'padding)))) + +(define generic-chord-name-properties + (cons "Chord_name" (list + (list 'textScriptWordSpace number? 'word-space) + (list 'chordNameWordSpace number? 'word-space) + (list 'chordNameStyle string? 'style)))) + +(define generic-crescendo-properties + (cons "Crescendo" (list + (list 'dynamicDirection dir? 'direction) + (list 'verticalDirection dir? 'direction) + (list 'dynamicPadding number? 'padding) + (list 'dynamicMinimumSpace number? 'minimum-space) + ))) + +(define generic-dynamic-line-spanner-properties + (cons "Dynamic_line_spanner" (list + (list 'dynamicDirection dir? 'direction) + (list 'verticalDirection dir? 'direction) + (list 'dynamicPadding number? 'padding) + (list 'dynamicMinimumSpace number? 'minimum-space) + ))) + +(define generic-volta-spanner-properties + (cons "Volta_spanner" (list + (list 'voltaVerticalDirection dir? 'direction) + (list 'voltaPadding number? 'padding) + (list 'voltaMinimumSpace number? 'minimum-space) + ))) + +(define generic-bar-properties + (cons "Staff_bar" (list + (list 'barSize number? 'bar-size)) + ) + ) + +; don't do this yet. Depends on whennn the staff is really announced +(define generic-staff-symbol-properties + (cons "Staff_symbol" (list + ) + ) + ) + +(define generic-breathing-sign-properties + (cons "Breathing_sign" + (list + (list 'breathingSignVerticalDirection dir? 'direction) + (list 'verticalDirection dir? 'direction) + ))) + +(define generic-clef-properties + (cons "Clef_item" + (list + (list 'clefStyle string? 'style)) + ) + ) + +(define generic-All-properties + (cons "all" (list (list 'fontSize number? 'fontsize)))) + +(define generic-rest-properties + (cons "Rest" (list (list 'restStyle string? 'reststyle)))) + +(define generic-rest-collision-properties + (cons "Rest_collision" (list (list 'maximumRestCount number? 'maximum-rest-count)))) + +(define generic-tie-properties + (cons "Tie" (list + (list 'tieVerticalDirection dir? 'direction) + (list 'verticalDirection dir? 'direction) +(list 'tieDash number? 'dashed) + ))) + +(define generic-tie-column-properties + (cons "Tie_column" (list + (list 'tieVerticalDirection dir? 'direction) + (list 'verticalDirection dir? 'direction) + ))) + +(define generic-note-column-properties + (cons "Note_column" + (list + (list 'horizontalNoteShift number? 'horizontal-shift) + (list 'forceHorizontalShift number? 'force-hshift) + ))) + +(define generic-collision-properties + (cons "Collision" + (list + (list 'collisionMergeDotted boolean? 'merge-differently-dotted) + ) + ) + ) + +(define generic-slur-properties + (cons "Slur" + (list + (list 'slurVerticalDirection dir? 'direction) + (list 'verticalDirection dir? 'direction) + (list 'slurDash number? 'dashed)))) + +(define generic-timesig-properties + (cons "Time_signature" + (list + (list 'timeSignatureStyle string? 'style)))) + +(define (symbol-or-boolean? s) + (or (boolean? s) (symbol? s))) + +(define generic-tuplet-spanner-properties + (cons "Tuplet_spanner" + (list + (list 'tupletNumberVisibility symbol-or-boolean? 'tuplet-number-visibility) + (list 'tupletBracketVisibility symbol-or-boolean? 'tuplet-bracket-visibility) + )) +) + + + + + +;;;;;;;;;; +;; don't forget to add these to the Generic_property_list property in +;; engraver.ly + +(define generic-voice-properties + (list + generic-stem-properties + generic-breathing-sign-properties + generic-crescendo-properties + generic-dynamic-line-spanner-properties + generic-tie-properties + generic-tie-column-properties + generic-tuplet-spanner-properties + generic-rest-properties + generic-slur-properties + generic-beam-properties + generic-text-properties + generic-sustain-pedal-properties + generic-note-column-properties + generic-script-properties + generic-All-properties + )) + +(define generic-grace-properties generic-voice-properties) +(define generic-staff-properties + (list + generic-text-properties + generic-bar-properties + generic-timesig-properties + generic-clef-properties + generic-collision-properties + generic-sustain-pedal-properties + generic-rest-collision-properties + generic-volta-spanner-properties +; generic-staff-symbol-properties + generic-All-properties + ) + ) +(define generic-grand-staff-properties + (list + generic-text-properties + generic-bar-properties + )) + +(define generic-thread-properties + (list generic-All-properties + generic-dot-properties + ) + + ) + +(define generic-lyrics-properties + (list generic-text-properties + ) +) + +(define generic-chord-staff-properties + (list generic-chord-name-properties + ) +) diff --git a/scm/lily.scm b/scm/lily.scm index ab6d5ff38e..e7da9d43a9 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -146,15 +146,16 @@ '(minimum-space 0.0))))) -(define (noteheadsymbol duration style) - (cond - ((equal? style "cross") "2cross") - ((equal? style "harmonic") "0mensural") - ((equal? style "baroque") +(define (find-notehead-symbol duration style) + (case style + ((cross) "2cross") + ((harmonic) "0mensural") + ((baroque) (string-append (number->string duration) (if (< duration 0) "mensural" ""))) + ((default) (number->string duration)) (else - (string-append (number->string duration) style)))) + (string-append (number->string duration) (symbol->string style))))) ;;;;;;;; TeX diff --git a/scripts/convert-mudela.py b/scripts/convert-mudela.py index 1bfa4f6370..e55c4db7ce 100644 --- a/scripts/convert-mudela.py +++ b/scripts/convert-mudela.py @@ -455,7 +455,7 @@ if 1: return str conversions.append ((1,3,41), conv, - '[:16 c4 d4 ] -> \repeat "tremolo" 2 { c16 d16 }') + '[:16 c4 d4 ] -> \\repeat "tremolo" 2 { c16 d16 }') if 1: def conv (str): @@ -465,6 +465,14 @@ if 1: conversions.append ((1,3,42), conv, 'Staff_margin_engraver deprecated, use Instrument_name_engraver') +if 1: + def conv (str): + str = re.sub ('note[hH]eadStyle\\s*=\\s*"?(\\w+)"?' , "noteHeadStyle = #'\\1", str) + return str + + conversions.append ((1,3,49), conv, + 'noteHeadStyle value: string -> symbol') + ############################ -- 2.39.2