From: Dominique F. <fo...@gr...> - 2011-03-21 08:30:50
|
Hi Le 19 mars 2011 à 02:40, Steve Mokris a écrit : > I've developed a simple application that uses ARFactory to generate and typeset a score. I'm interested in adding realtime playback functionality to this application --- so that the user can press the "play" button, causing the notes currently being played to be highlighted, and a cursor line to move across the system --- similar to the attached screenshot of Cakewalk's Score View. > > Do you have any suggestions as to how I should approach this? > > In other words... Assuming I'm able to determine which AR/GRNotes are currently active, how should I go about: > 1. changing the color of those notes temporarily there is a \noteFormat tag to control the color of a note: [ g \noteFormat<color="red">( a f) \noteFormat<color="0x888888">g a ] but doing this way means to recompute the whole score in real-time only to change one note color. It could work but only with short score. > 2. determining the bounding box of the affected notes (so I can rerender just that part of the display) > 3. determining the bounding box of the current measure in the system (so I can linearly-interpolate and draw the cursor) > ? that's what I'm using to put a cursor on the score. The guido mapping API (see GUIDOScoreMap.h) can deliver various bounding boxes (notes, staves, measures boundaries...) with the associated time information. Note that the mapping API delivers also the mapping between 'rolled' and 'unrolled' time which may be viewed as the correspondence between the score time and the performance time (i.e. with repetitions, jumps to coda, etc...). The Qt guido editor can show the various mappings available (using the preference pane) see at http://sourceforge.net/projects/guidolib/files/Qt%20Applications/ Best (and feel free to ask for any help), -- Dominique ps: the inscore project (http://inscore.sf.net) is using guido and makes an extensive use of mappings to synchronize various objects to a score. |