%type <i> dots
%token <i> DIGIT
%token <pitch> NOTENAME_PITCH
+%token <pitch> TONICNAME_PITCH
%token <pitch> CHORDMODIFIER_PITCH
%token <id> DURATION_IDENTIFIER
%token <id> IDENTIFIER
%type <symtables> symtables symtables_body
%type <pitch> explicit_musical_pitch steno_musical_pitch musical_pitch absolute_musical_pitch
+%type <pitch> steno_tonic_pitch
%type <notereq> steno_notepitch
%type <pitch_arr> pitch_list
-%type <music> chord
-%type <pitch_arr> chord_additions chord_subtractions
-%type <pitch> chord_note
+%type <music> chord notemode_chord
+%type <pitch_arr> chord_additions chord_subtractions
+%type <pitch> chord_addsub chord_note
%type <midi> midi_block midi_body
%type <duration> duration_length
%type <tempo> tempo_request
%type <notenametab> notenames_body notenames_block chordmodifiers_block
-%expect 6
+/* 5 extra for notemode_chord */
+%expect 15
%left '-' '+'
| ';'
;
+optional_dot:
+ /* empty */
+ | '.'
+ ;
+
paper_def_body:
/* empty */ {
Paper_def *p = THIS->default_paper_p ();
$$ = new Transposed_music ($3, *$2);
delete $2;
}
+ | TRANSPOSE steno_tonic_pitch Music {
+ $$ = new Transposed_music ($3, *$2);
+ delete $2;
+ }
| NOTES
{ THIS->lexer_p_->push_note_state (); }
Music
}
;
+steno_tonic_pitch:
+ TONICNAME_PITCH {
+ $$ = $1;
+ }
+ | TONICNAME_PITCH sup_quotes {
+ $$ = $1;
+ $$->octave_i_ += $2;
+ }
+ | TONICNAME_PITCH sub_quotes {
+ $$ = $1;
+ $$->octave_i_ += - $2;
+ }
+ ;
+
explicit_musical_pitch:
MUSICAL_PITCH '{' int_list '}' {/* ugh */
Array<int> &a = *$3;
simple_element:
steno_notepitch notemode_duration {
- if (!THIS->lexer_p_->note_state_b ()
- && !THIS->lexer_p_->chord_state_b ())
+ if (!THIS->lexer_p_->note_state_b ())
THIS->parser_error (_ ("have to be in Note mode for notes"));
$1->duration_ = *$2;
$$ = THIS->get_note_element ($1, $2);
{
$$ = new Array<Musical_pitch>;
}
- | '^' chord_subtractions chord_note {
- $2->push (*$3);
- $$ = $2;
+ | '^' {
+ $$ = new Array<Musical_pitch>;
+ }
+ | chord_subtractions chord_addsub {
+ $$ = $1;
+ $$->push (*$2);
}
;