Hi, I'm looking for a way to draw and then move little graphic elements (piano-roll style musical notes) on a background image (the musical staff), to create a simple music editor or 'digital audio workstation', where notes can be moved up and down, left and right, changed, etc. What method would you use to do this? The note images should be capable of blending with the staff according to alpha values rather than just overwriting it.
This will also require a 'cursor' - an indication of which note is selected for editing - which might be done by colouring it or drawing a rectangle or circle around it (another moveable element, perhaps), if you have any tips on that.
I'm using gdip.ahk, of course, thanks @tic.
If anyone can write the bare bones of a routine to do any bit of that, describe what I need to do, or link to a script that might help, that would be ace.
Select and move graphic elements over background image? Topic is solved
Re: Select and move graphic elements over background image?
AFAIK, @bichlepa's AutoHotflow could give you an idea. Well, I might be wrong. Make up your mind & good luck
Re: Select and move graphic elements over background image?
Thanks for that, @BoBo. Unfortunately, it's way above my pay grade, especially as the code is in lots of different scripts. I'll need something quite simple for me to understand! Looks like a very interesting project that though.BoBo wrote: ↑22 Feb 2022, 06:27AFAIK, @bichlepa's AutoHotflow could give you an idea. Well, I might be wrong. Make up your mind & good luck
I was thinking it might be a case of defining 'sprite' images, and that I might have to get my head around 'layered windows', but I'm just guessing from some searches. Even moving these around as sprites will be interesting, because the notes have a shader, indicating how long they play for, and these can be of various lengths and the notehead can be various shapes, so it wouldn't just be a few sprites, as far as I can guess.
I could, of course, just re-draw the whole page of music (or line, if nothing is moved onto another line by the change) every time a note is nudged up or down, etc., but it's rather slow.
I may have to abandon the idea of bumping notes around repeatedly (i.e. if the note was moved up several lines) and just allow the user to select the note and then define where its destination is, or change its horizontal position or length. That way it would only require one re-drawing and speed would be less important.
I'm also forgetting that the slowness I'm seeing is only partly the GDI+ functions - I'm also parsing a text file that has the notes. I'll try reading the values into arrays first (which is how it would work eventually anyway) and re-draw from those. It might not be a problem. Cheers!
Re: Select and move graphic elements over background image? Topic is solved
Another 'suspect' that came to mind is YT-channel's CivReborn AKA @Hellbent who is/was into creating AHK games (?)
Re: Select and move graphic elements over background image?
Excellent, I'll learn a lot from those vids, I reckon.
Re: Select and move graphic elements over background image?
I've made a few tweaks to my music drawing routines and they're running much faster, and I think I'll go with that, but I do think Hellbent's PopupWindow Class would be another way to go in other circumstances. I watched him demo it on Joe's YT: https://www.youtube.com/watch?v=8D3o2Y5eSR8
Thanks again!
Thanks again!