* 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.
+2004-02-05 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * 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 <janneke@gnua.org>
* scripts/filter-lilypond-book.py (find_toplevel_snippets): Do not
2004-02-04 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * 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
@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}
@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
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
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
@}
@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
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=1
-PATCH_LEVEL=18
+PATCH_LEVEL=19
MY_PATCH_LEVEL=
-% 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 }
}
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"));
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 ())
/* 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 */ "");
" 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 */ "");
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;
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 */ "");
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 */ "");
--- /dev/null
+/*
+ drum-note-engraver.cc
+
+ (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+#include <ctype.h>
+
+#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<Item> notes_;
+ Link_array<Item> dots_;
+ Link_array<Item> scripts_;
+ Link_array<Music> 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 */ "");
+
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"))
{
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 */ "");
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); }
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_;
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 ();
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 */
%%
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);
}
void
My_lily_lexer::pop_state ()
{
+ if (YYSTATE == notes)
+ pitchname_tab_stack_ = gh_cdr (pitchname_tab_stack_);
yy_pop_state ();
}
{
// 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) {
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 ());
{
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;
}
}
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 */ "");
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;
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 */ "");
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;
+}
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");
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)),
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 */ "");
{"bar", BAR},
{"breathe", BREATHE},
{"change", CHANGE},
- {"chordmodifiers", CHORDMODIFIERS},
{"chords", CHORDS},
{"clef", CLEF},
{"consists", CONSISTS},
{"context", CONTEXT},
{"default", DEFAULT},
{"denies", DENIES},
+ {"drums", DRUMS},
{"description", DESCRIPTION},
{"figures",FIGURES},
{"grace", GRACE},
{"paper", PAPER},
{"partcombine", PARTCOMBINE},
{"partial", PARTIAL},
- {"pitchnames", PITCHNAMES},
{"property", PROPERTY},
{"relative", RELATIVE},
{"remove", REMOVE},
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;
}
}
-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,
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 ;
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:
/*
- head-grav.cc -- part of GNU LilyPond
+ note-heads-engraver.cc -- part of GNU LilyPond
(c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "engraver.hh"
#include "warn.hh"
-/**
- make balls and rests
- */
-
class Note_heads_engraver : public Engraver
{
Link_array<Item> notes_;
-
Link_array<Item> dots_;
Link_array<Music> note_reqs_;
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);
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 */ "");
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 ();
}
%token PAPER
%token PARTCOMBINE
%token PARTIAL
-%token PITCHNAMES
%token PROPERTY
%token RELATIVE
%token REMOVE
%token <scm> DURATION_IDENTIFIER
%token <scm> FRACTION
%token <id> IDENTIFIER
-%token <scm> CHORDNAMES
+%token DRUMS
+%token <scm> DRUM_PITCH
%token <scm> CHORD_MODIFIER
%token <scm> SCORE_IDENTIFIER
%token <scm> MUSIC_OUTPUT_DEF_IDENTIFIER
%type <scm> translator_spec_block translator_spec_body
%type <music> tempo_event
-%type <scm> notenames_body notenames_block chordmodifiers_block
%type <scm> script_abbreviation
;
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 {
;
-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:
{
}
}
| 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 ();
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");
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 ();
return scm_makfrom0str (s);
}
+
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.
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 ++)
{
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 */ "");
#include "engraver.hh"
#include "note-column.hh"
#include "translator-group.hh"
+#include "warn.hh"
struct Script_tuple
{
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);
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());
}
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.
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;
}
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 */ "");
% 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))
(siss . ,(ly:make-pitch -1 6 DOUBLE-SHARP))
)
+pitchnames = \pitchnamesCatalan
-
-\version "1.9.8"
+\version "2.1.19"
-\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"))
#(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"
% 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))
)
+pitchnames = \pitchnamesDeutsch
-
-\version "1.9.8"
+\version "2.1.19"
-\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"
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))
(bx . ,(ly:make-pitch -1 6 DOUBLE-SHARP))
)
-\version "1.9.8"
+pitchnames = pitchnamesEnglish
+
+\version "2.1.19"
\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 {
\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.
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
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 {
% 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))
(siss . ,(ly:make-pitch -1 6 DOUBLE-SHARP))
)
+pitchnames = \pitchnamesEspanol
-
-\version "1.9.8"
+\version "2.1.19"
#(define-public point-and-click #f)
#(define-public midi-debug #f)
-#(reset-drum-kit)
\version "1.9.8"
% contributed by Paolo Zuliani <<zuliap@easynet.it>>
% additions for semi-sharps and semi-flats by Eric Wurbel <<wurbel@univ-tln.fr>>
-\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))
)
-\version "2.1.0"
+pitchnames = \pitchnamesItaliano
+
+\version "2.1.19"
-\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))
)
+pitchnames = \dutchPitchnames
%}
-\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))
)
+pitchnames =\pitchnamesNorsk
-\version "1.9.8"
+\version "2.1.19"
% 2001/08/28 Heikki Junes <<heikki.junes@hut.fi>>
% 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))
(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"
%
% 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))
(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"
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;
(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.")
(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},
(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.
")
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))
+++ /dev/null
-;;;; drum-"hack". See input/regression/drums.ly and ly/drumpitch-init.ly
-;;;; 2001/03/25 Rune Zedeler <rune@zedeler.dk>
-
-;;;; 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
- ))
-
-
))
+(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
"define-translator-properties.scm"
"translation-functions.scm"
"script.scm"
- "drums.scm"
"midi.scm"
"beam.scm"
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)
\\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
################################