]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/lily-guile.cc (type_check_assignment): use
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 25 Mar 2004 01:45:15 +0000 (01:45 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 25 Mar 2004 01:45:15 +0000 (01:45 +0000)
ly_scheme_function iso. scm_primitive_eval where possible.

* lily/performance.cc (output): limit channels at 15. This fixes
percussion inadvertently showing up in large scores.

13 files changed:
ChangeLog
Documentation/user/notation.itely
lily/global-context.cc
lily/include/audio-element.hh
lily/include/audio-staff.hh
lily/key-performer.cc
lily/lily-guile.cc
lily/midi-item.cc
lily/music.cc
lily/paper-book.cc
lily/performance.cc
lily/staff-performer.cc
scm/define-grobs.scm

index b19f54124f5c0546259b727ce3c6427702ac5eaa..891cd3de294b2e3e938e7fd4cf47725de7df2b46 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-03-25  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/lily-guile.cc (type_check_assignment): use
+       ly_scheme_function iso. scm_primitive_eval where possible.
+
+       * lily/performance.cc (output): limit channels at 15. This fixes
+       percussion inadvertently showing up in large scores.
+
 2004-03-24  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * input/regression/tuplet-gap.ly: new file.
index 23c3e4370fdae66ae3e2b770676671e4f20a0ef8..cb15cd64b322b7f845fb9f4c77dedf15ed9c906c 100644 (file)
@@ -3461,10 +3461,10 @@ The complete example is shown here:
   << \notes \relative c'' \context Voice = duet { \time 3/4
      g2 e4 a2 f4 g2.  }
   \lyrics << \lyricsto "duet" \new Lyrics {
-    \set vocNam = "Bert"
+    \set vocalName = "Bert"
     Hi, my name is Bert. }
   \lyricsto "duet" \new Lyrics {
-    \set vocNam = "Ernie"
+    \set vocalName = "Ernie"
     Ooooo, ch\'e -- ri, je t'aime.
     }
   >> >>
@@ -3477,11 +3477,11 @@ The complete example is shown here:
 
 Stanza numbers can be added by setting @code{stanza}, e.g.
 
-@lilypond
+@lilypond[verbatim,relative=2]
 << \context Voice = duet { \time 3/4
      g2 e4 a2 f4 g2.  }
    \lyrics \lyricsto "duet" \new Lyrics {
-       \set vocNam = "1. "
+       \set stanza = "1. "
        Hi, my name is Bert.
    }
 >>
index 7cd21b0246e5c4d1d0cb1e16911f361402e72871..dbb66d10ef001357461fdbe67cad5acc28889c31 100644 (file)
@@ -168,7 +168,7 @@ Global_context::apply_finalizations ()
   set_property ("finalizations" , SCM_EOL); 
   for (SCM s = lst ; gh_pair_p (s); s = gh_cdr (s))
     {
-      scm_primitive_eval (gh_car (s));
+      scm_primitive_eval (gh_car (s)); // TODO: make safe.
     }
 }
 
index 3e25ad802633a025509fa33d93079ce01ed6db5a..ca54756ac4c54f2270c8b23cecffb0a2721942e7 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef AUDIO_ELEMENT_HH
 #define AUDIO_ELEMENT_HH
 
- #include <typeinfo>
+#include <typeinfo>
 #include "virtual-methods.hh"
 
 class Audio_element
index 20c57ec9fa7fcb5400fb50ec911bd13d987cc6f5..19f3bb04a7ee0073339052f03adeff545957fc9f 100644 (file)
@@ -11,7 +11,8 @@
 #include "lily-proto.hh"
 #include "audio-element.hh"
 
-struct Audio_staff : public Audio_element {
+struct Audio_staff : public Audio_element
+{
   void add_audio_item (Audio_item*  l);
   void output (Midi_stream& midi_stream_r, int track_i);
 
index 50a352bed115203f2d057bc407dacc8f2b7623a9..c9ced39f6ab631d1d43891859a55ed880d1e1cf7 100644 (file)
@@ -45,9 +45,7 @@ Key_performer::create_audio_elements ()
   if (key_req_) 
     {
       SCM pitchlist = key_req_->get_property ("pitch-alist");
-      static SCM proc;
-      if (!proc)
-       proc = scm_primitive_eval (ly_symbol2scm ("alterations-in-key"));
+      SCM proc = ly_scheme_function ("alterations-in-key");
       
       SCM acc = gh_call1 (proc, pitchlist);
       
@@ -63,7 +61,7 @@ Key_performer::create_audio_elements ()
 
       /* MIDI keys are too limited for lilypond scales.
         We check for minor scale and assume major otherwise.  */
-      SCM minor = scm_primitive_eval (ly_symbol2scm ("minor"));
+      SCM minor = scm_c_eval_string ("minor");
       audio_ = new Audio_key (gh_scm2int (acc),
                              SCM_BOOL_T != scm_equal_p (minor, c_pitchlist));
 
index 9562ba7bd52f492de0bdda6fc3797ced9e5907bc..d9dc08382bd195770e853164aad8ee42686a13f2 100644 (file)
@@ -600,7 +600,7 @@ type_check_assignment (SCM sym, SCM val,  SCM type_symbol)
        {
          SCM errport = scm_current_error_port ();
          ok = false;
-         SCM typefunc = scm_primitive_eval (ly_symbol2scm ("type-name"));
+         SCM typefunc = ly_scheme_function ("type-name");
          SCM type_name = gh_call1 (typefunc, type);
 
         
index 9ade245a717fe39c17aa26a753d7a514fdb9f8a6..1fd33773adf9123177d1eaa25bffb9186e8b3e53 100644 (file)
@@ -144,7 +144,7 @@ Midi_instrument::to_string () const
   /*
     UGH. don't use eval.
    */
-  SCM proc = scm_primitive_eval (ly_symbol2scm ("midi-program")); 
+  SCM proc = ly_scheme_function ("midi-program");
   SCM program = gh_call1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
   found = (program != SCM_BOOL_F);
   if (found)
index 81ff4f92a078dc2beadcab011ecbe18c75426e8d..df19f5cb36f4140cdceb9c9897219c00353f464b 100644 (file)
@@ -342,13 +342,11 @@ LY_DEFINE (ly_music_transpose, "ly:music-transpose",
   return sc->self_scm ();
 }
 
-SCM make_music_proc;
 
 Music*
 make_music_by_name (SCM sym)
 {
-  if (!make_music_proc)
-    make_music_proc = scm_primitive_eval (ly_symbol2scm ("make-music"));
+  SCM make_music_proc = ly_scheme_function ("make-music");
        
   SCM rv = scm_call_1 (make_music_proc, sym);
 
index 4f48f7a5adab554eb2c3a3cfdf12a94c4ec9ee06..ae8e547c1ca0c96513194c7da8de2ab040948efd 100644 (file)
@@ -98,8 +98,8 @@ Page::Page (Paper_def *paper, int number)
   copyright_ = SCM_EOL;
   tagline_ = SCM_EOL;
   
-  SCM make_header = scm_primitive_eval (ly_symbol2scm ("make-header"));
-  SCM make_footer = scm_primitive_eval (ly_symbol2scm ("make-footer"));
+  SCM make_header = ly_scheme_function ("make-header");
+  SCM make_footer = ly_scheme_function ("make-footer");
 
   header_ = scm_call_2 (make_header, paper_->self_scm (),
                        scm_int2num (number_));
@@ -288,9 +288,9 @@ Paper_book::scopes (int i)
 Stencil*
 Paper_book::title (int i)
 {
-  SCM user_title = scm_primitive_eval (ly_symbol2scm ("user-title"));
-  SCM book_title = scm_primitive_eval (ly_symbol2scm ("book-title"));
-  SCM score_title = scm_primitive_eval (ly_symbol2scm ("score-title"));
+  SCM user_title = ly_scheme_function ("user-title");
+    SCM book_title = ly_scheme_function ("book-title");
+    SCM score_title = ly_scheme_function ("score-title");
   SCM field = (i == 0 ? ly_symbol2scm ("bookTitle")
               : ly_symbol2scm ("scoreTitle"));
 
@@ -354,14 +354,14 @@ Paper_book::init ()
   Paper_def *paper = papers_[0];
   SCM scopes = this->scopes (0);
 
-  SCM make_tagline = scm_primitive_eval (ly_symbol2scm ("make-tagline"));
+  SCM make_tagline = ly_scheme_function ("make-tagline");
   tagline_ = scm_call_2 (make_tagline, paper->self_scm (), scopes);
   Real tag_height = 0;
   if (Stencil *s = unsmob_stencil (tagline_))
     tag_height = s->extent (Y_AXIS).length ();
   height_ += tag_height;
 
-  SCM make_copyright = scm_primitive_eval (ly_symbol2scm ("make-copyright"));
+  SCM make_copyright = ly_scheme_function ("make-copyright");
   copyright_ = scm_call_2 (make_copyright, paper->self_scm (), scopes);
   Real copy_height = 0;
   if (Stencil *s = unsmob_stencil (copyright_))
index 71a84ddb5a3bc3cd75161754a9a9a38aa3503a85..270bc87d10b580e1f5f189229891153def62f32f 100644 (file)
@@ -62,8 +62,19 @@ Performance::output (Midi_stream& midi_stream)
        */
       if (channel == 9)
         channel++;
+
+
+      /*
+       Huh? Why does each staff also have a separate channel? We
+       should map channels to voices, not staves. --hwn.
+       */
       if (s->channel_ < 0)
-        s->channel_ = channel;
+       {
+         s->channel_ = channel <? 15;
+         if (channel > 15)
+           warning ("MIDI channel wrapped around. Mapping to channel 15.");
+       }
+      
       s->output (midi_stream, channel++);
       if (verbose_global_b)
        progress_indication ("]");
index a969143440e992eda497c973067eaac92b905e36..4969d4f85e5877e24c9ff79c93424c187b36c5cb 100644 (file)
@@ -91,9 +91,7 @@ Staff_performer::create_audio_elements ()
 void
 Staff_performer::stop_translation_timestep ()
 {
-  static SCM proc;
-  if (!proc)
-    proc = scm_primitive_eval (ly_symbol2scm ("percussion?"));
+  SCM proc = ly_scheme_function ("percussion?");
   
   SCM drums = gh_call1 (proc, ly_symbol2scm (instrument_string_.to_str0 ()));
   audio_staff_->channel_ = (drums == SCM_BOOL_T ? 9 : -1 );
index 197733cccc7e9bb4456f47b1c1b3cd74a7d898a5..745df7d3c9f59fd54959c7d270f7c30705ac5929 100644 (file)
        (direction . 0)
        (space-alist . ((left-edge . (extra-space . 1.0))
                        ))
+       (break-align-symbol . instrument-name)
        (print-function . ,Text_item::print)            
        (break-align-symbol . clef)
        (break-visibility . ,begin-of-line-visible)