From: Henry F. <gui...@He...> - 2019-09-27 22:21:39
|
I too would be interested in the ability of a hit-testing mechanism - ideally for any element that can be specified in the score. I've been pondering this for some time, and I have not yet imagined a strong solution. Simply returning a "note" (Event?) from a hit test does not seem detailed enough. For example, with a unison, how do we know which note was hit? If however, there was a way to tag each element in a predictable manner, then that tag could be returned for testing and for enabling interaction with the generated score. Some ideas: - When using human generated scores, Guido could create default tags that are automatically generated from the score itself. E.g., line & character (an admittedly brute-force method), plus type and details of element might be suitable. The type and details could suffice for some (e.g., the note on a particular beat); and the line and character could be enough for someone to code more specific details. - Then have the ability to specify actual tags (names?) to each element. That would require changes to the parser. Specific tags would be cumbersome for human generated scores, but would be useful for computer generated scores. - If not have manually defined tags as an option for each element in the ASCII score, perhaps export the ability to do this with function calls so if someone is writing code to generate scores through direct function calls, they could add specific tags. Finally, where is the hit test information stored when a score is generated? Is it part of some larger data structure, or is it a separate data structure generated in a similar way to the score being generated? All of these ideas come from a cursory examination of the GUIDOLib, not from an attempt to use it extensively. Thus my conjectures may reflect fundamental misunderstandings about the library. Thanks, Henry > On Sep 27, 2019, at 8:44 AM, Michael Chourdakis <win...@gm...> wrote: > > I'm up to putting Quido to my sequencer. > > There are questions: > > 1. I'm trying to create a Direct2D device so Guido can use my normal render target, hardware accelerated. > This is the output: > > <image.png> > > When using the implemented HDC, this is the correct one: > > <image.png> > <image.png> > > It seems to me that some weird scaling occurs. > > This is my code: > > virtual void DrawMusicSymbol(float x, float y, unsigned int inSymbolID) > { > EnsureBrush(); > D2D1_RECT_F ly = { 0 }; > wstring yy = inSymbolID; > auto ty = MeasureString(mSys->WriteFactory, mCurrMusicFont.Text, yy.c_str(), yy.length()); > // To measure width and height, irrelevant > > // The following is weird, probably > ly.left = (NextOrigin.x + x)* Scale.x; > ly.top = (NextOrigin.y + y)*Scale.y; > ly.right = ly.left + std::get<0>(ty); > ly.bottom = ly.top + std::get<1>(ty); > > mSys->rt->DrawTextW(yy.c_str(), yy.length(), mCurrMusicFont.Text, ly, NextColor); > } > > I need to understand more on scaling perhaps. Any ideas? > > 2. Can the guido factory create all sort of elements? I want to create a score editor and I can use it if it can create everything, otherwise I will simply edit gmn sources with my code. > > 3. Is there a hit testing mechanism, information about where each element is drawn? Notes particularly. So they can be hit-tested with the mouse and edited perhaps. If not, I can make a keyboard-only editor. > > Best Regards, > > _______________________________________________ > Guidolib-devel mailing list > Gui...@li... > https://lists.sourceforge.net/lists/listinfo/guidolib-devel |