NoteWorthy Composer Forum

Forums => Tips & Tricks => Object Plugins => Topic started by: hmmueller on 2018-05-20 09:26 am

Title: Breve.hmm (0.6)
Post by: hmmueller on 2018-05-20 09:26 am
Here is a user object that helps with breve notes (double length of whole notes). The plugin should suffice to write the final chords of hymnbook melodies and chants, and maybe some more uses - the examples have some of them. However, it has its limitations, especially if one wants to use ties (not typical with breves), dots (not at all typical with breves), or when playing them.
(The BrevePlayExample needs the Mensurstrich.hmm object - breves go with old music, so this makes sense, I think).

To create a breve, first create two whole notes (semibreves), then place this object to the left of the first semibreve, and finally change the noteheads of both semibreves to blank heads (by selecting both and then e.g. pressing Q B on the keyboard). In the editor, two small vertical lines indicate the position of the now indiscernable two notes - which are, however, technically not "hidden": The reason for this is that NWC will do layouting with the two semibreves, and the breve notehead can be placed accordingly.

The second semibreve can also be a whole rest, or actually any item. The second item is only used by NWC to reserve space for the complete breve. Using a hidden rest as the second item is useful if the breve is tied to another note - however, the ties are not really placed nicely.

The drawing of the noteheads is controlled by available fonts and user selected options: If fonts from Lawrie Pardy's *Dings suites are installed, one can use square and "double bar" noteheads from them. By default, the plugin looks for the fonts MusikDingsSerif and then MusikDingsSans; if neither is found,


It is also possible to have chords of breves, and even chords with two durations do somehow work.

Last, there is also some support for playing. By default, the object is muted, but it can be unmuted. In that case, the two blank semibreves should be muted. Playing does not work with chords with two duration and restchords. Performance marks like staccato etc. are not considered when playing.

This user object does not (yet?) work nicely with the Cueheads.ms object, because that object also uses blank note heads.

H.M.
Title: Re: Breve.test (0.1)
Post by: Flurmy on 2018-05-20 09:41 am
The "square" notehead is created with two letters "I" of font "Times New Roman" lying on their side; it is barely acceptable - but I did not want to design full bezier curve layouts for this single symbol.
No need.
You can find it in NWC2STDA, char 61531.
Title: Re: Breve.test (0.1)
Post by: Lawrie Pardy on 2018-05-20 09:43 am
Hey there HM, FWIW there are breves in my *Dings suites.  Checkout the name fonts E.G. SwingDings.ttf, MusikDingsSans.ttf and MusikDingsSerif.ttf

There is also a modern form of the breve in NWC2STDA.TTF  (2 vertical lines, a notehead like a semibreve and 2 more vertical lines)

Perhaps they will make things a little easier.



Title: Re: Breve.test (0.1)
Post by: hmmueller on 2018-05-20 10:56 am
That's why I like this ".test" idea - try something out, get told that there are better ways - improve, rinse & repeat until it's finally something which might be usable :)

Thanks to both of you - we'll drive home now (5 hours drive) ... then I'll use this glyphs.

H.M.
Title: Re: Breve.test (0.1)
Post by: Mike Shawaluk on 2018-05-20 11:56 am
This user object does not work nicely with the Cueheads.ms object, because that object also uses blank note heads.
It would certainly be possible for CueHeads.ms to detect Breve.hmm and adjust its behavior accordingly (i.e. suppress its drawing when that object is found).
Title: Re: Breve.test (0.1)
Post by: Mike Shawaluk on 2018-05-20 12:03 pm
A further suggestion for you to consider. I assume you are using a blank notehead for the semibreves so that NWC will still reserve space in the layout. However, since you are placing the user object at each breve location, it can specify its own width via the "width" hook. In that case, you can mark the actual semibreve chords as hidden, and avoid interaction with CueHeads.ms.

This is just a theoretical suggestion, which I haven't tried.
Title: Re: Breve.test (0.1)
Post by: hmmueller on 2018-05-20 12:37 pm
.. doing a short break, so I'm online :)

(a) CueHeads detecting Breve should be possible - I already thought of this, but the creators of both would have to disucuss this :)

(b) Implementing width and marking the chords as hidden: I actually started with this, but it did not work out at all (maybe I did not try all possibilities). The main problem is that hidden notes are not aligned by NWC with other notes, and therefore it is alsmost impossible to place the breves lined up with notes on other staffs; it gets worse with (*) accidentals, (*) the "increase spacing" option in the page setup, (*) lyrics (breves are mostly useful for vocal music) etc. That's why I ended up with the blank noteheads ...

(In the course of this and - upcoming - considerations about RepeatMarks, I would wish that (x) NWC had more than one - distinguishable - "quite" blank heads; and (y) a way to insert additional, note-aligned spacers when drawing (my idea would be that width(t) could return some more sophisticated result ... but that's long-term ...)

H.M.
Title: Re: Breve.test (0.1)
Post by: Mike Shawaluk on 2018-05-20 01:11 pm
(a) CueHeads detecting Breve should be possible - I already thought of this, but the creators of both would have to discuss this :)
This should certainly be possible, since we are doing it now :)
(b) Implementing width and marking the chords as hidden: I actually started with this, but it did not work out at all (maybe I did not try all possibilities). The main problem is that hidden notes are not aligned by NWC with other notes, and therefore it is alsmost impossible to place the breves lined up with notes on other staffs; it gets worse with (*) accidentals, (*) the "increase spacing" option in the page setup, (*) lyrics (breves are mostly useful for vocal music) etc. That's why I ended up with the blank noteheads ...
In my experience, while NWC does remove all space for a note on the current staff when you mark it as not visible. However, when there are multiple staves, it does seem to keep them lined up with the same note position on the other staves. But maybe I am mistaken.
(In the course of this and - upcoming - considerations about RepeatMarks, I would wish that (x) NWC had more than one - distinguishable - "quite" blank heads; and (y) a way to insert additional, note-aligned spacers when drawing (my idea would be that width(t) could return some more sophisticated result ... but that's long-term ...)
I know what you mean, and I agree. Another suggestion that has been offered in the past is to have "transparent" as one of the notehead colors. This is a bit different than what a blank space notehead does, since that only "hides" the notehead, not the accidental or augmentation dots associated with a notehead.
Title: Re: Breve.test (0.1)
Post by: hmmueller on 2018-05-20 06:03 pm
In my experience, while NWC does remove all space for a note on the current staff when you mark it as not visible. However, when there are multiple staves, it does seem to keep them lined up with the same note position on the other staves.
Mhm - I wrote a minimal user tool + example (see attachments) to check what happens - the result is quite chaotic even with two staffs, I think.
// Edit: ... but for whole notes only, the alignment should work - with the exception of a dotted whole note on another staff, I assume. However, I would also like my breves to be aligned usefully for a single staff ...

But back to the breves: I honestly tried using the letters in various fonts for the "square" notehead - but nwcdraw.text does not output characters with code > 127  >:( ... does anyone know why this might be the case? (the breve heads are at 177 in Lawrie's suites). I have uploaded a version 0.2 which would support these chars, but - well - it does not work :(

And I have another question: Can a plugin somehow detect whether a font is actually installed? .setFont does not return any "success" value, and even querying .getTypeFace() afterwards just returns the set typeface, even if it is 'asdfghj' or some other nonsense. This seems to be the way the Windows font system works ... but I would like to give the user some - any - feedback if the square breve head cannot be drawn (my ugly kicked-over I's, on the other hand, always work ... as long as a "Times New Roman" font is present ...).


Re the ready-made glyphs (whole notehead and 2 or 4 vertical bars): I do, right now, not bother that much with them - drawing the bars is really no problem; and I started the whole object actually only because of the square head (I only found out later about the other ones - we do not use them here). But of course, I might use them if my primary problems are solved ...

H.M.
Title: Re: Breve.test (0.1)
Post by: Flurmy on 2018-05-20 06:34 pm
nwcdraw.text does not output characters with code > 127  >:( ...
Isn't the last version Unicode compatible?
I was thinking so since the experiments (https://forum.noteworthycomposer.com/?topic=8768.msg62166#msg62166)
Title: Re: Breve.test (0.2 - experimental)
Post by: hmmueller on 2018-05-20 06:43 pm
Isn't the last version Unicode compatible?
I was thinking so since the experiments (https://forum.noteworthycomposer.com/?topic=8768.msg62166#msg62166)
Ah - but this is my problem! I have to output UTF-8 bytes via Lua, not a single byte ... will take a few minutes ... very many thanks for that hint!

// Edit
... and version 0.3 now outputs Lawrie's noteheads :) - thanks again for your hint, @Flurmy !

H.M.
Title: Re: Breve.test (0.3)
Post by: Flurmy on 2018-05-20 07:45 pm
Good but...
If in "BreveSquareHeads.nwctxt" you change "single bars" with any "Dings" then the size of each note of the chord is different.

N.B. "BreveSquareHeads.nwctxt" and "BreveSquareHeads.nwctxt" complain about missing the "Germanic" fonts while "BrevePlayExample.nwctxt" says "Detected 1 unknown user objects in BrevePlayExample.nwctxt" ("Mensurstrich.hmm").
Title: Re: Breve.test (0.4)
Post by: hmmueller on 2018-05-20 08:13 pm
Thanks for the tight quality assurance loop ;)


All the x/y coordinates are still "arrived at by optical heuristics" - i.e., looking whether the heads end up about where I expect them. I am not sure whether there is some more analytic method ...

H.M.
Title: Re: Breve.test (0.1)
Post by: Mike Shawaluk on 2018-05-20 08:44 pm
And I have another question: Can a plugin somehow detect whether a font is actually installed? .setFont does not return any "success" value, and even querying .getTypeFace() afterwards just returns the set typeface, even if it is 'asdfghj' or some other nonsense. This seems to be the way the Windows font system works ... but I would like to give the user some - any - feedback if the square breve head cannot be drawn (my ugly kicked-over I's, on the other hand, always work ... as long as a "Times New Roman" font is present ...).
Try this function: https://lua.noteworthycomposer.com/plugin/nwc.md#hasTypeface
Title: Re: Breve.hmm (0.5)
Post by: hmmueller on 2018-05-21 08:28 am
With your help, I have now finished the Breve object - therefore, it has now proceeded from status .test to .hmm. The changes in the 0.5 version are


Mike, you could - if you wanted - now tweak CueHeads a little to make it aware of this object ...

H.M.
Title: Re: Breve.test (0.1)
Post by: David Palmquist on 2018-05-21 08:33 pm
... Another suggestion that has been offered in the past is to have "transparent" as one of the notehead colors. This is a bit different than what a blank space notehead does, since that only "hides" the notehead, not the accidental or augmentation dots associated with a notehead.
Just a quick note, you probably know you can hide accidental signs by hitting 7, 8 or 9 a second time.
Title: Re: Breve.test (0.4)
Post by: Flurmy on 2018-05-21 08:42 pm
... I left the dependency on Mensurstrich.hmm in the Play example
I was thinking that plugin was not published.
Sorry, it's my fault. I didn't install it.

Title: Re: Breve.test (0.1)
Post by: Mike Shawaluk on 2018-05-21 11:31 pm
Just a quick note, you probably know you can hide accidental signs by hitting 7, 8 or 9 a second time.
Well, sure, but that's not really "hiding" the accidentals, it's removing them. Which is fine if you are only worried about the score looking right, but if you remove them, it probably won't play correctly anymore.
Title: Re: Breve.test (0.1)
Post by: Rick G. on 2018-05-22 12:17 am
Well, sure, but that's not really "hiding" the accidentals, it's removing them.
If you just want to hide one, try this:
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.751,Single)
|Note|Dur:4th,Grace|Pos:b0|Opts:Muted|Visibility:Never
|Note|Dur:4th|Pos:0
!NoteWorthyComposerClip-End
Title: Re: Breve.hmm (0.6)
Post by: hmmueller on 2022-04-27 06:28 pm
Version 0.6 shows some more or less explanatory symbols if the subsequent semibreves (whole notes) are missing or dont have blank heads; I, as the author, was astonished when "nothing" was visible (and, of course, too lazy to read the help text). Maybe this helps to trigger someone using this and seeing nothing to look in the help ...

H.M.
Title: Re: Breve.hmm (0.6)
Post by: GrahamH on 2022-05-31 06:07 pm
Hi
I've just been using the Breve object plugin for the first time - and it seems to work very nicely for notes that are on the stave.
But for notes on a leger line (Middle C in particular) the right hand end of the leger line is missing!
This is with the default (round) notehead and happens with both single and double bars.
Am I doing something wrong?
Graham
Title: Re: Breve.hmm (0.6)
Post by: hmmueller on 2022-05-31 09:41 pm
No...o - it sees very much that I (my code) does something wrong (or not at all). I have to check why I overlooked this ... I'll be back.

H.M.