guidolib
guidolib copied to clipboard
Ghost note feature request
The idea is to display a ghost note on mouse over so when the user clicks, I create a note at that position.
The problem that is when I actually draw a grey note is that the layout sometimes changes. This creates flashing when the mouse moves.
An easy solution to this is to provide hit testing for the staff (notes) so I draw a circle manually.
A more complex solution which is generally advisable is to lock the measures in place no matter how many notes they contain.
I guess the main problem is when a new note creates a new line (which may change the layout significantly). One solution is to use a page format with an infinite (very long) width. But it supposes to edit the score in 'line mode'
A more complex solution which is generally advisable is to lock the measures in place no matter how many notes they contain.
That's not really possible. It's quite difficult to interfer with the layout algorithm.
@WindowsNT To my knowledge GuidoLib is not designed for that but depending on the kind of application, you can achieve this using Guido Mappings: If the inserted "ghost note" is not supposed to change the entire rhythmic structure of the measure (let's say it's just some annotation), what I would do is to simply draw it on a transparent Layer on top of the rendered Guido Layer. The different internal maps available are there to help! On OSX/iOS operating systems this can easily be achieved by the CoreAnimation or CoreGraphics frameworks.
How do I enter 'line' mode?
Specifying a big enough width OK but how big the height should be ?

This is with height 500. How do I know how much height I need to display a whole system?
You can set the height so that to get a single line (e.g. h=5cm). You can also extend the width to a larger value (e.g. w=1000cm or more)
another idea comes to mind: you can also create a score with 'empty' elements for the parts that are not filled, and replace these 'empty' elements with notes as you edit.
That I 've done, but it still changes the layout ocassionally when I add a note. Basically I 'd like a line edit mode without the need of setting height... can this be done? I can't seem to make it working.
I made it working (single line), testing if ghost note works well.
I still have issues. In order to draw manually I must first erase the rest and this will also change the layout perhaps.