]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.30.jcn2
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 8 Mar 2000 14:35:43 +0000 (15:35 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 8 Mar 2000 14:35:43 +0000 (15:35 +0100)
1.3.30.jcn2
===========

* Dynamic_performer: performs absolute dynamic requests.

* David's comments on opus47

---
Generated by janneke@gnu.org,
From = lilypond-1.3.30.jcn1, To = lilypond-1.3.30.jcn2

usage

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.3.30.jcn2.diff

Patches do not contain automatically generated files
or (urg) empty directories,
i.e., you should rerun autoconf, configure

15 files changed:
CHANGES
TODO
VERSION
input/test/absolute-volume.ly [new file with mode: 0644]
lily/audio-item.cc
lily/dynamic-engraver.cc
lily/dynamic-performer.cc [new file with mode: 0644]
lily/include/audio-item.hh
lily/include/lily-proto.hh
lily/include/midi-item.hh
lily/include/slur.hh
lily/midi-item.cc
ly/midi.ly
ly/performer.ly
scm/midi.scm [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index 3bba7a6711f67ba361825043467c3cb91d218841..e36d3f8b0706046155bf5fa3ca66157dacbb6a27 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,16 @@
---- ../lilypond-1.3.30/CHANGES Mon Mar  6 12:10:00 2000
+--- ../lilypond-1.3.30.jcn1/CHANGES    Tue Mar  7 23:59:44 2000
+++ b/CHANGES   Wed Mar  8 15:35:43 2000
+@@ -1,3 +1,10 @@
+1.3.30.jcn2
+===========
+
+* Dynamic_performer: performs absolute dynamic requests.
+
+* David's comments on opus47
+
+ 1.3.30.jcn1
+ ===========
+ --- ../lilypond-1.3.30/CHANGES        Mon Mar  6 12:10:00 2000
 ++ b/CHANGES   Tue Mar  7 23:59:44 2000
 @@ -1,3 +1,9 @@
 1.3.30.jcn1
diff --git a/TODO b/TODO
index 1ef055e1299bdba752715e3f6945e6de78069b1e..94b4f38ce557d357b2bd3f23103e1470a8606f73 100644 (file)
--- a/TODO
+++ b/TODO
@@ -16,6 +16,25 @@ Grep -i for TODO, FIXME and ugh/ugr/urg.
 . * hard constraints for  broken slurs to.
 . * Staff_margin_engraver placement is broken for Staff.instr(ument)
 . * Bracket/brace placement and stacking is broken
+. * Lattermann:
+
+ 2. There dynamic markings of the cello part are set in roman (maybe
+    because of pizz. and arco in roman?)
+
+ 4. Bar 41/42, violins: the ties should be the same direction, pref.
+    down in bar 42.
+    -- dir of broken ties
+
+ 7. This is a bug: there's a colon in the middle of the two harmonium
+    staves
+
+ 12. bars 82 to 84 and 88: the ties of upper harmonium should all bend down.
+     -- stemdown ~ stemup and at linebreak
+
+ 15. bar 89, harmonium, the ties coming from the previous line look strangely
+     asymmetric.
+
+
 . * Mondrup:
 
 - In some cases I don't get the large textsize within note examples I request.
diff --git a/VERSION b/VERSION
index 12548aeb77719c989496d3b45f26a4f02441273c..f1b86883ae645d36582f16c47a8777103ce26b27 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=30
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=jcn2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/test/absolute-volume.ly b/input/test/absolute-volume.ly
new file mode 100644 (file)
index 0000000..b372e47
--- /dev/null
@@ -0,0 +1,19 @@
+\score{
+\notes\relative c''{
+%segfault in engraver
+a1\ppp 
+a1\pp
+a\p
+a\mp
+a\mf
+a\f
+a\ff
+a\fff
+a\sf
+}
+\paper{
+}
+\midi{
+\tempo 1 = 60;
+}
+}
index 089469ba051eba78175d88ef84be2e8dd7315e61..410222f0e5520552cfca1f9f152118697b69fd7e 100644 (file)
@@ -45,6 +45,11 @@ Audio_key::Audio_key (Key_def const& k)
   key_ = k;
 }
 
+Audio_dynamic::Audio_dynamic (int volume)
+{
+  volume_i_ = volume;
+}
+
 Audio_tempo::Audio_tempo (int per_minute_4_i)
 {
   per_minute_4_i_ = per_minute_4_i;
index 977053e621b825b3f3a05393e9feef630518ee4e..88de9812a2142b2cc4184b260eaa608fe3b54a3f 100644 (file)
 #include "note-head.hh"
 #include "group-interface.hh"
 
+/*
+  TODO:
+    multiple type of span dynamic:
+    * hairpin
+    * text:
+      - `cresc. --  --  --'
+      - `cresc. poco a poco -- -- --'
+ */
+
 /**
    print text & hairpin dynamics.
  */
diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc
new file mode 100644 (file)
index 0000000..b7472ea
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+  dynamic-performer.cc -- implement Dynamic_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:
+    handle multiple requests
+    handle span requests (crescendo/decrescendo)
+ */
+
+/**
+   perform absolute (text) dynamics
+ */
+class Dynamic_performer : public Performer
+{
+public:
+  VIRTUAL_COPY_CONS (Translator);
+  
+  Dynamic_performer ();
+  ~Dynamic_performer ();
+
+protected:
+  void do_print () const;
+  virtual bool do_try_music (Music* req_l);
+  virtual void do_process_requests ();
+  virtual void do_pre_move_processing ();
+
+private:
+  Text_script_req* text_script_req_l_;
+  Audio_dynamic* audio_p_;
+};
+
+ADD_THIS_TRANSLATOR (Dynamic_performer);
+
+Dynamic_performer::Dynamic_performer ()
+{
+  text_script_req_l_ = 0;
+  audio_p_ = 0;
+}
+
+Dynamic_performer::~Dynamic_performer ()
+{
+}
+
+void
+Dynamic_performer::do_print () const
+{
+#ifndef NPRINT
+  if (text_script_req_l_)
+    text_script_req_l_->print ();
+#endif
+}
+
+void
+Dynamic_performer::do_process_requests ()
+{
+  if (text_script_req_l_)
+    {
+      
+      SCM s = scm_eval
+       (gh_list
+        (ly_symbol2scm ("dynamic-absolute-volume"),
+         ly_quote_scm (ly_str02scm (text_script_req_l_->text_str_.ch_C ())),
+         SCM_UNDEFINED));
+      int volume = gh_scm2int (ly_eval_str ("dynamic-default-volume"));
+      if (gh_number_p (s))
+       volume = gh_scm2int (s);
+
+      audio_p_ = new Audio_dynamic (volume);
+      Audio_element_info info (audio_p_, text_script_req_l_);
+      announce_element (info);
+      text_script_req_l_ = 0;
+    }
+}
+
+void
+Dynamic_performer::do_pre_move_processing ()
+{
+  if (audio_p_)
+    {
+      play_element (audio_p_);
+      audio_p_ = 0;
+    }
+}
+
+bool
+Dynamic_performer::do_try_music (Music* r)
+{
+  if (!text_script_req_l_)
+    {
+      // urg, text script, style `dynamic' is how absolute dynamics appear
+      if(Text_script_req* t = dynamic_cast <Text_script_req*> (r))
+       {
+         if (t->style_str_ == "dynamic")
+           {
+             text_script_req_l_ = t;
+             return true;
+           }
+       }
+    }
+  return false;
+}
+
index 08c780fecfccef6ad15c8e3d782664ca43646aac..8edd0ef388ca9692a0b67c17543c3a311548e3d4 100644 (file)
@@ -37,6 +37,14 @@ private:
   Audio_item& operator=( Audio_item const&);
 };
 
+class Audio_dynamic : public Audio_item
+{
+public:
+  Audio_dynamic (int volume);
+
+  int volume_i_;
+};
+
 class Audio_key : public Audio_item
 {
 public:
index af8c468994ea0e53f9a7d2cdfe3d5ac72de960bd..3a6f324771d150932065f7c1777c1edc5a15d9be 100644 (file)
@@ -19,6 +19,7 @@ struct Align_element;
 struct All_font_metrics;
 struct Articulation_req;
 struct Audio_column;
+struct Audio_dynamic;
 struct Audio_element;
 struct Audio_element_info;
 struct Audio_instrument;
@@ -80,6 +81,7 @@ struct Command_script_req;
 struct Command_tie_engraver;
 struct Crescendo ;
 struct Dimension_cache;
+struct Dynamic_performer;
 struct Spanner;
 struct Dot_column;
 struct Dots;
@@ -128,6 +130,7 @@ struct Measure_grouping_req;
 struct Melodic_req;
 struct Midi_def;
 struct Midi_duration;
+struct Midi_dynamic;
 struct Midi_header;
 struct Midi_item;
 struct Midi_key;
@@ -216,6 +219,7 @@ struct Simultaneous_music;
 struct Single_malt_grouping_item;
 struct Skip_req;
 struct Slur;
+struct Slur_bezier_bow;
 struct Slur_engraver;
 struct Spacing_spanner;
 struct Span_bar;
index b10ad8c5f96b931994e7161dc6c823e141349eeb..c9823dbcf2b50b1a78b1280fc9733e1ebcae8762 100644 (file)
@@ -160,6 +160,16 @@ public:
   Audio_text* audio_l_;
 };
 
+class Midi_dynamic : public Midi_item
+{
+public:
+  Midi_dynamic (Audio_dynamic*);
+  
+  virtual String str () const;
+
+  Audio_dynamic* audio_l_;
+};
+
 class Midi_tempo : public Midi_item
 {
 public:
index 4f14512047e2d7bc7172ec1ca1b91c47ebc0cb71..93844719ccc2717f246902c960218ce350d5ce2b 100644 (file)
@@ -35,7 +35,7 @@ protected:
   Array<Rod> get_rods () const;
 
 private:  
-  void de_uglyfy (class Slur_bezier_bow* bb, Real default_height);
+  void de_uglyfy (Slur_bezier_bow* bb, Real default_height);
   void set_extremities ();
   void set_control_points ();
   int cross_staff_count () const;
index aeaa53ffa2a903fd8f6bfc20724c3d8edb920c2d..b822a6655e51eb3fe97f2f242aee6596036945fb 100644 (file)
@@ -27,6 +27,8 @@ Midi_item::midi_p (Audio_item* a)
     return i->str_.length_i () ? new Midi_instrument (i) : 0;
   else if (Audio_note* i = dynamic_cast<Audio_note*> (a))
     return new Midi_note (i);
+  else if (Audio_dynamic* i = dynamic_cast<Audio_dynamic*> (a))
+    return new Midi_dynamic (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))
@@ -458,6 +460,27 @@ Midi_note_off::str () const
   return str;
 }
 
+Midi_dynamic::Midi_dynamic (Audio_dynamic* a)
+{
+  audio_l_ = a;
+}
+
+String
+Midi_dynamic::str () const
+{
+  Byte status_byte = (char) (0xB0 + channel_i_);
+  String str = to_str ((char)status_byte);
+
+  /*
+    Main volume controller (per channel):
+    07 MSB
+    27 LSB
+   */
+  str += to_str ((char)0x07);
+  str += to_str ((char)audio_l_->volume_i_);
+  return str;
+}
+
 Midi_tempo::Midi_tempo (Audio_tempo* a)
 {
   audio_l_ = a;
index d47242bf580d3002d741322a90d62b1c6eacc36d..b41614cc2bf96cfb31db9a2923ab6d3e79acbfa3 100644 (file)
@@ -1,4 +1,6 @@
 
+#(eval-string (ly-gulp-file "midi.scm"))
+
 \midi {
         \tempo 4=60;
        \include "performer.ly"
index 44e3272c53d8605c7a6a59af76b1e20bef150eb5..21ec1095f2f6efac7d1ad6389dc80bce2435d771 100644 (file)
@@ -14,6 +14,7 @@ StaffContext = \translator {
        \consists "Key_performer";
        \consists "Time_signature_performer";
        \consists "Tempo_performer";
+       dynamicStyle = #"dynamic"
 };
 \translator { \StaffContext }
 
@@ -41,6 +42,7 @@ VoiceContext = \translator {
        \type "Performer_group_performer";
        \name Voice;
 % All notes fall to Grace if you leave Thread out (huh?)
+       \consists "Dynamic_performer";   % must come before text_engraver.
        \consists "Grace_position_performer";
        \accepts Thread;
        \accepts Grace;
diff --git a/scm/midi.scm b/scm/midi.scm
new file mode 100644 (file)
index 0000000..0e42d83
--- /dev/null
@@ -0,0 +1,31 @@
+;;; midi.scm -- scm midi variables and functions
+;;;
+;;;  source file of the GNU LilyPond music typesetter
+;;; 
+;;; (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
+
+
+(define absolute-volume-alist '())
+(set! absolute-volume-alist
+      (append 
+      '(
+       ("sf" . 115)
+       ("fff" . 102)
+       ("ff" . 90)
+       ("f" . 77)
+       ("mf" . 64)
+       ("mp" . 51)
+       ("p" . 38)
+       ("pp" . 26)
+       ("ppp" . 13)
+       )
+      absolute-volume-alist))
+
+(define (dynamic-absolute-volume s)
+  (let ((entry (assoc s absolute-volume-alist)))
+    (if entry
+       (cdr entry))))
+
+;; 90 is supposed to be the default value
+;; urg: we should set this at start of track
+(define dynamic-default-volume 90)