*/
-#include <iostream.h>
#include <ctype.h>
#include "translator-def.hh"
#include "lily-guile.hh"
-#include "change-iterator.hh"
#include "misc.hh"
#include "my-lily-lexer.hh"
#include "paper-def.hh"
#include "file-path.hh"
#include "warn.hh"
#include "dimensions.hh"
-
-#include "request.hh"
#include "my-lily-parser.hh"
-#include "context-specced-music.hh"
#include "score.hh"
-#include "music-list.hh"
-#include "output-property-music-iterator.hh"
-#include "property-iterator.hh"
#include "input-file-results.hh"
#include "input.hh"
-#include "relative-music.hh"
-#include "lyric-combine-music.hh"
-#include "transposed-music.hh"
-#include "time-scaled-music.hh"
-#include "repeated-music.hh"
-#include "untransposable-music.hh"
#include "lilypond-input-version.hh"
-#include "grace-music.hh"
-#include "part-combine-music.hh"
#include "scm-hash.hh"
#include "auto-change-iterator.hh"
-#include "un-relativable-music.hh"
#include "chord.hh"
#include "ly-modules.hh"
+#include "music-sequence.hh"
bool
regular_identifier_b (SCM id)
}
+
bool
is_duration_b (int t)
{
{
static SCM proc;
if (!proc)
- proc = scm_c_eval_string ("old-span-request->event");
+ proc = scm_c_eval_string ("old-span-event->event");
SCM m = scm_call_1 (proc, name);
scm_gc_protect_object (m);
return unsmob_music (m);
%token ALIAS
%token APPLY
%token ARPEGGIO
-%token DYNAMICSCRIPT
%token ACCEPTS
%token ALTERNATIVE
%token BAR
%token <scm> MUSIC_OUTPUT_DEF_IDENTIFIER
%token <scm> NUMBER_IDENTIFIER
-%token <scm> REQUEST_IDENTIFIER
+%token <scm> EVENT_IDENTIFIER
%token <scm> MUSIC_IDENTIFIER TRANSLATOR_IDENTIFIER
%token <scm> STRING_IDENTIFIER SCM_IDENTIFIER
%token <scm> RESTNAME
%type <outputdef> output_def
%type <scm> lilypond_header lilypond_header_body
-%type <music> open_request_parens close_request_parens open_request close_request
-%type <music> request_with_dir request_that_take_dir verbose_request
+%type <music> open_event_parens close_event_parens open_event close_event
+%type <music> event_with_dir event_that_take_dir verbose_event
%type <i> sub_quotes sup_quotes
-%type <music> simple_element request_chord command_element Simple_music Composite_music
+%type <music> simple_element event_chord command_element Simple_music Composite_music
%type <music> Repeated_music
%type <scm> Alternative_music
%type <i> tremolo_type
%type <scm> steno_duration optional_notemode_duration multiplied_duration
%type <scm> verbose_duration
-%type <reqvec> pre_requests post_requests
+%type <reqvec> pre_events post_events
%type <music> gen_text_def
%type <scm> steno_pitch pitch absolute_pitch
%type <scm> explicit_pitch steno_tonic_pitch
%type <scm> Music_list
%type <outputdef> music_output_def_body
%type <music> shorthand_command_req
-%type <music> post_request
+%type <music> post_event
%type <music> command_req verbose_command_req
%type <music> extender_req
%type <music> hyphen_req
-%type <music> string_request
+%type <music> string_event
%type <scm> string bare_number number_expression number_term number_factor
%type <score> score_block score_body
%type <scm> translator_spec_block translator_spec_body
-%type <music> tempo_request
+%type <music> tempo_event
%type <scm> notenames_body notenames_block chordmodifiers_block
%type <scm> script_abbreviation
$$ = $1->self_scm ();
scm_gc_unprotect_object ($$);
}
- | post_request {
+ | post_event {
$$ = $1->self_scm ();
scm_gc_unprotect_object ($$);
}
| music_output_def_body STYLESHEET embedded_scm {
dynamic_cast<Paper_def*> ($$)-> style_sheet_ = $3;
}
- | music_output_def_body tempo_request {
+ | music_output_def_body tempo_event {
/*
junk this ? there already is tempo stuff in
music.
Duration *d = unsmob_duration ($2->get_mus_property ("duration"));
Midi_def * md = dynamic_cast<Midi_def*> ($$);
if (md)
- md->set_tempo (d->length_mom (), m);
+ md->set_tempo (d->get_length (), m);
}
| music_output_def_body error {
}
;
-tempo_request:
+tempo_event:
TEMPO steno_duration '=' bare_unsigned {
$$ = MY_MAKE_MUSIC("TempoEvent");
$$->set_mus_property ("duration", $2);
_("More alternatives than repeats. Junking excess alternatives."));
alts = ly_truncate_list (times, alts);
}
-
- Music *r = MY_MAKE_MUSIC("RepeatedMusic");
+
+
+ static SCM proc;
+ if (!proc)
+ proc = scm_c_eval_string ("make-repeated-music");
+
+ SCM mus = scm_call_1 (proc, $2);
+ scm_gc_protect_object (mus); // UGH.
+ Music *r =unsmob_music (mus);
if (beg)
{
r-> set_mus_property ("element", beg->self_scm ());
r->set_mus_property ("repeat-count", gh_int2scm (times >? 1));
r-> set_mus_property ("elements",alts);
- SCM func = scm_primitive_eval (ly_symbol2scm ("repeat-name-to-ctor"));
- SCM result = gh_call1 (func, $2);
-
if (gh_equal_p ($2, scm_makfrom0str ("tremolo")))
{
/*
else
gh_call3 (func, r->self_scm (), gh_int2scm(-intlog2 ($3)), gh_int2scm(0));
}
-
- set_music_properties (r, result);
-
r->set_spot (*$4->origin ());
$$ = r;
;
Simple_music:
- request_chord { $$ = $1; }
+ event_chord { $$ = $1; }
| OUTPUTPROPERTY embedded_scm embedded_scm '=' embedded_scm {
SCM pred = $2;
if (!gh_symbol_p ($3))
THIS->parser_error (_ ("First argument must be a procedure taking one argument"));
}
- Music*m = MY_MAKE_MUSIC("OutputPropertySetMusic");
+ Music*m = MY_MAKE_MUSIC("OutputPropertySetMusic");
m->set_mus_property ("predicate", pred);
m->set_mus_property ("grob-property", $3);
m->set_mus_property ("grob-value", $5);
| AUTOCHANGE STRING Music {
Music*chm = MY_MAKE_MUSIC("AutoChangeMusic");
chm->set_mus_property ("element", $3->self_scm ());
+ chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_proc);
scm_gc_unprotect_object ($3->self_scm ());
chm->set_mus_property ("what", $2);
= gh_equal_p ($4, scm_makfrom0str ("autoBeamSettings"));
bool itc = internal_type_checking_global_b;
Music *t = MY_MAKE_MUSIC("OverrideProperty");
-
t->set_mus_property ("symbol", scm_string_to_symbol ($4));
t->set_mus_property ("pop-first", SCM_BOOL_T);
if (autobeam)
;
-request_chord:
- pre_requests {
+event_chord:
+ pre_events {
THIS->push_spot ();
- } /*cont */ simple_element post_requests {
+ } /*cont */ simple_element post_events {
Music_sequence *l = dynamic_cast<Music_sequence*> ($3);
$1->concat (*$4);
command_element:
command_req {
- $$ = MY_MAKE_MUSIC("RequestChord");
+ $$ = MY_MAKE_MUSIC("EventChord");
$$->set_mus_property ("elements", scm_cons ($1->self_scm (), SCM_EOL));
scm_gc_unprotect_object ($1->self_scm());
l->set_mus_property ("span-direction", gh_int2scm (START));
l->set_spot (THIS->here_input ());
- $$ = MY_MAKE_MUSIC("RequestChord");
+ $$ = MY_MAKE_MUSIC("EventChord");
$$->set_mus_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
scm_gc_unprotect_object (l->self_scm());
$$->set_spot (THIS->here_input ());
l->set_mus_property ("span-direction", gh_int2scm (STOP));
l->set_spot (THIS->here_input ());
- $$ = MY_MAKE_MUSIC("RequestChord");
+ $$ = MY_MAKE_MUSIC("EventChord");
$$->set_mus_property ("elements", scm_cons (l->self_scm (), SCM_EOL));
$$->set_spot (THIS->here_input ());
scm_gc_unprotect_object (l->self_scm());
csm->set_mus_property ("context-type", scm_makfrom0str ("Timing"));
}
| PARTIAL duration_length {
- Moment m = - unsmob_duration ($2)->length_mom ();
+ Moment m = - unsmob_duration ($2)->get_length ();
Music * p = set_property_music (ly_symbol2scm ( "measurePosition"),m.smobbed_copy ());
Music * sp = MY_MAKE_MUSIC("ContextSpeccedMusic");
sp-> set_mus_property ("context-type", scm_makfrom0str ("Timing"));
}
| CLEF STRING {
- SCM func = scm_primitive_eval (ly_symbol2scm ("clef-name-to-properties"));
- SCM result = gh_call1 (func, $2);
-
- SCM l = SCM_EOL;
- for (SCM s = result ; gh_pair_p (s); s = ly_cdr (s)) {
- Music * p = MY_MAKE_MUSIC("Music");
- set_music_properties (p, ly_car (s));
- l = scm_cons (p->self_scm (), l);
- scm_gc_unprotect_object (p->self_scm ());
- }
- Music * seq = MY_MAKE_MUSIC("SequentialMusic");
- seq->set_mus_property ("elements", l);
+ static SCM proc ;
+ if (!proc)
+ proc = scm_c_eval_string ("make-clef-set");
- Music * sp = MY_MAKE_MUSIC("ContextSpeccedMusic");
- sp->set_mus_property ("element", seq->self_scm ());
- scm_gc_unprotect_object (seq->self_scm ());
-
- $$ =sp ;
- sp-> set_mus_property ("context-type", scm_makfrom0str ("Staff"));
+ SCM result = scm_call_1 (proc, $2);
+ scm_gc_protect_object (result);
+ $$ = unsmob_music (result);
}
| TIME_T fraction {
Music * p1 = set_property_music (ly_symbol2scm ( "timeSignatureFraction"), $2);
$$ = skip;
}
- | tempo_request {
+ | tempo_event {
$$ = $1;
}
| KEY DEFAULT {
}
;
-post_requests:
+post_events:
{
$$ = new Link_array<Music>;
}
- | post_requests post_request {
+ | post_events post_event {
$2->set_spot (THIS->here_input ());
$$->push ($2);
}
;
-post_request:
- verbose_request
- | request_with_dir
- | close_request
- | string_request
+post_event:
+ verbose_event
+ | event_with_dir
+ | close_event
+ | string_event
;
-string_request:
+string_event:
E_UNSIGNED {
Music * s = MY_MAKE_MUSIC("StringNumberEvent");
s->set_mus_property ("string-number", gh_int2scm($1));
;
-request_that_take_dir:
+event_that_take_dir:
gen_text_def
- | verbose_request
+ | verbose_event
+ | close_event
+ | open_event
| script_abbreviation {
SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1));
Music *a = MY_MAKE_MUSIC("ArticulationEvent");
}
;
-request_with_dir:
- script_dir request_that_take_dir {
+event_with_dir:
+ script_dir event_that_take_dir {
$2->set_mus_property ("direction", gh_int2scm ($1));
$$ = $2;
}
;
-verbose_request:
- REQUEST_IDENTIFIER {
+verbose_event:
+ EVENT_IDENTIFIER {
$$ = unsmob_music ($1)->clone ();
$$->set_spot (THIS->here_input ());
}
- | DYNAMICSCRIPT embedded_scm {
- /*
- TODO: junkme, use text-type == dynamic
- */
- Music *d = MY_MAKE_MUSIC("TextScriptEvent");
- SCM dyn = ly_symbol2scm ("dynamic");
- d->set_mus_property ("text-type" , dyn);
- d->set_mus_property ("text", $2);
- d->set_spot (THIS->here_input ());
- $$ = d;
- }
| SPANREQUEST bare_int STRING {
Music * sp = make_span_req ($3);
}
;
-close_request:
- close_request_parens {
+close_event:
+ close_event_parens {
$$ = $1;
dynamic_cast<Music *> ($$)->set_mus_property ("span-direction", gh_int2scm (START))
;
}
;
-close_request_parens:
+close_event_parens:
'(' {
Music * s= MY_MAKE_MUSIC("SlurEvent");
$$ = s;
;
-open_request:
- open_request_parens {
+open_event:
+ open_event_parens {
$$ = $1;
dynamic_cast<Music *> ($$)->set_mus_property ("span-direction", gh_int2scm (STOP))
;
}
;
-open_request_parens:
+open_event_parens:
E_EXCLAMATION {
Music *s = MY_MAKE_MUSIC("CrescendoEvent");
s->set_spot (THIS->here_input());
| '-' { $$ = CENTER; }
;
-pre_requests:
+pre_events:
{
$$ = new Link_array<Music>;
}
- | pre_requests open_request {
+ | pre_events open_event {
$$->push ($2);
}
;
figure_spec:
FIGURE_OPEN figure_list FIGURE_CLOSE {
- Music * m = MY_MAKE_MUSIC("RequestChord");
+ Music * m = MY_MAKE_MUSIC("EventChord");
$2 = scm_reverse_x ($2, SCM_EOL);
m->set_mus_property ("elements", $2);
$$ = m->self_scm ();
if ($2 % 2 || $3 % 2)
n->set_mus_property ("force-accidental", SCM_BOOL_T);
- Music *v = MY_MAKE_MUSIC("RequestChord");
+ Music *v = MY_MAKE_MUSIC("EventChord");
v->set_mus_property ("elements", scm_list_n (n->self_scm (), SCM_UNDEFINED));
scm_gc_unprotect_object (n->self_scm());
rest_req->set_spot (i);
e = rest_req->self_scm ();
}
- Music * velt = MY_MAKE_MUSIC("RequestChord");
+ Music * velt = MY_MAKE_MUSIC("EventChord");
velt-> set_mus_property ("elements", scm_list_n (e,SCM_UNDEFINED));
velt->set_spot (i);
;
sp2-> set_mus_property ("span-direction", gh_int2scm (STOP))
;
- Music *rqc1 = MY_MAKE_MUSIC("RequestChord");
+ Music *rqc1 = MY_MAKE_MUSIC("EventChord");
rqc1->set_mus_property ("elements", scm_list_n (sp1->self_scm (), SCM_UNDEFINED));
- Music *rqc2 = MY_MAKE_MUSIC("RequestChord");
+ Music *rqc2 = MY_MAKE_MUSIC("EventChord");
rqc2->set_mus_property ("elements", scm_list_n (sk->self_scm (), SCM_UNDEFINED));;
- Music *rqc3 = MY_MAKE_MUSIC("RequestChord");
+ Music *rqc3 = MY_MAKE_MUSIC("EventChord");
rqc3->set_mus_property ("elements", scm_list_n (sp2->self_scm (), SCM_UNDEFINED));;
SCM ms = scm_list_n (rqc1->self_scm (), rqc2->self_scm (), rqc3->self_scm (), SCM_UNDEFINED);
lreq->set_mus_property ("text", $1);
lreq->set_mus_property ("duration",$2);
lreq->set_spot (i);
- Music * velt = MY_MAKE_MUSIC("RequestChord");
+ Music * velt = MY_MAKE_MUSIC("EventChord");
velt->set_mus_property ("elements", scm_list_n (lreq->self_scm (), SCM_UNDEFINED));
$$= velt;
;
number_factor:
- '(' number_expression ')' {
- $$ = $2;
- }
- | '-' number_factor { /* %prec UNARY_MINUS */
+ '-' number_factor { /* %prec UNARY_MINUS */
$$ = scm_difference ($2, SCM_UNDEFINED);
}
| bare_number