guidolib icon indicating copy to clipboard operation
guidolib copied to clipboard

Ghost note feature request

Open WindowsNT opened this issue 4 years ago • 8 comments

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.

WindowsNT avatar Jul 10 '21 15:07 WindowsNT

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.

dfober avatar Jul 10 '21 17:07 dfober

@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.

arshiacont avatar Jul 10 '21 17:07 arshiacont

How do I enter 'line' mode? Specifying a big enough width OK but how big the height should be ? image

This is with height 500. How do I know how much height I need to display a whole system?

WindowsNT avatar Jul 10 '21 18:07 WindowsNT

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)

dfober avatar Jul 10 '21 19:07 dfober

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.

dfober avatar Jul 10 '21 20:07 dfober

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.

WindowsNT avatar Jul 10 '21 20:07 WindowsNT

I made it working (single line), testing if ghost note works well.

WindowsNT avatar Jul 10 '21 21:07 WindowsNT

I still have issues. In order to draw manually I must first erase the rest and this will also change the layout perhaps.

WindowsNT avatar Jul 11 '21 04:07 WindowsNT