---- ../lilypond-1.3.42/CHANGES Mon Apr 03 03:19:38 2000
+--- ../lilypond-1.3.42.jcn2/CHANGES Wed Apr 5 11:58:51 2000
+++ b/CHANGES Sun Apr 9 21:59:31 2000
+@@ -1,3 +1,8 @@
+1.3.42.jcn3
+===========
+
+* Made a quick try at piano pedal performer, damper pedal only.
+
+ 1.3.42.jcn2
+ ===========
+ --- ../lilypond-1.3.42/CHANGES Mon Apr 03 03:19:38 2000
++ b/CHANGES Sun Apr 09 10:06:47 2000
@@ -1,4 +1,8 @@
1.3.42.jbr1
MAJOR_VERSION=1
MINOR_VERSION=3
PATCH_LEVEL=42
-MY_PATCH_LEVEL=jbr1
+MY_PATCH_LEVEL=jcn3
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
Audio_note* tied_;
};
+class Audio_piano_pedal : public Audio_item
+{
+public:
+ bool type_b_;
+};
+
class Audio_text : public Audio_item
{
public:
#include "lily-proto.hh"
#include "proto.hh"
#include "moment.hh"
+#include "audio-item.hh"
/**
Any piece of midi information.
Audio_dynamic* audio_l_;
};
+class Midi_piano_pedal : public Midi_item
+{
+public:
+ Midi_piano_pedal (Audio_piano_pedal*);
+
+ virtual String str () const;
+
+ Audio_piano_pedal* audio_l_;
+};
+
class Midi_tempo : public Midi_item
{
public:
return new Midi_note (i);
else if (Audio_dynamic* i = dynamic_cast<Audio_dynamic*> (a))
return new Midi_dynamic (i);
+ else if (Audio_piano_pedal* i = dynamic_cast<Audio_piano_pedal*> (a))
+ return new Midi_piano_pedal (i);
else if (Audio_tempo* i = dynamic_cast<Audio_tempo*> (a))
return new Midi_tempo (i);
else if (Audio_time_signature* i = dynamic_cast<Audio_time_signature*> (a))
return str;
}
+Midi_piano_pedal::Midi_piano_pedal (Audio_piano_pedal* a)
+{
+ audio_l_ = a;
+}
+
+String
+Midi_piano_pedal::str () const
+{
+ Byte status_byte = (char) (0xB0 + channel_i_);
+ String str = to_str ((char)status_byte);
+
+ str += to_str ((char)0x40);
+ int pedal = audio_l_->type_b_ ? 0x7f : 0;
+ str += to_str ((char)pedal);
+ return str;
+}
+
Midi_tempo::Midi_tempo (Audio_tempo* a)
{
audio_l_ = a;
--- /dev/null
+/*
+ piano-pedal-performer.cc -- implement Piano_pedal_performer
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
+#include "performer.hh"
+#include "command-request.hh"
+#include "musical-request.hh"
+#include "audio-item.hh"
+
+
+/*
+ TODO:
+ sostenuto
+ una-chorda ?
+ */
+
+/**
+ perform Piano pedals
+ */
+class Piano_pedal_performer : public Performer
+{
+public:
+ VIRTUAL_COPY_CONS (Translator);
+
+ Piano_pedal_performer ();
+
+protected:
+ virtual bool do_try_music (Music*);
+ virtual void do_process_music ();
+ virtual void do_pre_move_processing ();
+ virtual void do_post_move_processing ();
+
+private:
+ Link_array<Audio_piano_pedal> audio_p_arr_;
+ Span_req* span_start_req_l_;
+ Drul_array<Span_req*> span_req_l_drul_;
+};
+
+ADD_THIS_TRANSLATOR (Piano_pedal_performer);
+
+Piano_pedal_performer::Piano_pedal_performer ()
+{
+ span_req_l_drul_[START] = 0;
+ span_req_l_drul_[STOP] = 0;
+ span_start_req_l_ = 0;
+}
+
+void
+Piano_pedal_performer::do_process_music ()
+{
+ if (span_req_l_drul_[STOP])
+ {
+ if (!span_start_req_l_)
+ {
+ span_req_l_drul_[STOP]->warning (_ ("can't find start of piano_pedal"));
+ }
+ else
+ {
+ Audio_piano_pedal* p = new Audio_piano_pedal;
+ p->type_b_ = false;
+ audio_p_arr_.push (p);
+ }
+ span_start_req_l_ = 0;
+ }
+
+ if (span_req_l_drul_[START])
+ {
+ span_start_req_l_ = span_req_l_drul_[START];
+ Audio_piano_pedal* p = new Audio_piano_pedal;
+ p->type_b_ = true;
+ audio_p_arr_.push (p);
+ }
+}
+
+void
+Piano_pedal_performer::do_pre_move_processing ()
+{
+ for (int i=0; i < audio_p_arr_.size (); i++)
+ play_element (audio_p_arr_[i]);
+ audio_p_arr_.clear ();
+}
+
+void
+Piano_pedal_performer::do_post_move_processing ()
+{
+ span_req_l_drul_[STOP] = 0;
+ span_req_l_drul_[START] = 0;
+}
+
+bool
+Piano_pedal_performer::do_try_music (Music* r)
+{
+ if (Span_req * s = dynamic_cast<Span_req*>(r))
+ {
+ if (s-> span_type_str_ == "sustain")
+ {
+ span_req_l_drul_[s->span_dir_] = s;
+ return true;
+ }
+ }
+ return false;
+}
% All notes fall to Grace if you leave Thread out (huh?)
\consists "Dynamic_performer";
\consists "Span_dynamic_performer";
+ \consists "Piano_pedal_performer";
\consists "Grace_position_performer";
\accepts Thread;
\accepts Grace;
cresc = \spanrequest \start "crescendo"
endcresc = \spanrequest \stop "crescendo"
+sustaindown = \spanrequest \start "sustain"
+sustainup = \spanrequest \stop "sustain"
+
%crescpoco = \property Voice.crescendoText = "cresc. poco a poco"
%decresc = \property Voice.crescendoText = "decr."
%dim = \property Voice.crescendoText = "dim."