Notename issue
Hello all,
I modified the plugin "notenames.qml" so that it only processes voice 1 and 2 (0 and 1 in the code), counts backwards so that it processes voice 2 first and then voice 1 putting the text ABOVE. This works fine and the text for the notes follows (decending) as the notes on the staff. This is an easy way to combine voices 1 and 2 into a stack of text. I had another version that actually made one text block but I lost it, ha!
I then save the score, open it, and the text stacking is flipped back as it would be with the original code. I don't rerun any pluggins, etc after opening the score again. It's like it is reording the text when it opens the code.
Recreate the problem by:
- loading the attached file "test.mscz"
- Running the attached plugin "notesjth.qml" against it.
- Noting the note-name text positions for the first chord as B,F#,C# (descending).
- Saving the file.
- Reopening the file and noting the first chord as F#,C#,B (descending).
-- Scratching one's head.
Thanks for great code. I only wish my fantom keyboard supported it somehow. I had kicked around writing an interface, basically translating the DAW commands that the fantom does support into something usable on musescore but didn't get there yet.
Jerry
Attachment | Size |
---|---|
notesjth.qml | 12.42 KB |
test.mscz | 4.44 KB |
Comments
If I understand correctly, you are saying the plugin adds two texts at the same tick, with a voice 2 text added first, followed by a voice 1 text. And this should indeed result in the voice 2 text appearing closer to the staff, with the voice 1 text appearing further outside by default due to autoplace. But on reload of the score, presumably voice 1 is being read first, so the order is reversed. Solution would be to not rely on the order the elements are added to get the position you want, but set the offsets manually (and probably disable autoplace for them).
In reply to If I understand correctly,… by Marc Sabatella
So you are suggesting instead of using the term "above" or "below" do use an offset? I think I tried that once and they ended-up overlapping.
What I don't understand is why it looks fine until I save and reload it.
In reply to So you are suggesting… by dadorehancock
If I understand correctly, it looks fine until you save and reload for the reason I explained: the position is based on the order the elements are added in, but that order is different when adding directly ads opposed to reading from file. Adding directly, it's first come first served. reading from a file, voices are processed in order.
Assuming you want both above or both below, then no need to change that - just give them different offsets, and disable autoplace so the position of one doesn't affect that of the other. If you really want one above and one below, then I'm confused, as there should be no problem with order.
In reply to If I understand correctly,… by Marc Sabatella
I want all 'above'. The problem I remember with placement offsets was it was hard to keep the note names from overlapping. I understand what you are saying about auto - above or below - and I played with placement once before but couldn't get it quite right. I think I will just write a macro and run it when a score loads as they look perfect when I run my code.
Here's another option, is it possible to convert auto text placement to offsets? Basically take the current position and make it an offset so this problem goes away? I tried converting it to system text and if overlaps, for instance.
In reply to I want all 'above'. The… by dadorehancock
I'm not really understanding the question here. It should be perfectly possible, simple really, to assign direct offsets that don't overlap. Eg, -2 sp and -4 sp will work as long as the lower text is less than 2sp tall.