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-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.
<< \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.
}
>> >>
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.
}
>>
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.
}
}
#ifndef AUDIO_ELEMENT_HH
#define AUDIO_ELEMENT_HH
- #include <typeinfo>
+#include <typeinfo>
#include "virtual-methods.hh"
class Audio_element
#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);
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);
/* 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));
{
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);
/*
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)
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);
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_));
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"));
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_))
*/
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 ("]");
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 );
(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)