From: Han-Wen Nienhuys Date: Sat, 20 Aug 2005 23:20:19 +0000 (+0000) Subject: * lily/drum-note-performer.cc (class Drum_note_performer): use X-Git-Tag: release/2.7.7~26 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=978fa09436484d8d670e8ee8b3eb8cfacd493675;p=lilypond.git * lily/drum-note-performer.cc (class Drum_note_performer): use process_music everywhere. * ly/performer-init.ly: add default children everywhere. * lily/paper-book.cc (output): call paper-book-write-midis directly: always write MIDI, even if no \layout {} block. --- diff --git a/ChangeLog b/ChangeLog index 9edd03c2a2..926c894c08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-08-21 Han-Wen Nienhuys + + * lily/drum-note-performer.cc (class Drum_note_performer): use + process_music everywhere. + + * ly/performer-init.ly: add default children everywhere. + + * lily/paper-book.cc (output): call paper-book-write-midis + directly: always write MIDI, even if no \layout {} block. + 2005-08-19 Han-Wen Nienhuys * VERSION (PACKAGE_NAME): release 2.7.6 diff --git a/VERSION b/VERSION index 4e55ed9c8a..116c3fc741 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=7 -PATCH_LEVEL=6 +PATCH_LEVEL=7 MY_PATCH_LEVEL= diff --git a/lily/drum-note-performer.cc b/lily/drum-note-performer.cc index 28bc190410..33ea18e1ee 100644 --- a/lily/drum-note-performer.cc +++ b/lily/drum-note-performer.cc @@ -22,7 +22,7 @@ public: protected: virtual bool try_music (Music *ev); void stop_translation_timestep (); - virtual void create_audio_elements (); + void process_music (); private: Link_array note_evs_; @@ -34,10 +34,9 @@ Drum_note_performer::Drum_note_performer () } void -Drum_note_performer::create_audio_elements () +Drum_note_performer::process_music () { - SCM tab = 0; - if (!tab) tab = get_property ("drumPitchTable"); + SCM tab = get_property ("drumPitchTable"); while (note_evs_.size ()) { diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc index c1d28c52f1..7320ef7e24 100644 --- a/lily/dynamic-performer.cc +++ b/lily/dynamic-performer.cc @@ -26,7 +26,7 @@ public: protected: virtual bool try_music (Music *event); void stop_translation_timestep (); - virtual void create_audio_elements (); + void process_music (); private: Music *script_event_; @@ -40,7 +40,7 @@ Dynamic_performer::Dynamic_performer () } void -Dynamic_performer::create_audio_elements () +Dynamic_performer::process_music () { if (script_event_) { diff --git a/lily/font-size-engraver.cc b/lily/font-size-engraver.cc index d57f9219a5..d8935ff559 100644 --- a/lily/font-size-engraver.cc +++ b/lily/font-size-engraver.cc @@ -15,7 +15,7 @@ class Font_size_engraver : public Engraver TRANSLATOR_DECLARATIONS (Font_size_engraver); protected: DECLARE_ACKNOWLEDGER (font); - virtual void process_music (); + void process_music (); Real size; private: }; diff --git a/lily/key-performer.cc b/lily/key-performer.cc index 50fd46b171..1b411a90e2 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -19,7 +19,7 @@ public: protected: virtual bool try_music (Music *ev); - virtual void create_audio_elements (); + void process_music (); void stop_translation_timestep (); private: @@ -38,7 +38,7 @@ Key_performer::~Key_performer () } void -Key_performer::create_audio_elements () +Key_performer::process_music () { if (key_ev_) { diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index dd083391f0..47b3e38f6c 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -18,7 +18,7 @@ protected: virtual bool try_music (Music *event); void stop_translation_timestep (); - virtual void create_audio_elements (); + void process_music (); private: Link_array events_; @@ -31,7 +31,7 @@ Lyric_performer::Lyric_performer () } void -Lyric_performer::create_audio_elements () +Lyric_performer::process_music () { // FIXME: won't work with fancy lyrics if (events_.size () diff --git a/lily/note-performer.cc b/lily/note-performer.cc index a8326dab36..7cbaf1133d 100644 --- a/lily/note-performer.cc +++ b/lily/note-performer.cc @@ -25,7 +25,7 @@ protected: virtual bool try_music (Music *ev); void stop_translation_timestep (); - virtual void create_audio_elements (); + void process_music (); private: Link_array note_evs_; @@ -33,7 +33,7 @@ private: }; void -Note_performer::create_audio_elements () +Note_performer::process_music () { if (note_evs_.size ()) { @@ -89,7 +89,8 @@ Note_performer::try_music (Music *ev) #include "translator.icc" ADD_TRANSLATOR (Note_performer, "", "", - "note-event busy-playing-event", + "note-event " + "busy-playing-event", "", ""); Note_performer::Note_performer () diff --git a/lily/paper-book.cc b/lily/paper-book.cc index fa40e5ef58..77ac4fff8a 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -90,6 +90,13 @@ Paper_book::add_performance (SCM s) void Paper_book::output (SCM output_channel) { + if (scm_is_pair (performances_)) + { + SCM proc = ly_lily_module_constant ("paper-book-write-midis"); + + scm_call_2 (proc, self_scm (), output_channel); + } + if (scores_ == SCM_EOL) return; diff --git a/lily/performance-scheme.cc b/lily/performance-scheme.cc index 2894b0435e..6a2284587e 100644 --- a/lily/performance-scheme.cc +++ b/lily/performance-scheme.cc @@ -11,7 +11,6 @@ LY_DEFINE (ly_performance_write, "ly:performance-write", 2, 0, 0, (SCM performance, SCM filename), "Write @var{performance} to @var{filename}") - { Performance *perf = dynamic_cast (unsmob_music_output (performance)); diff --git a/lily/piano-pedal-performer.cc b/lily/piano-pedal-performer.cc index 1feec98359..ea4889f11b 100644 --- a/lily/piano-pedal-performer.cc +++ b/lily/piano-pedal-performer.cc @@ -29,7 +29,7 @@ public: protected: virtual void initialize (); virtual bool try_music (Music *); - virtual void create_audio_elements (); + void process_music (); void stop_translation_timestep (); void start_translation_timestep (); @@ -69,7 +69,7 @@ Piano_pedal_performer::initialize () } void -Piano_pedal_performer::create_audio_elements () +Piano_pedal_performer::process_music () { for (Pedal_info *p = info_alist_; p && p->name_; p++) diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index 21af00155a..0a8b5a5451 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -29,7 +29,7 @@ protected: virtual void acknowledge_audio_element (Audio_element *p); virtual void finalize (); virtual void initialize (); - virtual void create_audio_elements (); + void process_music (); void stop_translation_timestep (); private: @@ -73,7 +73,7 @@ Staff_performer::initialize () } void -Staff_performer::create_audio_elements () +Staff_performer::process_music () { String str = new_instrument_string (); if (str.length ()) diff --git a/lily/tempo-performer.cc b/lily/tempo-performer.cc index 43af310b30..55cc6f877d 100644 --- a/lily/tempo-performer.cc +++ b/lily/tempo-performer.cc @@ -22,7 +22,7 @@ protected: virtual bool try_music (Music *event); void stop_translation_timestep (); - virtual void create_audio_elements (); + void process_music (); private: Music *tempo_event_; @@ -40,7 +40,7 @@ Tempo_performer::~Tempo_performer () } void -Tempo_performer::create_audio_elements () +Tempo_performer::process_music () { if (tempo_event_) { diff --git a/lily/time-signature-performer.cc b/lily/time-signature-performer.cc index 57275f7299..321f744c51 100644 --- a/lily/time-signature-performer.cc +++ b/lily/time-signature-performer.cc @@ -19,7 +19,7 @@ public: protected: void stop_translation_timestep (); - virtual void create_audio_elements (); + void process_music (); virtual void derived_mark () const; SCM prev_fraction_; private: @@ -44,7 +44,7 @@ Time_signature_performer::~Time_signature_performer () } void -Time_signature_performer::create_audio_elements () +Time_signature_performer::process_music () { SCM fr = get_property ("timeSignatureFraction"); if (scm_is_pair (fr) && !ly_is_equal (fr, prev_fraction_)) diff --git a/ly/performer-init.ly b/ly/performer-init.ly index 7d58354344..8c18188de3 100644 --- a/ly/performer-init.ly +++ b/ly/performer-init.ly @@ -1,12 +1,13 @@ \version "2.7.6" - % - % setup for Request->Element conversion. Guru-only - % +%% +%% setup for Request->Element conversion. +%% \context { \type "Performer_group" \name Staff \accepts Voice + \defaultchild Voice \consists "Staff_performer" \consists "Key_performer" @@ -18,11 +19,13 @@ \accepts Score \description "Hard coded entry point for LilyPond. Cannot be tuned." } + \context { \Staff \name DrumStaff midiInstrument = #"drums" \accepts DrumVoice + \defaultchild DrumVoice } \context { @@ -63,6 +66,7 @@ \name GrandStaff \accepts RhythmicStaff \accepts Staff + \defaultchild Staff } \context { @@ -70,6 +74,7 @@ \name "PianoStaff" \accepts Staff \accepts DrumStaff + \defaultchild Staff } \context { @@ -87,6 +92,7 @@ \type "Performer_group" \name "TabStaff" \accepts "TabVoice" + \defaultchild "TabVoice" } \context { @@ -112,6 +118,8 @@ \consists "Timing_translator" \consists "Swallow_performer" + + \defaultchild "Staff" dynamicAbsoluteVolumeFunction = #default-dynamic-absolute-volume instrumentEqualizer = #default-instrument-equalizer @@ -133,9 +141,12 @@ \name ChoirStaff \accepts Staff \accepts DrumStaff + \defaultchild Staff + } + \context { \type "Performer_group" \consists "Staff_performer" @@ -155,6 +166,8 @@ \name StaffGroup \accepts Staff \accepts DrumStaff + + \defaultchild Staff } \context { \Staff \name RhythmicStaff } diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 67ceda359e..30cf033e61 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -425,8 +425,6 @@ (page-count (length pages)) (port (ly:outputter-port outputter))) - (paper-book-write-midis book basename) - (output-scopes scopes fields basename) (display (page-header paper page-count #t) port) (write-preamble paper #t port) diff --git a/scm/lily-library.scm b/scm/lily-library.scm index ceb2e7d69a..f450731052 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -92,7 +92,6 @@ (set! base (format #f "~a-~a" base count))) (ly:parser-define! parser 'output-count (1+ count)) - (ly:book-process book paper layout base) )) diff --git a/scm/midi.scm b/scm/midi.scm index 9aad4bd1ba..396a4a9645 100644 --- a/scm/midi.scm +++ b/scm/midi.scm @@ -286,9 +286,10 @@ returns the program of the instrument (define-public (paper-book-write-midis paper-book basename) (let loop - ((perfs (ly:paper-book-performances paper-book)) - (count 0)) - + ((perfs (ly:paper-book-performances paper-book)) + (count 0)) + + (if (pair? perfs) (begin (ly:performance-write