On Wed, 07 Jul 2004 11:02:23 -0400 [EMAIL PROTECTED] wrote: > > Jan Nieuwenhuizen <[EMAIL PROTECTED]> writes: > > > [flup to mailing list]
Before going to comments, I suggest that the use of the lilypond parser could be extended. As an example, for file file.ly: '{ c8 d16 e16 f4 }' ^ at position 14, one would invoke: lilypond --parse-position-only 14 file.ly which would then output some position dependent information, like: '((staff 1) (bar 1) (beats-before 8 16 16)) The parsing of such a file (which is fast IFAIK) should then be stopped to the given position. I can imagine that this kind of information could be easily exploited in a randomly chosen editor. Jan or Han-Wen, is such a '--parse-position-only' option easily programmable? ( If the answer is 'Yep!', the comments below can be ignored. ) > > >> %% foe > > >> | a4 b8 > > >> | c16( d f) > > >> | c4-2 d > > > > > > OK. Is there a BNF grammar I can examine? I'm not sure just what > > > other kinds of exotic stuff 'what-beat' would have to recognize. > > > > No. The specification is in lily/parser.yy, but you can get most > > important things from the tutorial. > > I'll scan that, then. I think the best thing to do actually is find > out everything that can be stuck between a note pitch and its > duration. Its easy to recognize the following note and ignore any > garbage in-between a duration (or the location a duration would exist) > and the following note, and I'd rather not have to teach what-beat > every nuance of Lilypond syntax. As an example of the general case, consider the following syntax: str = \notes { a8 b c d } % new derivation rule \score { \notes { e4 \str % the derivation rule used g4 | a b \grace { c8 d } % notes with zero timing c4 \accacciatura e8 % a note with zero timing g4 | \repeat unfold 4 { c4 } | % repeated notes %{ c4 e f }% % a block comment } Of course, it is enough if what-beat does not handle all special cases. > > > I presume you mean lilypond's emacs mode, right? I can create a patch > > > & send it to you if that's what you prefer. > > > > Yes, that was what I meant, but please discuss with Heikki what needs > > to be done before it goes in. > > Agreed. I can work on integration today. Heikki, what must I do to > what-beat in order to integrate it into emacs-mode? So far, I plan to: > > -> Improve the note-recognition syntax so that what-beat works with as > much as it reasonably can. (I'll document any problems it has.) > > -> Bind what-beat to C-|, add an electric-what-beat binding to |. An electric-what-beat binding to '|' is ok. However, I can imagine that the output is modest, since generally the problem is not But, C-| is different: I have to press AltGr-'<' in order to get '|' (Finnish key variant). I have not tested does C-AltGr-'<' correspond to C-'|'? In this case, there should also be some other key binding. > -> Include elisp code into lilypond, mail you the diffs. > > Is that sufficient? You may develope against version 2.2.0, but prreferably, do cvs diff -u ChangeLog dir1/file1 dir2/file2 ... > patchfile Then the diffs can be merged with ease. > NOTE: I am using lilypond 2.2.0...I was more interested in getting > work done than in testing experimentatl features...at least I started > off that way :) > > -- > David Svoboda [EMAIL PROTECTED] > Senior Research Programmer http://www.cs.cmu.edu/~svoboda > Language Technologies Institute Practice Kind Randomness and > Carnegie Mellon University Beautiful Acts of Nonsense -- Heikki Junes _______________________________________________ lilypond-user mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/lilypond-user