From 390ec40810a44836770b0a4da0bd4b958d9b7157 Mon Sep 17 00:00:00 2001 From: hanwen Date: Thu, 5 Feb 2004 00:02:49 +0000 Subject: [PATCH] * lily/lily-guile.cc (alist_to_hashq): new function * scm/lily.scm (alist->hash-table): new function. * Documentation/user/refman.itely (Percussion staves): update doco. * input/regression/drums.ly (timb): updates * lily/note-performer.cc (create_audio_elements): robustness fix. * ly/engraver-init.ly: add DrumStaff and DrumVoice contexts * lily/drum-note-engraver.cc: new file. * ly/drumpitch-init.ly: move drum definitions * scm/drums.scm: remove file. * lily/*.cc: remove abort-event everywhere. * lily/note-heads-engraver.cc (process_music): robustification. * lily/accidental-engraver.cc (process_acknowledged_grobs): robustification. * lily/parser.yy (simple_element): add \drums mode. (simple_element): remove \pitchnames , \chordmodifiers. Use variables to store this. * lily/lexer.ll (My_lily_lexer): remove support for \PITCHNAME outside \notes. --- ChangeLog | 33 ++ Documentation/topdocs/NEWS.texi | 13 +- Documentation/user/refman.itely | 284 ++++------ VERSION | 2 +- input/regression/drums.ly | 80 +-- lily/accidental-engraver.cc | 3 + lily/beam-engraver.cc | 14 +- lily/cluster-engraver.cc | 12 +- lily/coherent-ligature-engraver.cc | 2 +- lily/drum-note-engraver.cc | 197 +++++++ lily/dynamic-engraver.cc | 15 - lily/gregorian-ligature-engraver.cc | 2 +- lily/include/lily-guile.hh | 2 +- lily/include/my-lily-lexer.hh | 4 +- lily/include/script.hh | 4 + lily/lexer.ll | 33 +- lily/ligature-bracket-engraver.cc | 2 +- lily/ligature-engraver.cc | 12 +- lily/lily-guile.cc | 17 + lily/lyric-extender.cc | 6 +- lily/mensural-ligature-engraver.cc | 2 +- lily/my-lily-lexer.cc | 5 +- lily/new-fingering-engraver.cc | 7 +- lily/note-heads-engraver.cc | 11 +- lily/note-performer.cc | 14 +- lily/parser.yy | 67 ++- lily/phrasing-slur-engraver.cc | 17 +- lily/piano-pedal-engraver.cc | 16 +- lily/script-engraver.cc | 23 +- lily/slur-engraver.cc | 17 +- lily/text-spanner-engraver.cc | 8 - lily/vaticana-ligature-engraver.cc | 2 +- ly/catalan.ly | 6 +- ly/chord-modifiers-init.ly | 4 +- ly/declarations-init.ly | 3 +- ly/deutsch.ly | 6 +- ly/drumpitch-init.ly | 243 +++++++- ly/english.ly | 6 +- ly/engraver-init.ly | 808 ++++++++++++++------------- ly/espanol.ly | 6 +- ly/init.ly | 1 - ly/italiano.ly | 6 +- ly/nederlands.ly | 5 +- ly/norsk.ly | 5 +- ly/suomi.ly | 7 +- ly/svenska.ly | 6 +- mf/feta-bolletjes.mf | 2 +- scm/define-music-properties.scm | 2 + scm/define-music-types.scm | 7 - scm/define-translator-properties.scm | 8 + scm/document-music.scm | 5 - scm/drums.scm | 332 ----------- scm/lily.scm | 20 +- scripts/convert-ly.py | 18 + 54 files changed, 1262 insertions(+), 1170 deletions(-) create mode 100644 lily/drum-note-engraver.cc delete mode 100644 scm/drums.scm diff --git a/ChangeLog b/ChangeLog index b4876dcbc0..62a9524764 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2004-02-05 Han-Wen Nienhuys + + * lily/lily-guile.cc (alist_to_hashq): new function + + * scm/lily.scm (alist->hash-table): new function. + + * Documentation/user/refman.itely (Percussion staves): update doco. + + * input/regression/drums.ly (timb): updates + + * lily/note-performer.cc (create_audio_elements): robustness fix. + + * ly/engraver-init.ly: add DrumStaff and DrumVoice contexts + 2004-02-05 Jan Nieuwenhuizen * scripts/filter-lilypond-book.py (find_toplevel_snippets): Do not @@ -5,6 +19,25 @@ 2004-02-04 Han-Wen Nienhuys + * lily/drum-note-engraver.cc: new file. + + * ly/drumpitch-init.ly: move drum definitions + + * scm/drums.scm: remove file. + + * lily/*.cc: remove abort-event everywhere. + + * lily/note-heads-engraver.cc (process_music): robustification. + + * lily/accidental-engraver.cc (process_acknowledged_grobs): robustification. + + * lily/parser.yy (simple_element): add \drums mode. + (simple_element): remove \pitchnames , \chordmodifiers. Use + variables to store this. + + * lily/lexer.ll (My_lily_lexer): remove support for \PITCHNAME + outside \notes. + * VERSION: release 2.1.18. * input/test: remove octave-duplicate.ly diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index 41916e01df..254494e6ef 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -18,8 +18,19 @@ Version 2.1.13 @itemize @bullet +@item Drum notation is now supported natively: +percussion may be entered in @code{\drums} mode, and printed in a +@code{DrumStaff} context: + +@example + \score @{ + \drums \new DrumStaff @{ hihat4 cowbell8 @} + @} +@end example + + @item The automatic staff changer was internally rewritten. As a -result, the syntax has been simplified as well: +result, the syntax has been simplified as well: @example \autochange @var{the music} diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 7178017d45..0d5fa6950c 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -2780,68 +2780,57 @@ of percussion. @syntax -Percussion staves are typeset with help of a set of Scheme -functions. The system is based on the general MIDI drum-pitches. -Include @file{drumpitch-init.ly} to use drum pitches. This file -defines the pitches from the Scheme variable @code{drum-pitch-names}, -the definition of which can be read in @file{scm/drums.scm}. Each -piece of percussion has a full name and an abbreviated name, and either -the full name or the abbreviation may be used in input files. - -To typeset the music on a staff apply the function @code{drums->paper} -to the percussion music. This function takes a list of percussion -instrument names, notehead scripts and staff positions (i.e. -pitches relative to the C-clef) and transforms the input -music by moving the pitch, changing the notehead and (optionally) -adding a script: +Percussion notes may be entered in @code{\drums} mode, which is +similar to @code{notes}. Each piece of percussion has a full name and +an abbreviated name, and both be used in input files: + +@lilypond[singleline] + \drums { hihat4 hh4 } +@end lilypond + +To typeset the music, the notes must be interpreted in a +@internalsref{DrumStaff} and @internalsref{DrumVoice} contexts: + @c @lilypond[singleline,verbatim,quote] -\include "drumpitch-init.ly" -up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat } -down = \notes { bassdrum4 snare8 bd r bd sn4 } +up = \drums { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat } +down = \drums { bassdrum4 snare8 bd r bd sn4 } \score { - \apply #(drums->paper 'drums) \context Staff << - \clef percussion - \new Voice { \voiceOne \up } - \new Voice { \voiceTwo \down } - >> -} - + \new DrumStaff + << \new DrumVoice { \voiceOne \up } + \new DrumVoice { \voiceTwo \down } +>> } @end lilypond -In the above example the music was transformed using the list @code{'drums}. -The following lists are defined in @file{scm/drums.scm}: + +There are also other layout possibilities. To use these, set the +property @code{drumStyleTable} in context @internalsref{DrumVoice}. +The following variables have been predefined: + @table @code -@item 'drums -to typeset a typical drum kit on a five-line staff: +@item drums-style +is the default. It typesets a typical drum kit on a five-line staff @lilypond[noindent] -\include "drumpitch-init.ly" nam = \lyrics { cymc cyms cymr hh hhc hho hhho hhp cb hc bd sn ss tomh tommh tomml toml tomfh tomfl } -mus = \notes { cymc cyms cymr hh hhc hho hhho hhp cb hc +mus = \drums { cymc cyms cymr hh | hhc hho hhho hhp | \break cb hc bd sn ss tomh tommh tomml toml tomfh tomfl s16 } \score { - << - \apply #(drums->paper 'drums) \context Staff << - \clef percussion - \mus - >> - \context Lyrics \nam - >> - \paper { - linewidth = 100.0\mm - \translator { - \StaffContext + << \new DrumStaff\with { \remove Bar_engraver \remove Time_signature_engraver + Stem \set #'transparent = ##t + Stem \set #'Y-extent-callback = ##f minimumVerticalExtent = #'(-4.0 . 5.0) - } - \translator { - \VoiceContext - \remove Stem_engraver - } - } -} + } \mus + \context Lyrics \nam + >> + \paper { + %% need to do this, because of indented @itemize + linewidth= 9 \cm + \translator { \ScoreContext + BarNumber \set #'transparent =##T +}}} @end lilypond The drum scheme supports six different toms. When there fewer toms, simply @@ -2849,129 +2838,92 @@ select the toms that produce the desired result, i.e. to get toms on the three middle lines you use @code{tommh}, @code{tomml} and @code{tomfh}. -Because general MIDI does not contain rimshots the sidestick is used -for this purpose instead. -@item 'timbales +@item timbales-style to typeset timbales on a two line staff: @lilypond[singleline] -\include "drumpitch-init.ly" nam = \lyrics { timh ssh timl ssl cb } -mus = \notes { timh ssh timl ssl cb s16 } +mus = \drums { timh ssh timl ssl cb s16 } \score { << - \apply #(drums->paper 'timbales) \context Staff << - \clef percussion - \mus - >> - \context Lyrics \nam - >> - \paper { - \translator { - \StaffContext + \context DrumStaff \with { \remove Bar_engraver \remove Time_signature_engraver + Stem \set #'transparent = ##t + Stem \set #'Y-extent-callback = ##f StaffSymbol \override #'line-count = #2 StaffSymbol \override #'staff-space = #2 minimumVerticalExtent = #'(-3.0 . 4.0) - } - \translator { - \VoiceContext - \remove Stem_engraver - } - - } + drumStyleTable = #timbales-style + } \mus + \context Lyrics \nam + >> } @end lilypond -@item 'congas +@item congas-style to typeset congas on a two line staff: @lilypond[singleline] -\include "drumpitch-init.ly" nam = \lyrics { cgh cgho cghm ssh cgl cglo cglm ssl } -mus = \notes { cgh cgho cghm ssh cgl cglo cglm ssl s16 } +mus = \drums { cgh cgho cghm ssh cgl cglo cglm ssl s16 } \score { << - \apply #(drums->paper 'congas) \context Staff << - \clef percussion - \mus - >> - \context Lyrics \nam - >> - \paper { - \translator { - \StaffContext + \context DrumStaff\with { \remove Bar_engraver \remove Time_signature_engraver + drumStyleTable = #congas-style StaffSymbol \override #'line-count = #2 + + %% this sucks; it will lengthen stems. StaffSymbol \override #'staff-space = #2 - minimumVerticalExtent = #'(-3.0 . 4.0) - } - \translator { - \VoiceContext - \remove Stem_engraver - } - } + Stem \set #'transparent = ##t + Stem \set #'Y-extent-callback = ##f + } \mus + \context Lyrics \nam + >> } @end lilypond -@item 'bongos +@item bongos-style to typeset bongos on a two line staff: @lilypond[singleline] -\include "drumpitch-init.ly" nam = \lyrics { boh boho bohm ssh bol bolo bolm ssl } -mus = \notes { boh boho bohm ssh bol bolo bolm ssl s16 } +mus = \drums { boh boho bohm ssh bol bolo bolm ssl s16 } \score { << - \apply #(drums->paper 'bongos) \context Staff << - \clef percussion - \mus - >> - \context Lyrics \nam - >> - \paper { - \translator { - \StaffContext + \context DrumStaff\with { \remove Bar_engraver \remove Time_signature_engraver StaffSymbol \override #'line-count = #2 + drumStyleTable = #bongos-style + + %% this sucks; it will lengthen stems. StaffSymbol \override #'staff-space = #2 - minimumVerticalExtent = #'(-3.0 . 4.0) - } - \translator { - \VoiceContext - \remove Stem_engraver - } - } + Stem \set #'transparent = ##t + Stem \set #'Y-extent-callback = ##f + } \mus + \context Lyrics \nam + >> } @end lilypond -@item 'percussion + +@item percussion-style to typeset all kinds of simple percussion on one line staves: @lilypond[singleline] -\include "drumpitch-init.ly" nam = \lyrics { tri trio trim gui guis guil cb cl tamb cab mar hc } -mus = \notes { tri trio trim gui guis guil cb cl tamb cab mar hc s16 } +mus = \drums { tri trio trim gui guis guil cb cl tamb cab mar hc s16 } \score { << - \apply #(drums->paper 'percussion) \context Staff << - \clef percussion - \mus - >> - \context Lyrics \nam - >> - \paper { - \translator { - \StaffContext + \context DrumStaff\with{ \remove Bar_engraver - \remove Time_signature_engraver + drumStyleTable = #percussion-style StaffSymbol \override #'line-count = #1 - minimumVerticalExtent = #'(-2.0 . 3.0) - } - \translator { - \VoiceContext - \remove Stem_engraver - } - } + \remove Time_signature_engraver + Stem \set #'transparent = ##t + Stem \set #'Y-extent-callback = ##f + } \mus + \context LyricsVoice \nam + >> } @end lilypond @end table @@ -2980,61 +2932,42 @@ If you do not like any of the predefined lists you can define your own list at the top of your file: @lilypond[singleline, verbatim] -#(set-drum-kit 'mydrums `( - (bassdrum default #f ,(ly:make-pitch -1 2 0)) - (snare default #f ,(ly:make-pitch 0 1 0)) - (hihat cross #f ,(ly:make-pitch 0 5 0)) - (pedalhihat xcircle "stopped" ,(ly:make-pitch 0 5 0)) - (lowtom diamond #f ,(ly:make-pitch -1 6 0)) +#(define mydrums '( + (bassdrum default #f -1) + (snare default #f 0) + (hihat cross #f 1) + (pedalhihat xcircle "stopped" 2) + (lowtom diamond #f 3) )) -\include "drumpitch-init.ly" -up = \notes { hh8 hh hh hh hhp4 hhp } -down = \notes { bd4 sn bd toml8 toml } -\score { - \apply #(drums->paper 'mydrums) \context Staff << - \clef percussion - \new Voice { \voiceOne \up } - \new Voice { \voiceTwo \down } +up = \drums { hh8 hh hh hh hhp4 hhp } +down = \drums { bd4 sn bd toml8 toml } +\score { + \new DrumStaff << + \property DrumStaff.drumStyleTable + = #(alist->hash-table mydrums) + \new DrumVoice { \voiceOne \up } + \new DrumVoice { \voiceTwo \down } >> } @end lilypond -To use a modified existing list, one can prepend modifications to the -the existing list: -@example -#(set-drum-kit 'mydrums (append `( - (bassdrum default #f ,(ly:make-pitch -1 2 0)) - (lowtom diamond #f ,(ly:make-pitch -1 6 0)) -) (get-drum-kit 'drums))) -@end example +@seealso + +Init files: @file{ly/drumpitch-init.ly} + +@refbugs + +Short polyphonic notation, @code{<< @dots{} \\ @dots{} >>}, does not +work for @internalsref{DrumVoices}. + -You can easily combine percussion notation with pitched notation. -Indeed, the file @file{drumpitch-init.ly} replaces the normal pitch -names, so you will have to reinclude @file{nederlands.ly} after the -drum-pattern-definitions to enter normal notes: -@c -@lilypond[singleline,verbatim] -\include "drumpitch-init.ly" -up = \notes { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat } -down = \notes { bassdrum4 snare8 bd r bd sn4 } -\include "nederlands.ly" -bass = \notes \transpose c c,, { a4. e8 r e g e } -\score { - << - \apply #(drums->paper 'drums) \new Staff << - \clef percussion - \new Voice { \voiceOne \up } - \new Voice { \voiceTwo \down } - >> - \new Staff { \clef "F_8" \bass } - >> -} -@end lilypond @node Percussion MIDI output @subsection Percussion MIDI output +@ignore + In order to produce correct MIDI output you need to produce two score blocks---one for the paper and one for the MIDI output. To use the percussion channel you set the property @code{instrument} to @@ -3060,12 +2993,15 @@ none of the scheme functions to get the correct MIDI output: @} @end example -@refbugs +Because general MIDI does not contain rimshots the sidestick is used +for this purpose instead. -Chords entered with @code{< @dots{} >} do not work. This scheme is a -temporary implementation. +@end ignore + +@refbugs +MIDI output for drums is temporarily broken. @node Piano music @section Piano music diff --git a/VERSION b/VERSION index 1c463fd07a..135f37eea5 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=1 -PATCH_LEVEL=18 +PATCH_LEVEL=19 MY_PATCH_LEVEL= diff --git a/input/regression/drums.ly b/input/regression/drums.ly index 95ba4501af..8d1785b43e 100644 --- a/input/regression/drums.ly +++ b/input/regression/drums.ly @@ -1,64 +1,36 @@ -% tests drum notation and midi-drums. -% see ly/drumpitch-init.ly for list of instruments and paper-kits. -% scm/midi.scm for list of midi-drumkits. \header { -texidoc = "Drum notation, although kludgy, should work." + texidoc = "Test drum notation." } -\include "drumpitch-init.ly" -\version "2.1.7" - -drh = \notes { cymc4.^"crash" hhc16^"h.h." hh \repeat "unfold" 5 {hhc8 hho hhc8 hh16 hh} hhc4 r4 r2 } -drl = \notes {\repeat "unfold" 3 {bd4 sn8 bd bd4 << bd ss >> } bd8 tommh tommh bd toml toml bd tomfh16 tomfh } -timb = \notes \repeat "unfold" 2 {timh4 ssh timl8 ssh r timh r4 ssh8 timl r4 cb8 cb} - -\score { \repeat "volta" 2 - << - \context TwoLineStaff=timbst \notes << - \property Staff.instrument="timbales" - \clef "percussion" - \apply #(drums->paper 'timbales) \timb - >> - \context Staff=drumst \notes << - \property Staff.instrument="drums" - \clef "percussion" - \apply #(drums->paper 'drums) << - \context Voice=voa {\stemUp \drh } - \context Voice=vob {\stemDown \drl } +\version "2.1.19" + +drh = \drums { cymc4.^"crash" hhc16^"h.h." hh \repeat "unfold" 5 {hhc8 hho hhc8 hh16 hh} hhc4 r4 r2 } +drl = \drums {\repeat "unfold" 3 {bd4 sn8 bd bd4 << bd ss >> } bd8 tommh tommh bd toml toml bd tomfh16 tomfh } +timb = \drums \repeat "unfold" 2 {timh4 ssh timl8 ssh r timh r4 ssh8 timl r4 cb8 cb} + +\score { + \repeat "volta" 2 + << + \new DrumStaff \with { + drumStyleTable = #timbales-style + StaffSymbol \override #'line-count = #2 + BarLine \override #'bar-size = #2 + } << + \property Staff.instrument="timbales" + \timb + >> + \new DrumStaff << + \property Staff.instrument="drums" + \new DrumVoice {\stemUp \drh } + \new DrumVoice {\stemDown \drl } + >> >> - >> - >> - \paper { - \translator { - \StaffContext - \consists Instrument_name_engraver - Script \override #'padding = #0.5 - } - \translator { - \StaffContext - \name TwoLineStaff - \alias Staff - \consists Instrument_name_engraver - StaffSymbol \override #'line-count = #2 - BarLine \override #'bar-size = #2 - } - \translator { - \ScoreContext - \accepts TwoLineStaff - } - } -} + \paper {} -\score { \repeat "unfold" 2 - \context Staff \notes << - \property Staff.instrument="drums" - \timb - \drh - \drl - >> - \midi{ \tempo 4=120 } + %% broken: + \midi{ \tempo 4=120 } } diff --git a/lily/accidental-engraver.cc b/lily/accidental-engraver.cc index 3548a84ee6..ec6f3e451a 100644 --- a/lily/accidental-engraver.cc +++ b/lily/accidental-engraver.cc @@ -241,6 +241,9 @@ Accidental_engraver::process_acknowledged_grobs () Translator_group * origin = accidentals_[i].origin_; Pitch * pitch = unsmob_pitch (note->get_mus_property ("pitch")); + if (!pitch) + continue; + int num = number_accidentals (note, pitch, origin, accidentals, barnum); int num_caut = number_accidentals (note, pitch, origin, cautionaries, barnum); bool cautionary = to_boolean (note->get_mus_property ("cautionary")); diff --git a/lily/beam-engraver.cc b/lily/beam-engraver.cc index 27cfca6069..335863b9cd 100644 --- a/lily/beam-engraver.cc +++ b/lily/beam-engraver.cc @@ -94,15 +94,7 @@ Beam_engraver::Beam_engraver () bool Beam_engraver::try_music (Music *m) { - if (m->is_mus_type ("abort-event")) - { - evs_drul_[START] = 0; - evs_drul_[STOP] = 0; - if (beam_) - beam_->suicide (); - beam_ = 0; - } - else if (m->is_mus_type ("beam-event")) + if (m->is_mus_type ("beam-event")) { Direction d = to_dir (m->get_mus_property ("span-direction")); if (d == START && !valid_start_point ()) @@ -301,7 +293,7 @@ ENTER_DESCRIPTION(Beam_engraver, /* descr */ "Handles Beam events by engraving Beams. If omitted, then notes will be " "printed with flags instead of beams.", /* creats*/ "Beam", -/* accepts */ "beam-event abort-event", +/* accepts */ "beam-event", /* acks */ "stem-interface rest-interface", /* reads */ "beamMelismaBusy beatLength subdivideBeams", /* write */ ""); @@ -344,7 +336,7 @@ ENTER_DESCRIPTION(Grace_beam_engraver, " are at grace points in time. " , /* creats*/ "Beam", -/* accepts */ "beam-event abort-event", +/* accepts */ "beam-event", /* acks */ "stem-interface rest-interface", /* reads */ "beamMelismaBusy beatLength allowBeamBreak subdivideBeams", /* write */ ""); diff --git a/lily/cluster-engraver.cc b/lily/cluster-engraver.cc index a58a5f57b1..3f6f0cb5b9 100644 --- a/lily/cluster-engraver.cc +++ b/lily/cluster-engraver.cc @@ -67,15 +67,7 @@ Cluster_spanner_engraver::typeset_grobs () bool Cluster_spanner_engraver::try_music (Music *m) { - if (m->is_mus_type ("abort-event")) - { - if (spanner_) - { - spanner_->suicide (); - spanner_ = 0; - } - } - else if (m->is_mus_type ("cluster-note-event")) + if (m->is_mus_type ("cluster-note-event")) { cluster_notes_.push (m); return true; @@ -147,7 +139,7 @@ Cluster_spanner_engraver::acknowledge_grob (Grob_info info) ENTER_DESCRIPTION(Cluster_spanner_engraver, /* descr */ "Engraves a cluster using Spanner notation ", /* creats*/ "ClusterSpanner ClusterSpannerBeacon", -/* accepts */ "cluster-note-event abort-event", +/* accepts */ "cluster-note-event", /* acks */ "note-column-interface", /* reads */ "", /* write */ ""); diff --git a/lily/coherent-ligature-engraver.cc b/lily/coherent-ligature-engraver.cc index 50e6d57057..98570dec3c 100644 --- a/lily/coherent-ligature-engraver.cc +++ b/lily/coherent-ligature-engraver.cc @@ -222,7 +222,7 @@ Coherent_ligature_engraver::typeset_ligature (Spanner *ligature, ENTER_DESCRIPTION (Coherent_ligature_engraver, /* descr */ "This is an abstract class. Subclasses such as Gregorian_ligature_engraver handle ligatures by glueing special ligature heads together.", /* creats*/ "", -/* accepts */ "ligature-event abort-event", +/* accepts */ "ligature-event", /* acks */ "note-head-interface rest-interface", /* reads */ "", /* write */ ""); diff --git a/lily/drum-note-engraver.cc b/lily/drum-note-engraver.cc new file mode 100644 index 0000000000..89d8dfd441 --- /dev/null +++ b/lily/drum-note-engraver.cc @@ -0,0 +1,197 @@ +/* + drum-note-engraver.cc + + (c) 1997--2003 Han-Wen Nienhuys +*/ +#include + +#include "rhythmic-head.hh" +#include "event.hh" +#include "item.hh" +#include "engraver.hh" +#include "warn.hh" +#include "side-position-interface.hh" +#include "script.hh" +#include "stem.hh" +#include "note-column.hh" + +class Drum_notes_engraver : public Engraver +{ + Link_array notes_; + Link_array dots_; + Link_array scripts_; + Link_array events_; + +public: + TRANSLATOR_DECLARATIONS(Drum_notes_engraver); + +protected: + virtual bool try_music (Music *ev) ; + virtual void process_music (); + virtual void acknowledge_grob (Grob_info); + virtual void stop_translation_timestep (); +}; + +Drum_notes_engraver::Drum_notes_engraver() +{ +} + +bool +Drum_notes_engraver::try_music (Music *m) +{ + if (m->is_mus_type ("note-event")) + { + events_.push (m); + return true; + } + else if (m->is_mus_type ("busy-playing-event")) + return events_.size (); + else if (m->is_mus_type ("start-playing-event")) + return events_.size (); + + return false; +} + + +void +Drum_notes_engraver::process_music () +{ + SCM tab = 0; + for (int i=0; i < events_.size (); i++) + { + if (!tab) + tab = get_property ("drumStyleTable"); + + Item *note = make_item ("NoteHead"); + Music * ev = events_[i]; + + Duration dur = *unsmob_duration (ev->get_mus_property ("duration")); + + note->set_grob_property ("duration-log", gh_int2scm (dur.duration_log ())); + + if (dur.dot_count ()) + { + Item * d = make_item ("Dots"); + Rhythmic_head::set_dots (note, d); + + if (dur.dot_count () + != robust_scm2int (d->get_grob_property ("dot-count"), 0)) + d->set_grob_property ("dot-count", gh_int2scm (dur.dot_count ())); + + d->set_parent (note, Y_AXIS); + announce_grob (d, SCM_EOL); + dots_.push (d); + } + + SCM drum_type = ev->get_mus_property ("drum-type"); + + SCM defn = SCM_EOL; + + if (scm_hash_table_p (tab) == SCM_BOOL_T) + defn = scm_hashq_ref (tab, drum_type, SCM_EOL); + + if (gh_pair_p (defn)) + { + SCM pos = gh_caddr (defn); + SCM style =gh_car (defn); + SCM script = gh_cadr (defn); + + if (scm_integer_p (pos) == SCM_BOOL_T) + note->set_grob_property ("staff-position", pos); + if (gh_symbol_p (style)) + note->set_grob_property ("style", style); + + if (gh_string_p (script)) + { + Item *p = make_item ("Script"); + SCM desc = SCM_EOL; + make_script_from_event (p, &desc, + daddy_trans_, script, + 0); + + if (p->get_grob_property ("follow-into-staff")) + p->set_grob_property ("staff-padding", SCM_EOL); + + announce_grob (p, ev->self_scm ()); + + p->set_parent (note, Y_AXIS); + Side_position_interface::add_support (p, note); + scripts_.push (p); + } + } + + + + announce_grob (note,ev->self_scm()); + notes_.push (note); + } +} + +void +Drum_notes_engraver::acknowledge_grob (Grob_info inf) +{ + if (Stem::has_interface (inf.grob_)) + { + for (int i=0; i < scripts_.size (); i++) + { + Grob*e = scripts_[i]; + + if (to_dir (e->get_grob_property ("side-relative-direction"))) + e->set_grob_property ("direction-source", inf.grob_->self_scm ()); + + /* + add dep ? + */ + e->add_dependency (inf.grob_); + Side_position_interface::add_support (e, inf.grob_); + } + } + else if (Note_column::has_interface (inf.grob_)) + { + for (int i=0; i < scripts_.size (); i++) + { + Grob *e = scripts_[i]; + + if (!e->get_parent (X_AXIS) && + Side_position_interface::get_axis (e) == Y_AXIS) + { + e->set_parent (inf.grob_, X_AXIS); + } + } + } + +} + + +void +Drum_notes_engraver::stop_translation_timestep () +{ + for (int i=0; i < notes_.size (); i++) + { + typeset_grob (notes_[i]); + } + notes_.clear (); + for (int i=0; i < dots_.size (); i++) + { + typeset_grob (dots_[i]); + } + dots_.clear (); + for (int i=0; i < scripts_.size (); i++) + { + typeset_grob (scripts_[i]); + } + scripts_.clear (); + + events_.clear (); +} + + + +ENTER_DESCRIPTION(Drum_notes_engraver, +/* descr */ "Generate noteheads.", +/* creats*/ "NoteHead Dots Script", +/* accepts */ "note-event busy-playing-event", +/* acks */ "stem-interface note-column-interface", +/* reads */ "drumStyleTable", +/* write */ ""); + diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 9d62bec204..c559689b2f 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -94,21 +94,6 @@ Dynamic_engraver::try_music (Music * m) script_ev_ = m; return true; } - else if (m->is_mus_type ("abort-event")) - { - accepted_spanreqs_drul_[LEFT] = 0; - accepted_spanreqs_drul_[RIGHT] = 0; - /* - Let's not kill the line spanner, since that would fuck up - earlier, not-to-be-terminated stuff. - - It will disappear by itself when stop_translation_timestep - () finds that there is nothing to support anymore. */ - - if (cresc_) - cresc_->suicide (); - cresc_ = 0; - } else if (m->is_mus_type ("decrescendo-event") || m->is_mus_type ("crescendo-event")) { diff --git a/lily/gregorian-ligature-engraver.cc b/lily/gregorian-ligature-engraver.cc index 20c5cd06e5..579aae5c79 100644 --- a/lily/gregorian-ligature-engraver.cc +++ b/lily/gregorian-ligature-engraver.cc @@ -277,7 +277,7 @@ Gregorian_ligature_engraver::stop_translation_timestep () ENTER_DESCRIPTION (Gregorian_ligature_engraver, /* descr */ "This is an abstract class. Subclasses such as Vaticana_ligature_engraver handle ligatures by glueing special ligature heads together.", /* creats*/ "", -/* accepts */ "ligature-event abort-event", +/* accepts */ "ligature-event", /* acks */ "note-head-interface rest-interface", /* reads */ "", /* write */ ""); diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 1a8883b9ab..79701a9b3b 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -173,7 +173,7 @@ SCM ly_number2string (SCM s); SCM parse_symbol_list (char const *); SCM robust_list_ref(int i, SCM l); - +SCM alist_to_hashq (SCM); inline SCM ly_cdr (SCM x) { return SCM_CDR (x); } inline SCM ly_car (SCM x) { return SCM_CAR (x); } diff --git a/lily/include/my-lily-lexer.hh b/lily/include/my-lily-lexer.hh index e50fd7273c..68c50f332c 100644 --- a/lily/include/my-lily-lexer.hh +++ b/lily/include/my-lily-lexer.hh @@ -37,7 +37,7 @@ public: Scheme hash tables with (oct name acc) values, and symbol keys */ Protected_scm chordmodifier_tab_; - Protected_scm pitchname_tab_; + Protected_scm pitchname_tab_stack_; Keyword_table * keytable_; int errorlevel_; @@ -56,7 +56,7 @@ public: void start_main_input (); SCM lookup_identifier (String s); - void push_note_state (); + void push_note_state (SCM tab); void push_markup_state (); void push_figuredbass_state (); void push_chord_state (); diff --git a/lily/include/script.hh b/lily/include/script.hh index d6681f2d02..060e51e4bf 100644 --- a/lily/include/script.hh +++ b/lily/include/script.hh @@ -28,5 +28,9 @@ public: DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); }; +void make_script_from_event (Grob *p, + SCM * descr, Translator_group*tg, + SCM type, + int index); #endif /* Stem_SCRIPT_HH */ diff --git a/lily/lexer.ll b/lily/lexer.ll index 1c859e27a4..bf829eab80 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -606,8 +606,9 @@ HYPHEN -- %% void -My_lily_lexer::push_note_state () +My_lily_lexer::push_note_state (SCM tab) { + pitchname_tab_stack_ = gh_cons (tab, pitchname_tab_stack_); yy_push_state (notes); } @@ -637,6 +638,8 @@ My_lily_lexer::push_markup_state () void My_lily_lexer::pop_state () { + if (YYSTATE == notes) + pitchname_tab_stack_ = gh_cdr (pitchname_tab_stack_); yy_pop_state (); } @@ -653,7 +656,7 @@ My_lily_lexer::scan_escaped_word (String str) { // use more SCM for this. - SCM sym = ly_symbol2scm (str.to_str0 ()); +// SCM sym = ly_symbol2scm (str.to_str0 ()); int l = lookup_keyword (str); if (l != -1) { @@ -666,15 +669,6 @@ My_lily_lexer::scan_escaped_word (String str) return identifier_type (sid); } - if ((YYSTATE != notes) && (YYSTATE != chords)) { - SCM pitch = scm_hashq_get_handle (pitchname_tab_, sym); - - if (gh_pair_p (pitch)) - { - yylval.scm = ly_cdr (pitch); - return NOTENAME_PITCH; - } - } String msg (_f ("unknown escaped string: `\\%s'", str)); LexerError (msg.to_str0 ()); @@ -688,13 +682,18 @@ My_lily_lexer::scan_bare_word (String str) { SCM sym = ly_symbol2scm (str.to_str0 ()); if ((YYSTATE == notes) || (YYSTATE == chords)) { - SCM pitch = scm_hashq_get_handle (pitchname_tab_, sym); - if (gh_pair_p (pitch)) { - yylval.scm = ly_cdr (pitch); - return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH; - } else if ((pitch = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F) + SCM handle = scm_hashq_get_handle (gh_car (pitchname_tab_stack_), sym); + + if (gh_pair_p (handle)) { + yylval.scm = ly_cdr (handle); + if (unsmob_pitch (yylval.scm)) + return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH; + else if (gh_symbol_p (yylval.scm)) + return DRUM_PITCH; + } + else if ((handle = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F) { - yylval.scm = ly_cdr (pitch); + yylval.scm = ly_cdr (handle); return CHORD_MODIFIER; } } diff --git a/lily/ligature-bracket-engraver.cc b/lily/ligature-bracket-engraver.cc index 5b8d9d5583..b95b6b6997 100644 --- a/lily/ligature-bracket-engraver.cc +++ b/lily/ligature-bracket-engraver.cc @@ -65,7 +65,7 @@ Ligature_bracket_engraver::acknowledge_grob (Grob_info info) ENTER_DESCRIPTION(Ligature_bracket_engraver, /* descr */ "Handles Ligature_events by engraving Ligature brackets.", /* creats*/ "TupletBracket", -/* accepts */ "ligature-event abort-event", +/* accepts */ "ligature-event", /* acks */ "rest-interface note-column-interface", /* reads */ "", /* write */ ""); diff --git a/lily/ligature-engraver.cc b/lily/ligature-engraver.cc index 8a93f26434..617072c690 100644 --- a/lily/ligature-engraver.cc +++ b/lily/ligature-engraver.cc @@ -77,15 +77,7 @@ Ligature_engraver::Ligature_engraver () bool Ligature_engraver::try_music (Music *m) { - if (m->is_mus_type ("abort-event")) - { - reqs_drul_[START] = 0; - reqs_drul_[STOP] = 0; - if (ligature_) - ligature_->suicide (); - ligature_ = 0; - } - else if (m->is_mus_type ("ligature-event")) + if (m->is_mus_type ("ligature-event")) { Direction d = to_dir (m->get_mus_property ("span-direction")); reqs_drul_[d] = m; @@ -294,7 +286,7 @@ Ligature_engraver::acknowledge_grob (Grob_info info) ENTER_DESCRIPTION (Ligature_engraver, /* descr */ "Abstract class; a concrete subclass handles Ligature_events by engraving Ligatures in a concrete style.", /* creats */ "", -/* accepts */ "ligature-event abort-event", +/* accepts */ "ligature-event", /* acks */ "note-head-interface rest-interface", /* reads */ "", /* write */ ""); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 104fffc3ba..5c726793cb 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -768,3 +768,20 @@ robust_scm2int (SCM k, int o) return o; } + + +SCM +alist_to_hashq (SCM alist) +{ + int i = scm_ilength (alist); + if (i < 0) + return scm_make_vector (gh_int2scm (0), SCM_EOL); + + SCM tab = scm_make_vector (gh_int2scm (i), SCM_EOL); + for (SCM s = alist; gh_pair_p (s); s = ly_cdr (s)) + { + SCM pt = ly_cdar (s); + scm_hashq_set_x (tab, ly_caar (s), pt); + } + return tab; +} diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 73a1d49119..441d7ea602 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -48,8 +48,8 @@ Lyric_extender::brew_molecule (SCM smob) return SCM_EOL; /* - It seems that short extenders are even lengthened to go past the note head, but - haven't found a pattern in it yet. --hwn 1/1/04 + It seems that short extenders are even lengthened to go past the + note head, but haven't found a pattern in it yet. --hwn 1/1/04 */ SCM minlen = me->get_grob_property ("minimum-length"); @@ -73,7 +73,7 @@ Lyric_extender::brew_molecule (SCM smob) Real w = right_point - left_point; - if (w < 0) + if (w < 1.5 * h) return SCM_EOL; Molecule mol (Lookup::round_filled_box (Box (Interval (0,w), Interval (0,h)), diff --git a/lily/mensural-ligature-engraver.cc b/lily/mensural-ligature-engraver.cc index f982a11ac7..1611f40cb9 100644 --- a/lily/mensural-ligature-engraver.cc +++ b/lily/mensural-ligature-engraver.cc @@ -448,7 +448,7 @@ Mensural_ligature_engraver::build_ligature (Spanner *ligature, ENTER_DESCRIPTION (Mensural_ligature_engraver, /* descr */ "Handles Mensural_ligature_events by glueing special ligature heads together.", /* creats*/ "MensuralLigature", -/* accepts */ "ligature-event abort-event", +/* accepts */ "ligature-event", /* acks */ "note-head-interface rest-interface", /* reads */ "", /* write */ ""); diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index c2ee25616e..dbfd239d7c 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -39,7 +39,6 @@ static Keyword_ent the_key_tab[]={ {"bar", BAR}, {"breathe", BREATHE}, {"change", CHANGE}, - {"chordmodifiers", CHORDMODIFIERS}, {"chords", CHORDS}, {"clef", CLEF}, {"consists", CONSISTS}, @@ -47,6 +46,7 @@ static Keyword_ent the_key_tab[]={ {"context", CONTEXT}, {"default", DEFAULT}, {"denies", DENIES}, + {"drums", DRUMS}, {"description", DESCRIPTION}, {"figures",FIGURES}, {"grace", GRACE}, @@ -67,7 +67,6 @@ static Keyword_ent the_key_tab[]={ {"paper", PAPER}, {"partcombine", PARTCOMBINE}, {"partial", PARTIAL}, - {"pitchnames", PITCHNAMES}, {"property", PROPERTY}, {"relative", RELATIVE}, {"remove", REMOVE}, @@ -99,7 +98,7 @@ My_lily_lexer::My_lily_lexer () keytable_ = new Keyword_table (the_key_tab); chordmodifier_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL); - pitchname_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL); + pitchname_tab_stack_ = SCM_EOL; scopes_ = SCM_EOL; diff --git a/lily/new-fingering-engraver.cc b/lily/new-fingering-engraver.cc index 043b432121..6476234aab 100644 --- a/lily/new-fingering-engraver.cc +++ b/lily/new-fingering-engraver.cc @@ -97,8 +97,6 @@ New_fingering_engraver::acknowledge_grob (Grob_info inf) } } -extern void make_script_from_event (Grob *, SCM * descr, Translator_group*tg, Music * event, - int index); void New_fingering_engraver::add_script (Grob * head, Music * event, @@ -107,7 +105,8 @@ New_fingering_engraver::add_script (Grob * head, Finger_tuple ft ; Grob * g= make_item ("Script"); - make_script_from_event (g, &ft.description_, daddy_trans_, event, 0); + make_script_from_event (g, &ft.description_, daddy_trans_, + event->get_mus_property ("articulation-type"), 0); if (g) { ft.script_ =g ; @@ -132,7 +131,7 @@ New_fingering_engraver::add_fingering (Grob * head, Side_position_interface::add_support (ft.script_, head); - int d = gh_scm2int ( event->get_mus_property ("digit")); + int d = gh_scm2int (event->get_mus_property ("digit")); /* TODO: diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index bd8b1c8a86..69880a43f0 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -1,5 +1,5 @@ /* - head-grav.cc -- part of GNU LilyPond + note-heads-engraver.cc -- part of GNU LilyPond (c) 1997--2003 Han-Wen Nienhuys */ @@ -15,14 +15,9 @@ #include "engraver.hh" #include "warn.hh" -/** - make balls and rests - */ - class Note_heads_engraver : public Engraver { Link_array notes_; - Link_array dots_; Link_array note_reqs_; @@ -86,7 +81,7 @@ Note_heads_engraver::process_music () Pitch *pit =unsmob_pitch (req->get_mus_property ("pitch")); - int pos = pit->steps (); + int pos = pit ? pit->steps () : 0; SCM c0 = get_property ("centralCPosition"); if (gh_number_p (c0)) pos += gh_scm2int (c0); @@ -119,7 +114,7 @@ Note_heads_engraver::stop_translation_timestep () ENTER_DESCRIPTION(Note_heads_engraver, /* descr */ "Generate noteheads.", /* creats*/ "NoteHead Dots", -/* accepts */ "note-event busy-playing-event ligature-event abort-event", +/* accepts */ "note-event busy-playing-event", /* acks */ "", /* reads */ "centralCPosition", /* write */ ""); diff --git a/lily/note-performer.cc b/lily/note-performer.cc index eb950c42c7..5ba558cfc7 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -47,11 +47,15 @@ Note_performer::create_audio_elements () while (note_evs_.size ()) { Music* n = note_evs_.pop (); - Pitch pit = * unsmob_pitch (n->get_mus_property ("pitch")); - Audio_note* p = new Audio_note (pit, n->get_length (), transposing_i); - Audio_element_info info (p, n); - announce_element (info); - notes_.push (p); + Pitch *pit = unsmob_pitch (n->get_mus_property ("pitch")); + + if (pit) + { + Audio_note* p = new Audio_note (*pit, n->get_length (), transposing_i); + Audio_element_info info (p, n); + announce_element (info); + notes_.push (p); + } } note_evs_.clear (); } diff --git a/lily/parser.yy b/lily/parser.yy index 268c18715d..de1b8e81c1 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -283,7 +283,6 @@ yylex (YYSTYPE *s, void * v) %token PAPER %token PARTCOMBINE %token PARTIAL -%token PITCHNAMES %token PROPERTY %token RELATIVE %token REMOVE @@ -327,7 +326,8 @@ yylex (YYSTYPE *s, void * v) %token DURATION_IDENTIFIER %token FRACTION %token IDENTIFIER -%token CHORDNAMES +%token DRUMS +%token DRUM_PITCH %token CHORD_MODIFIER %token SCORE_IDENTIFIER %token MUSIC_OUTPUT_DEF_IDENTIFIER @@ -394,7 +394,6 @@ yylex (YYSTYPE *s, void * v) %type translator_spec_block translator_spec_body %type tempo_event -%type notenames_body notenames_block chordmodifiers_block %type script_abbreviation @@ -420,13 +419,7 @@ lilypond: /* empty */ ; toplevel_expression: - notenames_block { - THIS->lexer_->pitchname_tab_ = $1; - } - | chordmodifiers_block { - THIS->lexer_->chordmodifier_tab_ = $1; - } - | lilypond_header { + lilypond_header { THIS->input_file_->header_ = $1; } | score_block { @@ -478,26 +471,7 @@ embedded_scm: ; -chordmodifiers_block: - CHORDMODIFIERS notenames_body { $$ = $2; } - ; - -notenames_block: - PITCHNAMES notenames_body { $$ = $2; } - ; - -notenames_body: - embedded_scm { - int i = scm_ilength ($1); - SCM tab = scm_make_vector (gh_int2scm (i), SCM_EOL); - for (SCM s = $1; gh_pair_p (s); s = ly_cdr (s)) { - SCM pt = ly_cdar (s); - scm_hashq_set_x (tab, ly_caar (s), pt); - } - $$ = tab; - } - ; lilypond_header_body: { @@ -1048,7 +1022,19 @@ basic music objects too, since the meaning is different. } } | NOTES - { THIS->lexer_->push_note_state (); } + { + SCM nn = THIS->lexer_->lookup_identifier ("pitchnames"); + THIS->lexer_->push_note_state (alist_to_hashq (nn)); + } + Music + { $$ = $3; + THIS->lexer_->pop_state (); + } + | DRUMS + { + SCM nn = THIS->lexer_->lookup_identifier ("drumPitchNames"); + THIS->lexer_->push_note_state (alist_to_hashq (nn)); + } Music { $$ = $3; THIS->lexer_->pop_state (); @@ -1065,7 +1051,10 @@ basic music objects too, since the meaning is different. THIS->lexer_->pop_state (); } | CHORDS - { THIS->lexer_->push_chord_state (); } + { + SCM nn = THIS->lexer_->lookup_identifier ("chordmodifiers"); + THIS->lexer_->chordmodifier_tab_ = alist_to_hashq (nn); + THIS->lexer_->push_chord_state (); } Music { Music * chm = MY_MAKE_MUSIC("UnrelativableMusic"); @@ -1960,6 +1949,21 @@ simple_element: n->set_spot (i); $$ = v; } + | DRUM_PITCH optional_notemode_duration { + Input i = THIS->pop_spot (); + + Music *n = MY_MAKE_MUSIC("NoteEvent"); + n->set_mus_property ("duration" ,$2); + n->set_mus_property ("drum-type" , $1); + + Music *v = MY_MAKE_MUSIC("EventChord"); + v->set_mus_property ("elements", scm_list_n (n->self_scm (), SCM_UNDEFINED)); + scm_gc_unprotect_object (n->self_scm()); + v->set_spot (i); + n->set_spot (i); + $$ = v; + + } | figure_spec optional_notemode_duration { Music * m = unsmob_music ($1); Input i = THIS->pop_spot (); @@ -2458,3 +2462,4 @@ get_next_unique_context () return scm_makfrom0str (s); } + diff --git a/lily/phrasing-slur-engraver.cc b/lily/phrasing-slur-engraver.cc index 03f13e6dbb..d4b81eac49 100644 --- a/lily/phrasing-slur-engraver.cc +++ b/lily/phrasing-slur-engraver.cc @@ -48,22 +48,7 @@ Phrasing_slur_engraver::Phrasing_slur_engraver () bool Phrasing_slur_engraver::try_music (Music *ev) { - if (ev->is_mus_type ("abort-event")) - { - for (int i = 0; i < phrasing_slur_l_stack_.size (); i++) - { - phrasing_slur_l_stack_[i]->suicide (); - } - phrasing_slur_l_stack_.clear (); - for (int i = 0; i < end_phrasing_slurs_.size (); i++) - { - end_phrasing_slurs_[i]->suicide (); - } - end_phrasing_slurs_.clear (); - eventses_.clear (); - new_phrasing_slur_evs_.clear (); - } - else if (ev->is_mus_type ("phrasing-slur-event")) + if (ev->is_mus_type ("phrasing-slur-event")) { /* Let's not start more than one phrasing slur per moment. diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index c4fab9af87..c71c424af9 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -159,19 +159,7 @@ Piano_pedal_engraver::acknowledge_grob (Grob_info info) bool Piano_pedal_engraver::try_music (Music *m) { - if (m->is_mus_type ("abort-event")) - { - for (Pedal_info*p = info_list_; p->name_; p ++) - { - p->event_drul_[START] = 0; - p->event_drul_[STOP] = 0; - - if (p->bracket_) - p->bracket_->suicide (); - p->bracket_ = 0; - } - } - else if (m->is_mus_type ("pedal-event")) + if (m->is_mus_type ("pedal-event")) { for (Pedal_info*p = info_list_; p->name_; p ++) { @@ -566,7 +554,7 @@ Piano_pedal_engraver::typeset_all () ENTER_DESCRIPTION (Piano_pedal_engraver, /* descr */ "Engrave piano pedal symbols and brackets.", /* creats*/ "SostenutoPedal SustainPedal UnaCordaPedal SostenutoPedalLineSpanner SustainPedalLineSpanner UnaCordaPedalLineSpanner", -/* accepts */ "pedal-event abort-event", +/* accepts */ "pedal-event", /* acks */ "note-column-interface", /* reads */ "pedalSostenutoStrings pedalSustainStrings pedalUnaCordaStrings pedalSostenutoStyle pedalSustainStyle pedalUnaCordaStyle", /* write */ ""); diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 553561fe7a..ca8d85398b 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -12,6 +12,7 @@ #include "engraver.hh" #include "note-column.hh" #include "translator-group.hh" +#include "warn.hh" struct Script_tuple { @@ -82,29 +83,25 @@ copy_property (Grob * g , SCM sym, SCM alist) ScriptStaccato , ScriptMarcato, etc. ) */ void make_script_from_event (Grob *p, - SCM * descr, Translator_group*tg, Music * event, + SCM * descr, Translator_group*tg, + SCM art_type, int index) { SCM alist = tg->get_property ("scriptDefinitions"); - SCM art_type= event->get_mus_property ("articulation-type"); SCM art = scm_assoc (art_type, alist); if (art == SCM_BOOL_F) { - event->origin ()->warning (_("Don't know how to interpret articulation:")); - event->origin ()->warning (_("Scheme encoding: ")); + warning (_("Don't know how to interpret articulation:")); + warning (_("Scheme encoding: ")); scm_write (art_type, scm_current_error_port ()); return ; } art = gh_cdr (art); - *descr = art; - SCM force_dir = event->get_mus_property ("direction"); - if (is_direction (force_dir) && to_dir (force_dir)) - p->set_grob_property ("direction", force_dir); copy_property (p, ly_symbol2scm ("script-molecule"), art); copy_property (p, ly_symbol2scm ("direction"), art); @@ -136,9 +133,17 @@ Script_engraver::process_music () Grob * p = make_item ("Script"); - make_script_from_event (p, &scripts_[i].description_, daddy_trans_, l, i); + make_script_from_event (p, &scripts_[i].description_, daddy_trans_, + l->get_mus_property ("articulation-type"), + i); scripts_[i].script_ = p; + + + SCM force_dir = l->get_mus_property ("direction"); + if (is_direction (force_dir) && to_dir (force_dir)) + p->set_grob_property ("direction", force_dir); + if (p) announce_grob (p, l->self_scm()); } diff --git a/lily/slur-engraver.cc b/lily/slur-engraver.cc index 33b5a43417..c599540342 100644 --- a/lily/slur-engraver.cc +++ b/lily/slur-engraver.cc @@ -44,22 +44,7 @@ Slur_engraver::Slur_engraver () bool Slur_engraver::try_music (Music *ev) { - if (ev->is_mus_type ("abort-event")) - { - for (int i = 0; i < slur_stack_.size (); i++) - { - slur_stack_[i]->suicide (); - } - slur_stack_.clear (); - for (int i = 0; i < end_slurs_.size (); i++) - { - end_slurs_[i]->suicide (); - } - end_slurs_.clear (); - events_.clear (); - new_slur_evs_.clear (); - } - else if (ev->is_mus_type ("slur-event")) + if (ev->is_mus_type ("slur-event")) { /* Let's not start more than one slur per moment. diff --git a/lily/text-spanner-engraver.cc b/lily/text-spanner-engraver.cc index dd95d7d03c..14b8c3874b 100644 --- a/lily/text-spanner-engraver.cc +++ b/lily/text-spanner-engraver.cc @@ -50,14 +50,6 @@ Text_spanner_engraver::try_music (Music *m) req_drul_[d] = m; return true; } - else if (m->is_mus_type ("abort-event")) - { - req_drul_[LEFT] = 0; - req_drul_[RIGHT] = 0; - if (span_) - span_->suicide (); - span_ = 0; - } return false; } diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index 8839658e8d..3f2f960049 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -581,7 +581,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, ENTER_DESCRIPTION (Vaticana_ligature_engraver, /* descr */ "Handles ligatures by glueing special ligature heads together.", /* creats*/ "VaticanaLigature", -/* accepts */ "ligature-event abort-event", +/* accepts */ "ligature-event", /* acks */ "note-head-interface rest-interface", /* reads */ "", /* write */ ""); diff --git a/ly/catalan.ly b/ly/catalan.ly index 2fd33abd75..cc93ae08f0 100644 --- a/ly/catalan.ly +++ b/ly/catalan.ly @@ -17,7 +17,7 @@ % For using "sostingut" notation, which is also correct -\pitchnames #`( +pitchnamesCatalan = #`( (dobb . ,(ly:make-pitch -1 0 DOUBLE-FLAT)) (dob . ,(ly:make-pitch -1 0 FLAT)) (do . ,(ly:make-pitch -1 0 NATURAL)) @@ -71,6 +71,6 @@ (siss . ,(ly:make-pitch -1 6 DOUBLE-SHARP)) ) +pitchnames = \pitchnamesCatalan - -\version "1.9.8" +\version "2.1.19" diff --git a/ly/chord-modifiers-init.ly b/ly/chord-modifiers-init.ly index 6b0de39aa9..a74dfb5b49 100644 --- a/ly/chord-modifiers-init.ly +++ b/ly/chord-modifiers-init.ly @@ -1,6 +1,6 @@ -\version "1.9.8" +\version "2.1.19" -\chordmodifiers #default-chord-modifier-list +chordmodifiers = #default-chord-modifier-list whiteTriangleMarkup = #(make-override-markup '(font-family . math) (make-simple-markup "M")) diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index 97a45982b1..344e00f0b1 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -1,11 +1,12 @@ #(ly:set-option 'old-relative) -\version "2.1.13" +\version "2.1.19" breve = #(ly:make-duration -1 0) longa = #(ly:make-duration -2 0 ) maxima = #(ly:make-duration -3 0) \include "nederlands.ly" % dutch +\include "drumpitch-init.ly" \include "chord-modifiers-init.ly" \include "script-init.ly" diff --git a/ly/deutsch.ly b/ly/deutsch.ly index 0218310437..b4dec3933a 100644 --- a/ly/deutsch.ly +++ b/ly/deutsch.ly @@ -7,7 +7,7 @@ % added asas and marked ases as `unusual' -\pitchnames #`( +pitchnamesDeutsch = #`( (ceses . ,(ly:make-pitch -1 0 DOUBLE-FLAT)) (ces . ,(ly:make-pitch -1 0 FLAT)) (c . ,(ly:make-pitch -1 0 NATURAL)) @@ -47,6 +47,6 @@ ) +pitchnames = \pitchnamesDeutsch - -\version "1.9.8" +\version "2.1.19" diff --git a/ly/drumpitch-init.ly b/ly/drumpitch-init.ly index 796b73f7bc..cc4ad8e7ef 100644 --- a/ly/drumpitch-init.ly +++ b/ly/drumpitch-init.ly @@ -1,8 +1,241 @@ -\pitchnames -#(append (map (lambda (x) (cons (car x) (caddr x))) drum-pitch-names) - (map (lambda (x) (cons (cadr x) (caddr x))) drum-pitch-names) - ) +drumPitchNames = +#'((acousticbassdrum . acousticbassdrum) + (bassdrum . bassdrum) + (hisidestick . hisidestick) + (sidestick . sidestick) + (losidestick . losidestick) + (acousticsnare . acousticsnare) + (snare . snare) + (handclap . handclap) + (electricsnare . electricsnare) + (lowfloortom . lowfloortom) + (closedhihat . closedhihat) + (hihat . hihat) + (highfloortom . highfloortom) + (pedalhihat . pedalhihat) + (lowtom . lowtom) + (openhihat . openhihat) + (halfopenhihat . halfopenhihat) + (lowmidtom . lowmidtom) + (himidtom . himidtom) + (crashcymbala . crashcymbala) + (crashcymbal . crashcymbal) + (hightom . hightom) + (ridecymbala . ridecymbala) + (ridecymbal . ridecymbal) + (chinesecymbal . chinesecymbal) + (ridebell . ridebell) + (tambourine . tambourine) + (splashcymbal . splashcymbal) + (cowbell . cowbell) + (crashcymbalb . crashcymbalb) + (vibraslap . vibraslap) + (ridecymbalb . ridecymbalb) + (mutehibongo . mutehibongo) + (hibongo . hibongo) + (openhibongo . openhibongo) + (mutelobongo . mutelobongo) + (lobongo . lobongo) + (openlobongo . openlobongo) + (mutehiconga . mutehiconga) + (muteloconga . muteloconga) + (openhiconga . openhiconga) + (hiconga . hiconga) + (openloconga . openloconga) + (loconga . loconga) + (hitimbale . hitimbale) + (lotimbale . lotimbale) + (hiagogo . hiagogo) + (loagogo . loagogo) + (cabasa . cabasa) + (maracas . maracas) + (shortwhistle . shortwhistle) + (longwhistle . longwhistle) + (shortguiro . shortguiro) + (longguiro . longguiro) + (guiro . guiro) + (claves . claves) + (hiwoodblock . hiwoodblock) + (lowoodblock . lowoodblock) + (mutecuica . mutecuica) + (opencuica . opencuica) + (mutetriangle . mutetriangle) + (triangle . triangle) + (opentriangle . opentriangle) + (oneup . oneup) + (twoup . twoup) + (threeup . threeup) + (fourup . fourup) + (fiveup . fiveup) + (onedown . onedown) + (twodown . twodown) + (threedown . threedown) + (fourdown . fourdown) + (fivedown . fivedown) + (bda . acousticbassdrum) + (bd . bassdrum) + (ssh . hisidestick) + (ss . sidestick) + (ssl . losidestick) + (sna . acousticsnare) + (sn . snare) + (hc . handclap) + (sne . electricsnare) + (tomfl . lowfloortom) + (hhc . closedhihat) + (hh . hihat) + (tomfh . highfloortom) + (hhp . pedalhihat) + (toml . lowtom) + (hho . openhihat) + (hhho . halfopenhihat) + (tomml . lowmidtom) + (tommh . himidtom) + (cymca . crashcymbala) + (cymc . crashcymbal) + (tomh . hightom) + (cymra . ridecymbala) + (cymr . ridecymbal) + (cymch . chinesecymbal) + (rb . ridebell) + (tamb . tambourine) + (cyms . splashcymbal) + (cb . cowbell) + (cymcb . crashcymbalb) + (vibs . vibraslap) + (cymrb . ridecymbalb) + (bohm . mutehibongo) + (boh . hibongo) + (boho . openhibongo) + (bolm . mutelobongo) + (bol . lobongo) + (bolo . openlobongo) + (cghm . mutehiconga) + (cglm . muteloconga) + (cgho . openhiconga) + (cgh . hiconga) + (cglo . openloconga) + (cgl . loconga) + (timh . hitimbale) + (timl . lotimbale) + (agh . hiagogo) + (agl . loagogo) + (cab . cabasa) + (mar . maracas) + (whs . shortwhistle) + (whl . longwhistle) + (guis . shortguiro) + (guil . longguiro) + (gui . guiro) + (cl . claves) + (wbh . hiwoodblock) + (wbl . lowoodblock) + (cuim . mutecuica) + (cuio . opencuica) + (trim . mutetriangle) + (tri . triangle) + (trio . opentriangle) + (ua . oneup) + (ub . twoup) + (uc . threeup) + (ud . fourup) + (ue . fiveup) + (da . onedown) + (db . twodown) + (dc . threedown) + (dd . fourdown) + (de . fivedown) + ) + + + +#(map + (lambda (k-v) + (module-define! (current-module) + (car k-v) + (alist->hash-table (cdr k-v))) + ) + '((drums-style . + ( + (acousticbassdrum () #f -3) + (bassdrum () #f -3) + (sidestick cross #f 1) + (acousticsnare () #f 1) + (snare () #f 1) + (handclap triangle #f 1) + (electricsnare () #f 1) + (lowfloortom () #f -4) + (closedhihat cross "stopped" 3) + (hihat cross #f 3) + (highfloortom () #f -2) + (pedalhihat cross #f -5) + (lowtom () #f -1) + (openhihat cross "open" 3) + (halfopenhihat xcircle #f 3) + (lowmidtom () #f 0) + (himidtom () #f 2) + (crashcymbala xcircle #f 5) + (crashcymbal xcircle #f 5) + (hightom () #f 4) + (ridecymbala cross #f 5) + (ridecymbal cross #f 5) + (chinesecymbal mensural #f 5) + (ridebell () #f 5) + (splashcymbal diamond #f 5) + (cowbell triangle #f 5) + (crashcymbalb cross #f 5) + (vibraslap diamond #f 4) + (ridecymbalb cross #f 5) + )) + + (timbales-style . + ((losidestick cross #f -1) + (lotimbale () #f -1) + (cowbell triangle #f 2) + (hisidestick cross #f 1) + (hitimbale () #f 1) + )) + + + (congas-style . + ((losidestick cross #f -1) + (loconga () #f -1) + (openloconga () "open" -1) + (muteloconga () "stopped" -1) + (hisidestick cross #f 1) + (hiconga () #f 1) + (openhiconga () "open" 1) + (mutehiconga () "stopped" 1) + )) + + + (bongos-style . + ((losidestick cross #f -1) + (lobongo () #f -1) + (openlobongo () "open" -1) + (mutelobongo () "stopped" -1) + (hisidestick cross #f 1) + (hibongo () #f 1) + (openhibongo () "open" 1) + (mutehibongo () "stopped" 1) + )) + + + (percussion-style . + ((opentriangle cross "open" 0) + (mutetriangle cross "stopped" 0) + (triangle cross #f 0) + (shortguiro () staccato 0) + (longguiro () tenuto 0) + (guiro () #f 0) + (cowbell triangle #f 0) + (claves () #f 0) + (tambourine () #f 0) + (cabasa cross #f 0) + (maracas () #f 0) + (handclap () #f 0) + )) + )) -\version "1.9.8" diff --git a/ly/english.ly b/ly/english.ly index 97428e9566..6844906424 100644 --- a/ly/english.ly +++ b/ly/english.ly @@ -3,7 +3,7 @@ with s for sharp and f for flat. %} -\pitchnames #`( +pitchnamesEnglish = #`( (cflatflat . ,(ly:make-pitch -1 0 DOUBLE-FLAT)) (cflat . ,(ly:make-pitch -1 0 FLAT)) (c . ,(ly:make-pitch -1 0 NATURAL)) @@ -85,5 +85,7 @@ (bx . ,(ly:make-pitch -1 6 DOUBLE-SHARP)) ) -\version "1.9.8" +pitchnames = pitchnamesEnglish + +\version "2.1.19" diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 3a50e0caee..4f3ac1a647 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -58,32 +58,55 @@ \accepts "Voice" } - \translator { - \type Engraver_group_engraver - \consists "Axis_group_engraver" - minimumVerticalExtent = ##f - extraVerticalExtent = ##f - verticalExtent = ##f - localKeySignature = #'() + \StaffContext + \type "Engraver_group_engraver" + \name DrumStaff + \alias Staff + + \remove "Accidental_engraver" + \remove "Ottava_spanner_engraver" + \remove "Key_engraver" + \remove "Piano_pedal_engraver" + \remove "String_number_engraver" + + \description "Handles typesetting for percussion." + + \denies Voice + \accepts DrumVoice - \accepts Staff - \name StaffContainer + clefGlyph = #"clefs-percussion" + clefPosition = #0 + Script \set #'staff-padding = #0.75 } + \translator { - \type "Engraver_group_engraver" - \name InnerChoirStaff - \consists "System_start_delimiter_engraver" - systemStartDelimiter = #'SystemStartBracket - localKeySignature = #'() + \type Engraver_group_engraver + \consists "Axis_group_engraver" + minimumVerticalExtent = ##f + extraVerticalExtent = ##f + verticalExtent = ##f + localKeySignature = #'() + + \accepts Staff + \name StaffContainer +} - \accepts "Staff" - \accepts "RhythmicStaff" - \accepts "GrandStaff" - \accepts "PianoStaff" - \accepts "Lyrics" - \accepts "ChordNames" +\translator { + \type "Engraver_group_engraver" + \name InnerChoirStaff + \consists "System_start_delimiter_engraver" + systemStartDelimiter = #'SystemStartBracket + localKeySignature = #'() + + \accepts "Staff" + \accepts "DrumStaff" + \accepts "RhythmicStaff" + \accepts "GrandStaff" + \accepts "PianoStaff" + \accepts "Lyrics" + \accepts "ChordNames" } \translator { @@ -99,48 +122,48 @@ \translator{ - \type "Engraver_group_engraver" - - \consists "Output_property_engraver" + \type "Engraver_group_engraver" + + \consists "Output_property_engraver" -\description " + \description " A context like @code{Staff} but for printing rhythms. Pitches are ignored; the notes are printed on one line. " - minimumVerticalExtent = ##f - extraVerticalExtent = ##f - verticalExtent = ##f - localKeySignature = #'() - - \consists "Pitch_squash_engraver" - \consists "Separating_line_group_engraver" - \name RhythmicStaff - \alias "Staff" - - BarLine \override #'bar-size = #4 - VoltaBracket \override #'minimum-space = #15 - VoltaBracket \override #'padding = #5 - StaffSymbol \override #'line-count = #1 - - Stem \override #'neutral-direction = #1 - Beam \override #'neutral-direction = #1 -% \consists "Repeat_engraver" - \consists "Dot_column_engraver" - \consists "Volta_engraver" - \consists "Bar_engraver" - \consists "Time_signature_engraver" - \consists "Staff_symbol_engraver" - \consists "Instrument_name_engraver" - \consistsend "Axis_group_engraver" - \accepts "Voice" + minimumVerticalExtent = ##f + extraVerticalExtent = ##f + verticalExtent = ##f + localKeySignature = #'() + + \consists "Pitch_squash_engraver" + \consists "Separating_line_group_engraver" + \name RhythmicStaff + \alias "Staff" + + BarLine \override #'bar-size = #4 + VoltaBracket \override #'minimum-space = #15 + VoltaBracket \override #'padding = #5 + StaffSymbol \override #'line-count = #1 + + Stem \override #'neutral-direction = #1 + Beam \override #'neutral-direction = #1 + % \consists "Repeat_engraver" + \consists "Dot_column_engraver" + \consists "Volta_engraver" + \consists "Bar_engraver" + \consists "Time_signature_engraver" + \consists "Staff_symbol_engraver" + \consists "Instrument_name_engraver" + \consistsend "Axis_group_engraver" + \accepts "Voice" } \translator { - \type "Engraver_group_engraver" - \name Voice + \type "Engraver_group_engraver" + \name Voice -\description " + \description " Corresponds to a voice on a staff. This context handles the conversion of dynamic signs, stems, beams, super- and subscripts, slurs, ties, and rests. @@ -148,246 +171,277 @@ You have to instantiate this explicitly if you want to have multiple voices on the same staff." - localKeySignature = #'() - \consists "Font_size_engraver" - - \consists "Output_property_engraver" - \consists "Arpeggio_engraver" - \consists "Multi_measure_rest_engraver" - \consists "Text_spanner_engraver" - \consists "Grob_pq_engraver" - - \consists "Note_head_line_engraver" - \consists "Glissando_engraver" - \consists "Ligature_bracket_engraver" - \consists "Breathing_sign_engraver" - % \consists "Rest_engraver" - \consists "Stem_engraver" - \consists "Beam_engraver" - \consists "Grace_beam_engraver" - \consists "Auto_beam_engraver" - \consists "New_fingering_engraver" - \consists "Chord_tremolo_engraver" - \consists "Percent_repeat_engraver" - \consists "Slash_repeat_engraver" - \consists "Melisma_engraver" - \consists "Part_combine_engraver" + localKeySignature = #'() + \consists "Font_size_engraver" + + \consists "Output_property_engraver" + \consists "Arpeggio_engraver" + \consists "Multi_measure_rest_engraver" + \consists "Text_spanner_engraver" + \consists "Grob_pq_engraver" + + \consists "Note_head_line_engraver" + \consists "Glissando_engraver" + \consists "Ligature_bracket_engraver" + \consists "Breathing_sign_engraver" + % \consists "Rest_engraver" + \consists "Stem_engraver" + \consists "Beam_engraver" + \consists "Grace_beam_engraver" + \consists "Auto_beam_engraver" + \consists "New_fingering_engraver" + \consists "Chord_tremolo_engraver" + \consists "Percent_repeat_engraver" + \consists "Slash_repeat_engraver" + \consists "Melisma_engraver" + \consists "Part_combine_engraver" %{ - Must come before text_engraver, but after note_column engraver. + Must come before text_engraver, but after note_column engraver. %} - \consists "Text_engraver" - \consists "Dynamic_engraver" - \consists "Fingering_engraver" - - \consists "Script_engraver" - \consists "Script_column_engraver" - \consists "Rhythmic_column_engraver" - \consists "Phrasing_slur_engraver" - \consists "Cluster_spanner_engraver" - \consists "Slur_engraver" - \consists "Tie_engraver" - \consists "Tuplet_engraver" - - \consists "Skip_event_swallow_translator" - \accepts Thread % bug if you leave out this! + \consists "Text_engraver" + \consists "Dynamic_engraver" + \consists "Fingering_engraver" + + \consists "Script_engraver" + \consists "Script_column_engraver" + \consists "Rhythmic_column_engraver" + \consists "Phrasing_slur_engraver" + \consists "Cluster_spanner_engraver" + \consists "Slur_engraver" + \consists "Tie_engraver" + \consists "Tuplet_engraver" + + \consists "Skip_event_swallow_translator" + \accepts Thread % bug if you leave out this! +} + +\translator { + \VoiceContext + \name DrumVoice + \alias Voice + + \description " A voice on a percussion staff." + + + \remove "Arpeggio_engraver" + \consists "Multi_measure_rest_engraver" + \consists "Text_spanner_engraver" + \consists "Grob_pq_engraver" + + \remove "Note_head_line_engraver" + \remove "Glissando_engraver" + \remove "Ligature_bracket_engraver" + \remove "Note_heads_engraver" + \consists "Rest_engraver" + \consists "Drum_notes_engraver" + \remove "New_fingering_engraver" + + \remove "Fingering_engraver" + + \remove "Phrasing_slur_engraver" + \remove "Cluster_spanner_engraver" + \remove "Slur_engraver" + \consists "Tuplet_engraver" + + \consists "Skip_event_swallow_translator" + \denies Thread } \translator{ - \type Engraver_group_engraver - \name Thread - localKeySignature = #'() -\description " + \type Engraver_group_engraver + \name Thread + localKeySignature = #'() + \description " Handles note heads, and is contained in the Voice context. You have to instantiate this explicitly if you want to adjust the style of individual note heads. " - \consists "Font_size_engraver" - \consists "Note_heads_engraver" - \consists "Rest_engraver" + \consists "Font_size_engraver" + \consists "Note_heads_engraver" + \consists "Rest_engraver" - % why here ? - \consists "Output_property_engraver" + % why here ? + \consists "Output_property_engraver" } \translator{ - \type "Engraver_group_engraver" - \name GrandStaff - localKeySignature = #'() - - \description " A group of staffs, with a brace on the left + \type "Engraver_group_engraver" + \name GrandStaff + localKeySignature = #'() + + \description " A group of staffs, with a brace on the left side, grouping the staves together. The bar lines of the contained staves are connected vertically. " - \consists "Span_bar_engraver" - \consists "Span_arpeggio_engraver" - \consists "System_start_delimiter_engraver" - systemStartDelimiter = #'SystemStartBrace + \consists "Span_bar_engraver" + \consists "Span_arpeggio_engraver" + \consists "System_start_delimiter_engraver" + systemStartDelimiter = #'SystemStartBrace - \accepts "Staff" + \accepts "Staff" } \translator{ - \GrandStaffContext - \name "PianoStaff" - \alias "GrandStaff" -\description " + \GrandStaffContext + \name "PianoStaff" + \alias "GrandStaff" + \description " Just like @code{GrandStaff} but with @code{minVerticalAlign} set equal to @code{maxVerticalAlign} so that interstaff beaming and slurring can be used." - verticalAlignmentChildCallback = #Align_interface::fixed_distance_alignment_callback - VerticalAlignment \override #'forced-distance = #12 - VerticalAlignment \override #'self-alignment-Y = #0 + verticalAlignmentChildCallback = #Align_interface::fixed_distance_alignment_callback + VerticalAlignment \override #'forced-distance = #12 + VerticalAlignment \override #'self-alignment-Y = #0 - \consists "Vertical_align_engraver" - \consists "Instrument_name_engraver" - - instrument = #'() - instr = #'() - -% \consistsend "Axis_group_engraver" + \consists "Vertical_align_engraver" + \consists "Instrument_name_engraver" + + instrument = #'() + instr = #'() } \translator { - \type "Engraver_group_engraver" - \name InnerStaffGroup - localKeySignature = #'() - - \consists "Span_bar_engraver" - \consists "Span_arpeggio_engraver" - \consists "Output_property_engraver" - systemStartDelimiter = #'SystemStartBracket - - \consists "System_start_delimiter_engraver" - \accepts "Staff" - \accepts "RhythmicStaff" - \accepts "GrandStaff" - \accepts "PianoStaff" - \accepts "TabStaff" - \accepts "Lyrics" - \accepts "ChordNames" + \type "Engraver_group_engraver" + \name InnerStaffGroup + localKeySignature = #'() + + \consists "Span_bar_engraver" + \consists "Span_arpeggio_engraver" + \consists "Output_property_engraver" + systemStartDelimiter = #'SystemStartBracket + + \consists "System_start_delimiter_engraver" + \accepts "Staff" + \accepts "RhythmicStaff" + \accepts "DrumStaff" + \accepts "GrandStaff" + \accepts "PianoStaff" + \accepts "TabStaff" + \accepts "Lyrics" + \accepts "ChordNames" } \translator { - \InnerStaffGroupContext - \name StaffGroup - - \description + \InnerStaffGroupContext + \name StaffGroup + + \description - " Groups staffs while adding a bracket on the left side, + " Groups staffs while adding a bracket on the left side, grouping the staves together. The bar lines of the contained staves are connected vertically. " - - \accepts "InnerChoirStaff" - \accepts "ChoirStaff" - \accepts "InnerStaffGroup" - \accepts "FiguredBass" + + \accepts "InnerChoirStaff" + \accepts "ChoirStaff" + \accepts "InnerStaffGroup" + \accepts "FiguredBass" } -% UGH! JUNKME \translator{ - \type "Engraver_group_engraver" - \consistsend "Hara_kiri_engraver" - minimumVerticalExtent = #'(-1.2 . 2.4) - extraVerticalExtent = ##f - verticalExtent = ##f + \type "Engraver_group_engraver" + \consistsend "Hara_kiri_engraver" + minimumVerticalExtent = #'(-1.2 . 2.4) + extraVerticalExtent = ##f + verticalExtent = ##f - \description " + \description " Corresponds to a voice with lyrics. Handles the printing of a single line of lyrics. " - - \name LyricsVoice - \consists "Separating_line_group_engraver" - \consists "Lyric_engraver" - \consists "Extender_engraver" - \consists "Hyphen_engraver" - \consists "Stanza_number_engraver" - \consists "Vocal_name_engraver" - \consists "Skip_event_swallow_translator" - SeparationItem \set #'padding = #0.5 + + \name LyricsVoice + \consists "Separating_line_group_engraver" + \consists "Lyric_engraver" + \consists "Extender_engraver" + \consists "Hyphen_engraver" + \consists "Stanza_number_engraver" + \consists "Vocal_name_engraver" + \consists "Skip_event_swallow_translator" + SeparationItem \set #'padding = #0.5 } + \translator { - \type "Engraver_group_engraver" - \name NoteNames - \consistsend "Axis_group_engraver" + \type "Engraver_group_engraver" + \name NoteNames + \consistsend "Axis_group_engraver" - minimumVerticalExtent = ##f - extraVerticalExtent = ##f - verticalExtent = ##f + minimumVerticalExtent = ##f + extraVerticalExtent = ##f + verticalExtent = ##f - - \consists "Rest_swallow_translator" - \consists "Skip_event_swallow_translator" - \consists "Tie_engraver" - \consists "Note_swallow_translator" - \consists "Note_name_engraver" - \consists "Separating_line_group_engraver" + + \consists "Rest_swallow_translator" + \consists "Skip_event_swallow_translator" + \consists "Tie_engraver" + \consists "Note_swallow_translator" + \consists "Note_name_engraver" + \consists "Separating_line_group_engraver" } \translator { - \type "Engraver_group_engraver" - \name Lyrics - \description "Typesets lyrics." - - %% To get folded repeats right. - \consists Vertical_align_engraver + \type "Engraver_group_engraver" + \name Lyrics + \description "Typesets lyrics." + + %% To get folded repeats right. + \consists Vertical_align_engraver - minimumVerticalExtent = ##f - extraVerticalExtent = ##f - verticalExtent = ##f - - \accepts "LyricsVoice" + minimumVerticalExtent = ##f + extraVerticalExtent = ##f + verticalExtent = ##f + + \accepts "LyricsVoice" } \translator { - \type "Engraver_group_engraver" - \name ChordNames - \description "Typesets chord names." - - \consists "Rest_swallow_translator" - \consists "Output_property_engraver" - \consists "Separating_line_group_engraver" - \consists "Chord_name_engraver" - \consists "Skip_event_swallow_translator" - \consistsend "Hara_kiri_engraver" - - minimumVerticalExtent = #'(0 . 2.5) - extraVerticalExtent = ##f - SeparatingGroupSpanner \override #'padding = #0.8 - verticalExtent = ##f + \type "Engraver_group_engraver" + \name ChordNames + \description "Typesets chord names." + + \consists "Rest_swallow_translator" + \consists "Output_property_engraver" + \consists "Separating_line_group_engraver" + \consists "Chord_name_engraver" + \consists "Skip_event_swallow_translator" + \consistsend "Hara_kiri_engraver" + + minimumVerticalExtent = #'(0 . 2.5) + extraVerticalExtent = ##f + SeparatingGroupSpanner \override #'padding = #0.8 + verticalExtent = ##f } RemoveEmptyStaffContext= \translator { - \StaffContext - \remove "Axis_group_engraver" - \consistsend "Hara_kiri_engraver" - \accepts "Voice" + \StaffContext + \remove "Axis_group_engraver" + \consistsend "Hara_kiri_engraver" + \accepts "Voice" - % hara kiri & auto knee don't work together. - Beam \override #'auto-knee-gap = #'() + % hara kiri & auto knee don't work together. + Beam \override #'auto-knee-gap = #'() } AncientRemoveEmptyStaffContext = \translator { %% why not add by default? - \RemoveEmptyStaffContext - \accepts "VaticanaVoice" - \accepts "GregorianTranscriptionVoice" + \RemoveEmptyStaffContext + \accepts "VaticanaVoice" + \accepts "GregorianTranscriptionVoice" } \translator { - \type Score_engraver - \name Score - localKeySignature = #'() + \type Score_engraver + \name Score + localKeySignature = #'() - \description "This is the top level notation context. No + \description "This is the top level notation context. No other context can contain a @code{Score} context. This context handles the administration of time signatures. It also makes sure that items such as clefs, time signatures, and key-signatures are @@ -397,163 +451,165 @@ AncientRemoveEmptyStaffContext = \translator { not contained in any other context). It is instantiated automatically when an output definition (a @code{\score} or @code{\paper} block) is processed." - - \consists "Repeat_acknowledge_engraver" - \consists "Staff_collecting_engraver" + + \consists "Repeat_acknowledge_engraver" + \consists "Staff_collecting_engraver" - % move the alias along with the engraver. + % move the alias along with the engraver. - %% TODO? add this alias from Timing_engraver::initialize() ? - \consists "Timing_engraver" - \alias "Timing" - - \consists "Output_property_engraver" - \consists "System_start_delimiter_engraver" - \consists "Mark_engraver" - \consists "Metronome_mark_engraver" - \consists "Break_align_engraver" - \consists "Spacing_engraver" - \consists "Vertical_align_engraver" - \consists "Lyric_phrasing_engraver" - \consists "Bar_number_engraver" - \consists "Span_arpeggio_engraver" - - \accepts "Staff" - \accepts "TabStaff" - \accepts "VaticanaStaff" - \accepts "GregorianTranscriptionStaff" - \accepts "StaffContainer" - \accepts "StaffGroup" - \accepts "RhythmicStaff" - \accepts "Lyrics" - \accepts "ChordNames" - \accepts "GrandStaff" - \accepts "ChoirStaff" - \accepts "PianoStaff" - \accepts "Devnull" - \accepts "NoteNames" - \accepts "FiguredBass" - - soloText = #"Solo" - soloIIText = #"Solo II" - aDueText = #"a2" - soloADue = ##t - systemStartDelimiter =#'SystemStartBar - - melismaBusyProperties = #default-melisma-properties - - clefGlyph = #"clefs-G" - clefPosition = #-2 - centralCPosition = #-6 - - defaultBarType = #"|" - barNumberVisibility = #default-bar-number-visibility - automaticBars = ##t - - explicitClefVisibility = #all-visible - explicitKeySignatureVisibility = #all-visible - autoBeamSettings = #default-auto-beam-settings - autoBeaming = ##t - scriptDefinitions = #default-script-alist - - verticalAlignmentChildCallback = #Align_interface::alignment_callback - - pedalSustainStrings = #'("Ped." "*Ped." "*") - pedalSustainStyle = #'text - pedalUnaCordaStrings = #'("una corda" "" "tre corde") - pedalUnaCordaStyle = #'text - - %% These are in ordinary italic font, including the *, - %% but they are unlikely to be used, - %% as the default pedal-style for SostenutoPedal is 'mixed': - %% i.e. Sost. Ped_____________________ - pedalSostenutoStrings = #'("Sost. Ped." "*Sost. Ped." "*") - pedalSostenutoStyle = #'mixed - - fingeringOrientations = #'(up down) - tupletNumberFormatFunction = #denominator-tuplet-formatter - markFormatter = #format-mark-letters - rehearsalMark = #1 - subdivideBeams = ##f - allowBeamBreak = ##f - extraNatural = ##t - autoAccidentals = #'(Staff (same-octave . 0)) - autoCautionaries = #'() - - keyAccidentalOrder = #`( - (6 . ,FLAT) (2 . ,FLAT) (5 . ,FLAT ) (1 . ,FLAT) (4 . ,FLAT) (0 . ,FLAT) (3 . ,FLAT) - (3 . ,SHARP) (0 . ,SHARP) (4 . ,SHARP) (1 . ,SHARP) (5 . ,SHARP) (2 . ,SHARP) (6 . ,SHARP) - (6 . ,DOUBLE-FLAT) (2 . ,DOUBLE-FLAT) (5 . ,DOUBLE-FLAT ) (1 . ,DOUBLE-FLAT) (4 . ,DOUBLE-FLAT) (0 . ,DOUBLE-FLAT) (3 . ,DOUBLE-FLAT) - (3 . ,DOUBLE-SHARP) (0 . ,DOUBLE-SHARP) (4 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (5 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (6 . ,DOUBLE-SHARP) - ) - breakAlignOrder = #'( - instrument-name - left-edge - ambitus - breathing-sign - clef - rehearsal-mark - staff-bar - key-signature - time-signature - custos - ) - barCheckSynchronize = ##f - - %% chord names: - chordNameFunction = #ignatzek-chord-names - majorSevenSymbol = #whiteTriangleMarkup - chordNameSeparator = #(make-simple-markup "/") - chordNameExceptions = #ignatzekExceptions - chordNoteNamer = #'() - chordRootNamer = #note-name->markup - - chordNameExceptionsFull = #fullJazzExceptions - chordNameExceptionsPartial = #partialJazzExceptions - - %% tablature: - 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 - stringTunings = #guitar-tunings - tablatureFormat = #fret-number-tablature-format - - %% - bassFigureFormatFunction = #make-bass-figure-markup - metronomeMarkFormatter = #format-metronome-markup - graceSettings = #`#( - (Voice Stem direction 1) - - ;; TODO: should take from existing definition. - ;; c&p from define-grobs.scm - - (Voice Stem lengths ,(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0))) - (Voice Stem stem-shorten (0.4 0)) - (Voice Stem font-size -3) - (Voice NoteHead font-size -3) - (Voice Dots font-size -3) - (Voice Stem beamed-lengths - ,(map (lambda (x) (* 0.8 x)) '(3.26))) - (Voice Stem beamed-minimum-free-lengths - ,(map (lambda (x) (* 0.8 x)) '(2.5 2.0 1.5))) - (Voice Stem beamed-extreme-minimum-free-lengths - ,(map (lambda (x) (* 0.8 x)) '(1.83 1.5))) - - (Voice Stem no-stem-extend #t) - (Voice Beam thickness 0.384) - (Voice Beam space-function ,(lambda (beam mult) - (* 0.8 (Beam::space_function - beam mult)))) - (Voice Beam position-callbacks (,Beam::least_squares - ,Beam::check_concave - ,Beam::slope_damping)) - (Staff Accidental font-size -4) - (Voice Slur direction -1) - ) + %% TODO? add this alias from Timing_engraver::initialize() ? + \consists "Timing_engraver" + \alias "Timing" + + \consists "Output_property_engraver" + \consists "System_start_delimiter_engraver" + \consists "Mark_engraver" + \consists "Metronome_mark_engraver" + \consists "Break_align_engraver" + \consists "Spacing_engraver" + \consists "Vertical_align_engraver" + \consists "Lyric_phrasing_engraver" + \consists "Bar_number_engraver" + \consists "Span_arpeggio_engraver" + + \accepts "Staff" + \accepts "TabStaff" + \accepts "VaticanaStaff" + \accepts "GregorianTranscriptionStaff" + \accepts "StaffContainer" + \accepts "StaffGroup" + \accepts "RhythmicStaff" + \accepts "DrumStaff" + \accepts "Lyrics" + \accepts "ChordNames" + \accepts "GrandStaff" + \accepts "ChoirStaff" + \accepts "PianoStaff" + \accepts "Devnull" + \accepts "NoteNames" + \accepts "FiguredBass" + + soloText = #"Solo" + soloIIText = #"Solo II" + aDueText = #"a2" + soloADue = ##t + systemStartDelimiter =#'SystemStartBar + + drumStyleTable = #drums-style + + melismaBusyProperties = #default-melisma-properties + + clefGlyph = #"clefs-G" + clefPosition = #-2 + centralCPosition = #-6 + + defaultBarType = #"|" + barNumberVisibility = #default-bar-number-visibility + automaticBars = ##t + + explicitClefVisibility = #all-visible + explicitKeySignatureVisibility = #all-visible + autoBeamSettings = #default-auto-beam-settings + autoBeaming = ##t + scriptDefinitions = #default-script-alist + + verticalAlignmentChildCallback = #Align_interface::alignment_callback + + pedalSustainStrings = #'("Ped." "*Ped." "*") + pedalSustainStyle = #'text + pedalUnaCordaStrings = #'("una corda" "" "tre corde") + pedalUnaCordaStyle = #'text + + %% These are in ordinary italic font, including the *, + %% but they are unlikely to be used, + %% as the default pedal-style for SostenutoPedal is 'mixed': + %% i.e. Sost. Ped_____________________ + pedalSostenutoStrings = #'("Sost. Ped." "*Sost. Ped." "*") + pedalSostenutoStyle = #'mixed + + fingeringOrientations = #'(up down) + tupletNumberFormatFunction = #denominator-tuplet-formatter + markFormatter = #format-mark-letters + rehearsalMark = #1 + subdivideBeams = ##f + allowBeamBreak = ##f + extraNatural = ##t + autoAccidentals = #'(Staff (same-octave . 0)) + autoCautionaries = #'() + + keyAccidentalOrder = #`( + (6 . ,FLAT) (2 . ,FLAT) (5 . ,FLAT ) (1 . ,FLAT) (4 . ,FLAT) (0 . ,FLAT) (3 . ,FLAT) + (3 . ,SHARP) (0 . ,SHARP) (4 . ,SHARP) (1 . ,SHARP) (5 . ,SHARP) (2 . ,SHARP) (6 . ,SHARP) + (6 . ,DOUBLE-FLAT) (2 . ,DOUBLE-FLAT) (5 . ,DOUBLE-FLAT ) (1 . ,DOUBLE-FLAT) (4 . ,DOUBLE-FLAT) (0 . ,DOUBLE-FLAT) (3 . ,DOUBLE-FLAT) + (3 . ,DOUBLE-SHARP) (0 . ,DOUBLE-SHARP) (4 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (5 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (6 . ,DOUBLE-SHARP) + ) + breakAlignOrder = #'( + instrument-name + left-edge + ambitus + breathing-sign + clef + rehearsal-mark + staff-bar + key-signature + time-signature + custos + ) + barCheckSynchronize = ##f + + %% chord names: + chordNameFunction = #ignatzek-chord-names + majorSevenSymbol = #whiteTriangleMarkup + chordNameSeparator = #(make-simple-markup "/") + chordNameExceptions = #ignatzekExceptions + chordNoteNamer = #'() + chordRootNamer = #note-name->markup + chordNameExceptionsFull = #fullJazzExceptions + chordNameExceptionsPartial = #partialJazzExceptions + + %% tablature: + 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 + stringTunings = #guitar-tunings + tablatureFormat = #fret-number-tablature-format + + %% + bassFigureFormatFunction = #make-bass-figure-markup + metronomeMarkFormatter = #format-metronome-markup + graceSettings = #`#( + (Voice Stem direction 1) + + ;; TODO: should take from existing definition. + ;; c&p from define-grobs.scm - \grobdescriptions #all-grob-descriptions + (Voice Stem lengths ,(map (lambda (x) (* 0.8 x)) '(3.5 3.5 3.5 4.5 5.0))) + (Voice Stem stem-shorten (0.4 0)) + (Voice Stem font-size -3) + (Voice NoteHead font-size -3) + (Voice Dots font-size -3) + (Voice Stem beamed-lengths + ,(map (lambda (x) (* 0.8 x)) '(3.26))) + (Voice Stem beamed-minimum-free-lengths + ,(map (lambda (x) (* 0.8 x)) '(2.5 2.0 1.5))) + (Voice Stem beamed-extreme-minimum-free-lengths + ,(map (lambda (x) (* 0.8 x)) '(1.83 1.5))) + + (Voice Stem no-stem-extend #t) + (Voice Beam thickness 0.384) + (Voice Beam space-function ,(lambda (beam mult) + (* 0.8 (Beam::space_function + beam mult)))) + (Voice Beam position-callbacks (,Beam::least_squares + ,Beam::check_concave + ,Beam::slope_damping)) + (Staff Accidental font-size -4) + (Voice Slur direction -1) + ) + + \grobdescriptions #all-grob-descriptions } OrchestralScoreContext = \translator { diff --git a/ly/espanol.ly b/ly/espanol.ly index b3573148bc..595af54c4f 100644 --- a/ly/espanol.ly +++ b/ly/espanol.ly @@ -12,7 +12,7 @@ % For using "sostingut" notation, which is also correct -\pitchnames #`( +pitchnamesEspanol = #`( (dobb . ,(ly:make-pitch -1 0 DOUBLE-FLAT)) (dob . ,(ly:make-pitch -1 0 FLAT)) (do . ,(ly:make-pitch -1 0 NATURAL)) @@ -56,6 +56,6 @@ (siss . ,(ly:make-pitch -1 6 DOUBLE-SHARP)) ) +pitchnames = \pitchnamesEspanol - -\version "1.9.8" +\version "2.1.19" diff --git a/ly/init.ly b/ly/init.ly index 4971f64381..d640456328 100644 --- a/ly/init.ly +++ b/ly/init.ly @@ -3,7 +3,6 @@ #(define-public point-and-click #f) #(define-public midi-debug #f) -#(reset-drum-kit) \version "1.9.8" diff --git a/ly/italiano.ly b/ly/italiano.ly index 291613c0b5..418b9491f3 100644 --- a/ly/italiano.ly +++ b/ly/italiano.ly @@ -11,7 +11,7 @@ % contributed by Paolo Zuliani <> % additions for semi-sharps and semi-flats by Eric Wurbel <> -\pitchnames #`( +pitchnamesItaliano = #`( (dobb . ,(ly:make-pitch -1 0 DOUBLE-FLAT)) (dobsb . ,(ly:make-pitch -1 0 THREE-Q-FLAT)) (dob . ,(ly:make-pitch -1 0 FLAT)) @@ -84,4 +84,6 @@ ) -\version "2.1.0" +pitchnames = \pitchnamesItaliano + +\version "2.1.19" diff --git a/ly/nederlands.ly b/ly/nederlands.ly index f878630223..f0e1ad12be 100644 --- a/ly/nederlands.ly +++ b/ly/nederlands.ly @@ -1,9 +1,9 @@ -\version "1.9.8" +\version "2.1.19" %{ common dutch names for notes. es means flat, is means sharp %} -\pitchnames #`( +dutchPitchnames = #`( (ceses . ,(ly:make-pitch -1 0 DOUBLE-FLAT)) (ceh . ,(ly:make-pitch -1 0 SEMI-FLAT)) @@ -81,3 +81,4 @@ ) +pitchnames = \dutchPitchnames diff --git a/ly/norsk.ly b/ly/norsk.ly index d8cee531fa..1f1ec4fdc4 100644 --- a/ly/norsk.ly +++ b/ly/norsk.ly @@ -27,7 +27,7 @@ %} -\pitchnames #`( +pitchnamesNorsk = #`( (ceses . ,(ly:make-pitch -1 0 DOUBLE-FLAT)) (cessess . ,(ly:make-pitch -1 0 DOUBLE-FLAT)) (ces . ,(ly:make-pitch -1 0 FLAT)) @@ -103,5 +103,6 @@ ) +pitchnames =\pitchnamesNorsk -\version "1.9.8" +\version "2.1.19" diff --git a/ly/suomi.ly b/ly/suomi.ly index 7e111db3b4..1a82687171 100644 --- a/ly/suomi.ly +++ b/ly/suomi.ly @@ -6,7 +6,7 @@ % 2001/08/28 Heikki Junes <> % added bb and marked heses as `unusual' -\pitchnames #`( +pitchnamesSuomi = #`( (ceses . ,(ly:make-pitch -1 0 DOUBLE-FLAT)) (ces . ,(ly:make-pitch -1 0 FLAT)) (c . ,(ly:make-pitch -1 0 NATURAL)) @@ -45,4 +45,7 @@ (his . ,(ly:make-pitch -1 6 SHARP)) (hisis . ,(ly:make-pitch -1 6 DOUBLE-SHARP)) ) -\version "1.9.8" + +pitchnames = \pitchnamesSuomi + +\version "2.1.19" diff --git a/ly/svenska.ly b/ly/svenska.ly index a3e07ce842..d81d7f1467 100644 --- a/ly/svenska.ly +++ b/ly/svenska.ly @@ -3,7 +3,7 @@ % % by Mats Bengtsson. -\pitchnames #`( +pitchnamesSvenska = #`( (cessess . ,(ly:make-pitch -1 0 DOUBLE-FLAT)) (cess . ,(ly:make-pitch -1 0 FLAT)) (c . ,(ly:make-pitch -1 0 NATURAL)) @@ -40,4 +40,6 @@ (hiss . ,(ly:make-pitch -1 6 SHARP)) (hississ . ,(ly:make-pitch -1 6 DOUBLE-SHARP)) ) -\version "1.9.8" + +pitchnames = \pitchnamesSvenska +\version "2.1.19" diff --git a/mf/feta-bolletjes.mf b/mf/feta-bolletjes.mf index 2f4237f3d3..7adbf7f487 100644 --- a/mf/feta-bolletjes.mf +++ b/mf/feta-bolletjes.mf @@ -293,7 +293,7 @@ fet_beginchar("Half diamondhead", "1diamond", fet_endchar; -fet_beginchar("Quart diamondheadh", "2diamondh", "diamondheadh") +fet_beginchar("Quart diamondhead", "2diamond", "diamondhead") draw_outside_ellipse (1.80, 35, 0.495, -0.25); fet_endchar; diff --git a/scm/define-music-properties.scm b/scm/define-music-properties.scm index a118419f74..b3badcf8d0 100644 --- a/scm/define-music-properties.scm +++ b/scm/define-music-properties.scm @@ -45,6 +45,8 @@ TODO: consider making type into symbol ") (music-property-description 'denominator integer? "denominator in a time signature") (music-property-description 'digit integer? "digit for fingering") (music-property-description 'direction ly:dir? "Print this up or down?") +(music-property-description 'drum-type symbol? "Which percussion instrument to play this note on.") + (music-property-description 'tags list? "List of symbols that for denoting extra details, eg. @code{\\tag #'part ...} could tag a piece of music as only being active in a part.") diff --git a/scm/define-music-types.scm b/scm/define-music-types.scm index 6b31bd7524..2c675c159a 100644 --- a/scm/define-music-types.scm +++ b/scm/define-music-types.scm @@ -1,13 +1,6 @@ (define-public music-descriptions `( - (AbortEvent - . ( - (description . "End the currently running spanners.") - (internal-class-name . "Event") - (span-type . "abort") - (types . (general-music event abort-event)) - )) (AbsoluteDynamicEvent . ( (description . "Creates a dynamic mark. Syntax: @var{note}@code{\\x}, diff --git a/scm/define-translator-properties.scm b/scm/define-translator-properties.scm index 617a51fa26..047ef08d88 100644 --- a/scm/define-translator-properties.scm +++ b/scm/define-translator-properties.scm @@ -190,6 +190,14 @@ arpeggios that cross staves. (translator-property-description 'crescendoText markup? "Text to print at start of non-hairpin crecscendo, ie: @samp{cresc.}") (translator-property-description 'crescendoSpanner symbol? "Type of spanner to be used for crescendi. One of: @samp{hairpin}, @samp{line}, @samp{dashed-line}, @samp{dotted-line}. If unset, hairpin type is used.") (translator-property-description 'decrescendoText markup? "Text to print at start of non-hairpin decrecscendo, ie: @samp{dim.}") +(translator-property-description 'drumStyleTable hash-table? + "A hash table containing mapping drums to layout settings. +Predefined values: @code{drums-style}, @code{timbales-style}, @code{congas-style}, @code{bongos-style} +and @code{percussion-style}. + +The layout style is a hash table, containing the drum-pitches (eg. the symbol @code{hihat}) as key, +and a list (@var{notehead-style} @var{script} @var{vertical-position}) as values. + ") (translator-property-description 'currentBarNumber integer? "Contains the current barnumber. This property is incremented at every barline. ") diff --git a/scm/document-music.scm b/scm/document-music.scm index c7979b59b1..97991c8971 100644 --- a/scm/document-music.scm +++ b/scm/document-music.scm @@ -31,11 +31,6 @@ music-descriptions) -(define (hash-table->alist t) - "Convert table t to list" - (apply append - (vector->list t) - )) (define (strip-description x) (cons (symbol->string (car x)) diff --git a/scm/drums.scm b/scm/drums.scm deleted file mode 100644 index 66f3cf8593..0000000000 --- a/scm/drums.scm +++ /dev/null @@ -1,332 +0,0 @@ -;;;; drum-"hack". See input/regression/drums.ly and ly/drumpitch-init.ly -;;;; 2001/03/25 Rune Zedeler - -;;;; changed eval to primitive-eval for guile 1.4/1.4.1 compatibility --jcn - -;; TODO: the design of this hack should be rethought. - - -;; ugh. Should make separate module? -(define-public drum-pitch-names `( - (acousticbassdrum bda ,(ly:make-pitch -3 6 NATURAL)) - (bassdrum bd ,(ly:make-pitch -2 0 NATURAL)) - (hisidestick ssh ,(ly:make-pitch -3 6 DOUBLE-SHARP)) - (sidestick ss ,(ly:make-pitch -2 0 SHARP)) - (losidestick ssl ,(ly:make-pitch -2 1 FLAT)) - (acousticsnare sna ,(ly:make-pitch -2 1 NATURAL)) - (snare sn ,(ly:make-pitch -2 2 DOUBLE-FLAT)) - (handclap hc ,(ly:make-pitch -2 1 SHARP)) - (electricsnare sne ,(ly:make-pitch -2 2 NATURAL)) - (lowfloortom tomfl ,(ly:make-pitch -2 3 NATURAL)) - (closedhihat hhc ,(ly:make-pitch -2 3 SHARP)) - (hihat hh ,(ly:make-pitch -2 4 FLAT)) - (highfloortom tomfh ,(ly:make-pitch -2 4 NATURAL)) - (pedalhihat hhp ,(ly:make-pitch -2 4 SHARP)) - (lowtom toml ,(ly:make-pitch -2 5 NATURAL)) - (openhihat hho ,(ly:make-pitch -2 5 SHARP)) - (halfopenhihat hhho ,(ly:make-pitch -2 5 SHARP)) - (lowmidtom tomml ,(ly:make-pitch -2 6 NATURAL)) - (himidtom tommh ,(ly:make-pitch -1 0 NATURAL)) - (crashcymbala cymca ,(ly:make-pitch -1 0 SHARP)) - (crashcymbal cymc ,(ly:make-pitch -1 1 FLAT)) - (hightom tomh ,(ly:make-pitch -1 1 NATURAL)) - (ridecymbala cymra ,(ly:make-pitch -1 1 SHARP)) - (ridecymbal cymr ,(ly:make-pitch -1 2 FLAT)) - (chinesecymbal cymch ,(ly:make-pitch -1 2 NATURAL)) - (ridebell rb ,(ly:make-pitch -1 3 NATURAL)) - (tambourine tamb ,(ly:make-pitch -1 3 SHARP)) - (splashcymbal cyms ,(ly:make-pitch -1 4 NATURAL)) - (cowbell cb ,(ly:make-pitch -1 4 SHARP)) - (crashcymbalb cymcb ,(ly:make-pitch -1 5 NATURAL)) - (vibraslap vibs ,(ly:make-pitch -1 5 SHARP)) - (ridecymbalb cymrb ,(ly:make-pitch -1 6 NATURAL)) - (mutehibongo bohm ,(ly:make-pitch -1 6 SHARP)) - (hibongo boh ,(ly:make-pitch 0 0 NATURAL)) - (openhibongo boho ,(ly:make-pitch 0 1 DOUBLE-FLAT)) - (mutelobongo bolm ,(ly:make-pitch -1 6 DOUBLE-SHARP)) - (lobongo bol ,(ly:make-pitch 0 0 SHARP)) - (openlobongo bolo ,(ly:make-pitch 0 1 FLAT)) - (mutehiconga cghm ,(ly:make-pitch 0 1 NATURAL)) - (muteloconga cglm ,(ly:make-pitch 0 2 DOUBLE-FLAT)) - (openhiconga cgho ,(ly:make-pitch 0 1 SHARP)) - (hiconga cgh ,(ly:make-pitch 0 2 FLAT)) - (openloconga cglo ,(ly:make-pitch 0 1 DOUBLE-SHARP)) - (loconga cgl ,(ly:make-pitch 0 2 NATURAL)) - (hitimbale timh ,(ly:make-pitch 0 3 NATURAL)) - (lotimbale timl ,(ly:make-pitch 0 3 SHARP)) - (hiagogo agh ,(ly:make-pitch 0 4 NATURAL)) - (loagogo agl ,(ly:make-pitch 0 4 SHARP)) - (cabasa cab ,(ly:make-pitch 0 5 NATURAL)) - (maracas mar ,(ly:make-pitch 0 5 SHARP)) - (shortwhistle whs ,(ly:make-pitch 0 6 NATURAL)) - (longwhistle whl ,(ly:make-pitch 1 0 NATURAL)) - (shortguiro guis ,(ly:make-pitch 1 0 SHARP)) - (longguiro guil ,(ly:make-pitch 1 1 NATURAL)) - (guiro gui ,(ly:make-pitch 1 0 DOUBLE-SHARP)) - (claves cl ,(ly:make-pitch 1 1 SHARP)) - (hiwoodblock wbh ,(ly:make-pitch 1 2 NATURAL)) - (lowoodblock wbl ,(ly:make-pitch 1 3 NATURAL)) - (mutecuica cuim ,(ly:make-pitch 1 3 SHARP)) - (opencuica cuio ,(ly:make-pitch 1 4 NATURAL)) - (mutetriangle trim ,(ly:make-pitch 1 4 SHARP)) - (triangle tri ,(ly:make-pitch 1 4 DOUBLE-SHARP)) - (opentriangle trio ,(ly:make-pitch 1 5 NATURAL)) - ;; "transposing" pitches: - (oneup ua ,(ly:make-pitch 0 1 NATURAL)) - (twoup ub ,(ly:make-pitch 0 2 NATURAL)) - (threeup uc ,(ly:make-pitch 0 3 NATURAL)) - (fourup ud ,(ly:make-pitch 0 4 NATURAL)) - (fiveup ue ,(ly:make-pitch 0 5 NATURAL)) - (onedown da ,(ly:make-pitch -1 6 NATURAL)) - (twodown db ,(ly:make-pitch -1 5 NATURAL)) - (threedown dc ,(ly:make-pitch -1 4 NATURAL)) - (fourdown dd ,(ly:make-pitch -1 3 NATURAL)) - (fivedown de ,(ly:make-pitch -1 2 NATURAL)) -)) - -;; -;; all settings for percussive instruments. -;; public so people can add their own stuff. -;; - -(define-public - percussive-instrument-init-settings - `((drums - . ( - (acousticbassdrum default #f ,(ly:make-pitch -1 4 NATURAL)) - (bassdrum default #f ,(ly:make-pitch -1 4 NATURAL)) - (sidestick cross #f ,(ly:make-pitch 0 1 NATURAL)) - (acousticsnare default #f ,(ly:make-pitch 0 1 NATURAL)) - (snare default #f ,(ly:make-pitch 0 1 NATURAL)) - (handclap triangle #f ,(ly:make-pitch 0 1 NATURAL)) - (electricsnare default #f ,(ly:make-pitch 0 1 NATURAL)) - (lowfloortom default #f ,(ly:make-pitch -1 3 NATURAL)) - (closedhihat cross "stopped" ,(ly:make-pitch 0 3 NATURAL)) - (hihat cross #f ,(ly:make-pitch 0 3 NATURAL)) - (highfloortom default #f ,(ly:make-pitch -1 5 NATURAL)) - (pedalhihat cross #f ,(ly:make-pitch -1 2 NATURAL)) - (lowtom default #f ,(ly:make-pitch -1 6 NATURAL)) - (openhihat cross "open" ,(ly:make-pitch 0 3 NATURAL)) - (halfopenhihat xcircle #f ,(ly:make-pitch 0 3 NATURAL)) - (lowmidtom default #f ,(ly:make-pitch 0 0 NATURAL)) - (himidtom default #f ,(ly:make-pitch 0 2 NATURAL)) - (crashcymbala xcircle #f ,(ly:make-pitch 0 5 NATURAL)) - (crashcymbal xcircle #f ,(ly:make-pitch 0 5 NATURAL)) - (hightom default #f ,(ly:make-pitch 0 4 NATURAL)) - (ridecymbala cross #f ,(ly:make-pitch 0 5 NATURAL)) - (ridecymbal cross #f ,(ly:make-pitch 0 5 NATURAL)) - (chinesecymbal mensural #f ,(ly:make-pitch 0 5 NATURAL)) - (ridebell default #f ,(ly:make-pitch 0 5 NATURAL)) - (splashcymbal diamond #f ,(ly:make-pitch 0 5 NATURAL)) - (cowbell triangle #f ,(ly:make-pitch 0 5 NATURAL)) - (crashcymbalb cross #f ,(ly:make-pitch 0 5 NATURAL)) - (vibraslap diamond #f ,(ly:make-pitch 0 4 NATURAL)) - (ridecymbalb cross #f ,(ly:make-pitch 0 5 NATURAL)) - )) - - (timbales - . ( - (losidestick cross #f ,(ly:make-pitch -1 6 NATURAL)) - (lotimbale default #f ,(ly:make-pitch -1 6 NATURAL)) - (cowbell triangle #f ,(ly:make-pitch 0 2 NATURAL)) - (hisidestick cross #f ,(ly:make-pitch 0 1 NATURAL)) - (hitimbale default #f ,(ly:make-pitch 0 1 NATURAL)) - )) - - (congas - . ( - (losidestick cross #f ,(ly:make-pitch -1 6 NATURAL)) - (loconga default #f ,(ly:make-pitch -1 6 NATURAL)) - (openloconga default "open" ,(ly:make-pitch -1 6 NATURAL)) - (muteloconga default "stopped" ,(ly:make-pitch -1 6 NATURAL)) - (hisidestick cross #f ,(ly:make-pitch 0 1 NATURAL)) - (hiconga default #f ,(ly:make-pitch 0 1 NATURAL)) - (openhiconga default "open" ,(ly:make-pitch 0 1 NATURAL)) - (mutehiconga default "stopped" ,(ly:make-pitch 0 1 NATURAL)) - )) - - (bongos - . ( - (losidestick cross #f ,(ly:make-pitch -1 6 NATURAL)) - (lobongo default #f ,(ly:make-pitch -1 6 NATURAL)) - (openlobongo default "open" ,(ly:make-pitch -1 6 NATURAL)) - (mutelobongo default "stopped" ,(ly:make-pitch -1 6 NATURAL)) - (hisidestick cross #f ,(ly:make-pitch 0 1 NATURAL)) - (hibongo default #f ,(ly:make-pitch 0 1 NATURAL)) - (openhibongo default "open" ,(ly:make-pitch 0 1 NATURAL)) - (mutehibongo default "stopped" ,(ly:make-pitch 0 1 NATURAL)) - )) - - - (percussion - . ( - (opentriangle cross "open" ,(ly:make-pitch 0 0 NATURAL)) - (mutetriangle cross "stopped" ,(ly:make-pitch 0 0 NATURAL)) - (triangle cross #f ,(ly:make-pitch 0 0 NATURAL)) - (shortguiro default "staccato",(ly:make-pitch 0 0 NATURAL)) - (longguiro default "tenuto" ,(ly:make-pitch 0 0 NATURAL)) - (guiro default #f ,(ly:make-pitch 0 0 NATURAL)) - (cowbell triangle #f ,(ly:make-pitch 0 0 NATURAL)) - (claves default #f ,(ly:make-pitch 0 0 NATURAL)) - (tambourine default #f ,(ly:make-pitch 0 0 NATURAL)) - (cabasa cross #f ,(ly:make-pitch 0 0 NATURAL)) - (maracas default #f ,(ly:make-pitch 0 0 NATURAL)) - (handclap default #f ,(ly:make-pitch 0 0 NATURAL)) - )) - )) - - -(define percussive-instrument-settings percussive-instrument-init-settings) - -;; don't use assoc-set!, since this will overwrite Scheme defaults, and leak -;; into other files. -(define-public (set-drum-kit kit value) - (set! percussive-instrument-settings - (acons kit value percussive-instrument-settings))) - -(define-public (reset-drum-kit) - (set! percussive-instrument-settings percussive-instrument-init-settings)) - -(define-public (get-drum-kit kit) - (assoc-get-default kit percussive-instrument-settings '())) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; - -(define (make-articulation-script x) - (let* ((m (make-music-by-name 'ArticulationEvent))) - (ly:set-mus-property! m 'articulation-type x) - m)) - -;; adds the articulation script x to m if x is not #f. -(define (add-articulation-script m x) - (if x - (if (and x (equal? (ly:get-mus-property m 'name) 'EventChord)) - (ly:set-mus-property! m 'elements - (cons (make-articulation-script x) (ly:get-mus-property m 'elements)) - ) - (let* ( (es (ly:get-mus-property m 'elements)) - (e (ly:get-mus-property m 'element)) ) - (map (lambda (y) (add-articulation-script y x)) es) - (if (ly:music? e) - (add-articulation-script e x)) - ) - ) - ) - m - ) - -(define (make-head-type-elem t) - (let* ( (m (make-music-by-name 'OverrideProperty))) - (set-mus-properties! - m - `((symbol . NoteHead) - (grob-property . style) - (grob-value . ,t) - (pop-first . #t))) - m - - ) - ) - -(define (make-head-type t) - (context-spec-music (make-head-type-elem t) 'Thread)) - -(define (make-thread-context thread-name element) - (context-spec-music element 'Thread thread-name)) - -;; makes a sequential-music of thread-context, head-change and note -(define (make-drum-head kit req-ch ) - (let ((es (ly:get-mus-property req-ch 'elements))) - (if (equal? es '()) - req-ch - (let* ((fe (car es)) - (oldp (ly:get-mus-property fe 'pitch)) - ) - (if (not (ly:pitch? oldp)) - req-ch - (let* ((pap ((pitch->paper kit) oldp )) - (style (car pap)) - (script (cadr pap)) - (pitch (caddr pap)) - (ht (make-head-type style)) - (seq (make-sequential-music (list ht req-ch))) - ) - (add-articulation-script req-ch script) - (ly:set-mus-property! fe 'pitch pitch) - (set! req-ch (make-thread-context (symbol->string style) seq)) - req-ch - ) - ) - ) - ) - ) - ) - -;; whoa, hadn't head of "assoc" when I made this :) -(define ((pitch->paper kit) p) - (let p2p ((pitches drum-pitch-names)) - (cond ((eq? pitches '()) - (begin - (display p) ;; UGH. FIXME. pitch->string ??? - (ly:warn " unknown drumpitch.") - (cdar (get-drum-kit kit)) - )) - ((eq? p (caddr (car pitches))) ((name->paper kit) (caar pitches)) ) - (else (p2p (cdr pitches) ) ) - ) - ) - ) - -(define ((name->paper kit) n) - (let n2p ((pitches (get-drum-kit kit))) - (cond ((eq? pitches '()) - (begin - (ly:warn (string-append "Kit `" (symbol->string kit) "' doesn't contain drum `" n - "'\nSee ly/drumpitch-init.ly for supported drums.")) - (cdar (get-drum-kit kit)) - )) - ((eq? n (caar pitches)) (cdar pitches) ) - (else (n2p (cdr pitches) ) ) - ) - ) - ) - -;; -;; converts a midi-pitched (ly/drumpitch.ly) file to paper output. -;; -(define-public ((drums->paper kit) music) - (begin - (if (equal? (ly:get-mus-property music 'name) 'EventChord) - (set! music (make-drum-head kit music)) - (let* ((es (ly:get-mus-property music 'elements)) - (e (ly:get-mus-property music 'element)) - (p (ly:get-mus-property music 'pitch)) - (body (ly:get-mus-property music 'body)) - (alts (ly:get-mus-property music 'alternatives))) - - (if (pair? es) - (ly:set-mus-property! music 'elements (map (drums->paper kit) es) ) - ) - - (if (ly:music? alts) - (ly:set-mus-property! - music 'alternatives - ((drums->paper kit) alts))) - - (if (ly:music? body) - (ly:set-mus-property! - music 'body - ((drums->paper kit) body))) - - (if (ly:music? e) - (begin - (ly:set-mus-property! - music 'element - ((drums->paper kit) e)) - )))) - music - )) - - diff --git a/scm/lily.scm b/scm/lily.scm index 65e40d0c2b..882445dae3 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -163,6 +163,25 @@ )) +(define-public (hash-table->alist t) + "Convert table t to list" + (apply append + (vector->list t) + )) + +;; todo: code dup with C++. +(define-public (alist->hash-table l) + "Convert alist to table" + (let + ((m (make-hash-table (length l)))) + + (map (lambda (k-v) + (hashq-set! m (car k-v) (cdr k-v))) + l) + + m)) + + ;;;;;;;;;;;;;;;; ; list @@ -383,7 +402,6 @@ L1 is copied, L2 not. "define-translator-properties.scm" "translation-functions.scm" "script.scm" - "drums.scm" "midi.scm" "beam.scm" diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index c2908d0698..596798627b 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -1762,6 +1762,7 @@ def conv (str): conversions.append (((2,1,17), conv, """\\partcombine syntax change to \\newpartcombine""")) + def conv (str): str = re.sub (r'\\newpartcombine', r'\\partcombine', str) str = re.sub (r'\\autochange\s+Staff', r'\\autochange ', str) @@ -1771,6 +1772,23 @@ conversions.append (((2,1,18), conv, """\\newpartcombine -> \\partcombine, \\autochange Staff -> \\autochange """)) + + +def conv (str): + str = re.sub (r'\\include "drumpitch-init.ly','', str) + str = re.sub (r'\\pitchnames ','pitchnames = ', str) + str = re.sub (r'\\chordmodifiers ','chordmodifiers = ', str) + + if re.search ('drums->paper', str): + sys.stderr.write ("\nDrum notation found. Check file manually!") + + str = re.sub (r"""\\apply\s+#\(drums->paper\s+'([a-z]+)\)""", + r"""\property DrumStaff.drumStyleTable = #\1-style""", + str) + return str + +conversions.append (((2,1,19), conv, """Drum notation changes, Removing \chordmodifiers, \notenames .""")) + ################################ # END OF CONVERSIONS ################################ -- 2.39.5