- DOUT << "word: `" << str<< "'\n";
- if (YYSTATE == notes){
- if (notename_b (str)) {
- DOUT << "(notename)\n";
- yylval.pitch = new Musical_pitch (lookup_pitch (str));
-
- return NOTENAME_PITCH;
+ SCM sym = ly_symbol2scm (str.ch_C ());
+ if ((YYSTATE == notes) || (YYSTATE == chords)) {
+ SCM pitch = scm_hashq_ref (pitchname_tab_, sym, SCM_BOOL_F);
+ if (pitch != SCM_BOOL_F) {
+ yylval.pitch = new Musical_pitch (pitch);
+ yylval.pitch->set_spot (Input (source_file_l (),
+ here_ch_C ()));
+ return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH;
+ } else if ((pitch = scm_hashq_ref (chordmodifier_tab_, sym, SCM_BOOL_F))!= SCM_BOOL_F)
+ {
+ yylval.pitch = new Musical_pitch (pitch);
+ yylval.pitch->set_spot (Input (source_file_l (),
+ here_ch_C ()));
+ return CHORDMODIFIER_PITCH;