From: Stephane L. <le...@gr...> - 2003-02-05 11:18:18
|
Hi Kai, Juergen told me that you may have more time to answer some Guido questions (: For the Imutus prototype I implemented a MusicalPos to GraphicalPos mapping by directly hacking the OnDraw method of some graphic classes. It was made the following way: - patch the GRSingleNote and GRSingleREst methods to keep the pair (Musical Time Pos and Graphical Pos [ x, y values]) in a list. - for chords I find out that all notes in the chord do not have the correct Musical Time value, i had to keep the value of the preceding "empty" object and associate it to all notes of the chord. - after this step, the (MusicalTimePos, GraphicalPos) list is scanned, and the YMix,YMax values for all notes inside a system is computed. This (YMix,YMax) value is then associated to all notes of the corresponding system. - a GuidoMusiclPos2GraphicalPos function allow to retrieve the GraphicalPos corresponding to a given MusicalPos in the form (X, YMin, YMax). This allows to later display a cursor at the right x position with a correct y dimension. During the coding i found several problems: - it seems that there is a problem in the [system, page] data structure. The last system of a page does not point to its containing page but to the next page. Is this the expected behavior? it seems like a bug but i was not able to find at which step it could occur. This problem does no occur in an explicit \newPage tag is used. It seems that this problem also explains the strange behavior of the GuidoGetPageRTP function. - the GuidoGetPageNum(int num, int denom) returns -1 when the given (num, denom) values do not correspond to existing musical symbols in the structure. Could you help me found the last system pointer bug? Do you have any advice on when and how this mapping structure could be built in a cleaner way? Thanks in advance Stephane Grame: Centre National de creation musicale 9, Rue du Garet 69001 Lyon Tel: 04-72-07-37-00 Fax: 04-72-07-37-01 Web: www.grame.fr |