You may only see the first example in this document; please download
-this snippet and run it from your own computer.
+this snippet and run it from your own computer.
"
doctitle = "Engravers one-by-one"
\key d \major
\clef bass
g8-. r
- r4
+ r4
fis8-.
r8
r4
\description "Handles clefs, bar lines, keys, accidentals. It can contain
@code{Voice} contexts."
-
- \consists "Output_property_engraver"
-
+
+ \consists "Output_property_engraver"
+
\consists "Font_size_engraver"
\consists "Volta_engraver"
- \consists "Separating_line_group_engraver"
+ \consists "Separating_line_group_engraver"
\consists "Dot_column_engraver"
\consists "Ottava_spanner_engraver"
\override VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 6)
extraVerticalExtent = ##f
- verticalExtent = ##f
+ verticalExtent = ##f
localKeySignature = #'()
- % explicitly set instrument, so we don't get
+ % explicitly set instrument, so we don't get
% weird effects when doing instrument names for
% piano staves
instrumentName = #'()
shortInstrumentName = #'()
-
+
\accepts "Voice"
}
localKeySignature = #'()
\consists "Font_size_engraver"
-
+
% must come before all
- \consists "Output_property_engraver"
+ \consists "Output_property_engraver"
\consists "Arpeggio_engraver"
\consists "Multi_measure_rest_engraver"
\consists "Text_spanner_engraver"
\consists "Note_heads_engraver"
\consists "Rest_engraver"
- \consists "Skip_event_swallow_translator"
}
MyStaff = \context {
\MyStaff
- \consists "Accidental_engraver"
+ \consists "Accidental_engraver"
\consists "Key_engraver"
}
\score {
\name Dynamics
\alias Voice
\consists "Output_property_engraver"
- \consists "Skip_event_swallow_translator"
\consists "Axis_group_engraver"
\consists "Piano_pedal_engraver"
pedalSustainStrings = #'("Ped." "*Ped." "*")
#`(Staff ,(make-accidental-rule 'same-octave 0)
,(make-accidental-rule 'any-octave 0)
,(make-accidental-rule 'same-octave 1))
-
+
\layout {
\context {
\Score
c2.:32\pp\< ~ | c: ~ |
c8\!\ff \offCr r r r4 r8 | R2. |
\time 9/8
- c2.:32\pp ~ c4.: |
+ c2.:32\pp ~ c4.: |
}
harprh = \relative c'' {
\type "Engraver_group"
\consists "Output_property_engraver"
\consists "Bar_engraver"
- \consists "Skip_event_swallow_translator"
\consists "Axis_group_engraver"
\override VerticalAxisGroup #'Y-extent = ##f
class Staff_performer;
class Stencil;
class Stream_event;
-class Swallow_engraver;
-class Swallow_performer;
class System;
class Tempo_performer;
class Tie;
class Translator_change;
class Translator_group;
class Transposed_music;
-class Type_swallow_translator;
class yyFlexLexer;
typedef void (*Engraver_void_function_engraver_grob_info) (Engraver *, Grob_info);
+++ /dev/null
-/*
- This file is part of LilyPond, the GNU music typesetter.
-
- Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- LilyPond is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- LilyPond is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef TYPESWALLOW_TRANSLATOR_HH
-#define TYPESWALLOW_TRANSLATOR_HH
-
-#include "translator.hh"
-
-/** eat a certain type of event
- (Duh, it's good for your skin)
-*/
-class Type_swallow_translator : public Translator
-{
-protected:
- string swallow_string_;
- bool try_music (Music *);
-public:
- VIRTUAL_COPY_CONS (Translator);
-};
-
-#define DECLARE_EVENT_SWALLOWER(TYPE) \
- struct TYPE ## _swallow_translator : public Type_swallow_translator \
- { \
- TRANSLATOR_DECLARATIONS (TYPE ## _swallow_translator); \
- }; \
- TYPE ## _swallow_translator ::TYPE ## _swallow_translator () \
- { \
- swallow_string_ = #TYPE; \
- } \
- ADD_TRANSLATOR (TYPE ## _swallow_translator, \
- "Swallow events of " #TYPE " type.", \
- "", \
- "general-music", \
- "", \
- "", \
- "");
-
-#endif // TYPESWALLOW_TRANSLATOR_HH
-
+++ /dev/null
-/*
- This file is part of LilyPond, the GNU music typesetter.
-
- Copyright (C) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- LilyPond is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- LilyPond is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "engraver.hh"
-
-// Junk String numbers.
-class String_number_engraver : public Engraver
-{
-public:
- TRANSLATOR_DECLARATIONS (String_number_engraver);
-protected:
- virtual bool try_music (Music *m);
-};
-
-bool
-String_number_engraver::try_music (Music *)
-{
- return true;
-}
-
-String_number_engraver::String_number_engraver ()
-{
-}
-
-/*
- TODO: string numbers are printed right of the note circled. This
- engraver should provide this functionality.
-*/
-
-#include "translator.icc"
-
-ADD_TRANSLATOR (String_number_engraver,
- /* doc */
- "Swallow string number events. The purpose of this engraver"
- " is to process tablatures for normal notation. To provent"
- " warnings for unprocessed string number events to obscure"
- " real error messages, this engraver swallows them all.",
-
- /* create */
- "",
-
- /* read */
- "",
-
- /* write */
- ""
- );
+++ /dev/null
-/*
- This file is part of LilyPond, the GNU music typesetter.
-
- Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- LilyPond is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- LilyPond is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "engraver.hh"
-
-class Swallow_engraver : public Engraver
-{
-public:
- TRANSLATOR_DECLARATIONS (Swallow_engraver);
-protected:
- bool try_music (Music *);
-};
-
-bool
-Swallow_engraver::try_music (Music *)
-{
- return true;
-}
-
-Swallow_engraver::Swallow_engraver ()
-{
-}
-
-#include "translator.icc"
-
-ADD_TRANSLATOR (Swallow_engraver,
- /* doc */
- "This engraver swallows everything given to it silently."
- " The purpose of this is to prevent spurious @q{event junked}"
- " warnings.",
-
- /* create */
- "",
-
- /* read */
- "",
-
- /* write */
- ""
- );
+++ /dev/null
-/*
- This file is part of LilyPond, the GNU music typesetter.
-
- Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- LilyPond is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- LilyPond is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "performer.hh"
-#include "music.hh"
-
-class Swallow_performer : public Performer
-{
-public:
- TRANSLATOR_DECLARATIONS (Swallow_performer);
-protected:
- virtual bool try_music (Music *);
-};
-
-bool
-Swallow_performer::try_music (Music *m)
-{
- if (m->is_mus_type ("melisma-playing-event"))
- return false;
- else
- return true;
-}
-
-Swallow_performer::Swallow_performer ()
-{}
-
-#include "translator.icc"
-
-ADD_TRANSLATOR (Swallow_performer,
- /* doc */
- "",
-
- /* create */
- "",
-
- /* read */
- "",
-
- /* write */
- ""
- );
+++ /dev/null
-/*
- This file is part of LilyPond, the GNU music typesetter.
-
- Copyright (C) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- LilyPond is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- LilyPond is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "translator.hh"
-#include "music.hh"
-
-#include "translator.icc"
-
-class Skip_event_swallow_translator : public Translator
-{
-protected:
- virtual bool try_music (Music *) { return true; }
-
-public:
- TRANSLATOR_DECLARATIONS (Skip_event_swallow_translator);
-};
-
-class Rest_swallow_translator : public Translator
-{
-protected:
- virtual bool try_music (Music *) { return true; }
-
-public:
- TRANSLATOR_DECLARATIONS (Rest_swallow_translator);
-};
-
-Skip_event_swallow_translator::Skip_event_swallow_translator ()
-{
-}
-
-ADD_TRANSLATOR (Skip_event_swallow_translator,
- /* doc */
- "Swallow @code{\\skip}.",
-
- /* create */
- "",
-
- /* read */
- "",
-
- /* write */
- ""
- );
-
-Rest_swallow_translator::Rest_swallow_translator (){}
-
-ADD_TRANSLATOR (Rest_swallow_translator,
- /* doc */
- "Swallow rest.",
-
- /* create */
- "",
-
- /* read */
- "",
-
- /* write */
- ""
- );
-
-class Note_swallow_translator : public Translator
-{
-protected:
- virtual bool try_music (Music *) { return true; }
-
-public:
- TRANSLATOR_DECLARATIONS (Note_swallow_translator);
-};
-
-Note_swallow_translator::Note_swallow_translator ()
-{
-}
-
-ADD_TRANSLATOR (Note_swallow_translator,
- /* doc */
- "Swallow notes.",
-
- /* create */
- "",
-
- /* read */
- "",
-
- /* write */
- ""
- );
-
\description "A context for displaying fret diagrams."
\consists "Fretboard_engraver"
- \consists "Rest_swallow_translator"
\consists "Output_property_engraver"
- \consists "Skip_event_swallow_translator"
\consists "Hara_kiri_engraver"
\consists "Separating_line_group_engraver"
\consists "Font_size_engraver"
\consists "Piano_pedal_engraver"
\consists "Piano_pedal_align_engraver"
\consists "Instrument_name_engraver"
- \consists "String_number_engraver"
\consists "Axis_group_engraver"
\consists "Figured_bass_engraver"
\consists "Figured_bass_position_engraver"
\remove "Ottava_spanner_engraver"
\remove "Key_engraver"
\remove "Piano_pedal_engraver"
- \remove "String_number_engraver"
\description "Handles typesetting for percussion."
\consists "Tuplet_engraver"
\consists "Grace_engraver"
\consists "Instrument_switch_engraver"
- \consists "Skip_event_swallow_translator"
}
\context{
\remove "Fingering_engraver"
\remove "Cluster_spanner_engraver"
-
- \consists "Skip_event_swallow_translator"
}
\context{
\consists "Dynamic_align_engraver"
\consists "Text_engraver"
\consists "Text_spanner_engraver"
- \consists "Skip_event_swallow_translator"
\consists "Axis_group_engraver"
pedalSustainStrings = #'("Ped." "*Ped." "*")
\consists "Hyphen_engraver"
\consists "Stanza_number_engraver"
\consists "Instrument_name_engraver"
- \consists "Skip_event_swallow_translator"
\consists "Font_size_engraver"
\consists "Hara_kiri_engraver"
% FIXME: not sure what the default should be here.
\override VerticalAxisGroup #'staff-affinity = #DOWN
-
- \consists "Rest_swallow_translator"
- \consists "Skip_event_swallow_translator"
\consists "Tie_engraver"
\consists "Note_name_engraver"
\consists "Separating_line_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"
\consists "Hara_kiri_engraver"
% \consists "Note_spacing_engraver"
\override VerticalAxisGroup #'remove-first = ##t
\description "A context for printing a figured bass line."
\consists "Figured_bass_engraver"
- \consists "Note_swallow_translator"
- \consists "Skip_event_swallow_translator"
\consists "Separating_line_group_engraver"
\consists "Hara_kiri_engraver"
%% don't want to route anything out of here:
\alias "Staff"
\alias "Voice"
- \consists "Swallow_engraver"
\description "Silently discards all musical information given to this
context."
}
\remove "Accidental_engraver"
\remove "Key_engraver"
- \remove "String_number_engraver"
\remove "Ottava_spanner_engraver"
%% the clef handler
\override Clef #'stencil = #clef::print-modern-tab-if-set
\context {
\type "Performer_group"
\name FiguredBass
- \consists "Swallow_performer"
}
\context {
\context {
\type "Performer_group"
\name "Devnull"
- \consists "Swallow_performer"
}
+
\context {
\Staff
\name TabStaff
\consists "Control_track_performer"
\consists "Tempo_performer"
\consists "Timing_translator"
- \consists "Swallow_performer"
\defaultchild "Staff"
'', str)
return str
+@rule ((2, 13, 10),
+ _ ("Remove obsolete engravers/translators: Note_swallow_translator,\n\
+Rest_swallow_translator, Skip_event_swallow_translator, Swallow_engraver,\n\
+Swallow_performer and String_number_engraver."))
+def conv(str):
+ str = re.sub (r'\\(consists|remove)\s+"*(Swallow_(engraver|performer)|'
+ '(Note|Rest|Skip_event)_swallow_translator|String_number_engraver)"*',
+ '', str)
+ return str
+
# Guidelines to write rules (please keep this at the end of this file)
#
# - keep at most one rule per version; if several conversions should be done,