NoteWorthy Composer Forum

Forums => Tips & Tricks => Object Plugins => Topic started by: Mike Shawaluk on 2015-05-05 11:24 pm

Title: Slur.ms (2.1)
Post by: Mike Shawaluk on 2015-05-05 11:24 pm
This object can be used to draw slurs of various types and shapes. Here are its properties:

Note Span: Number of notes to span. Default = 2
Line Type: Type of line (solid, dash, dot). Default = solid
Direction: Direction of slur (Default, Upward, Downward). Default = 'Default', which uses the starting note's Slur Direction property.
Start Offset X:
Start Offset Y:
Used to adjust the starting point of the slur. Each coordinate is between -100 and 100. Default = 0, 0
End Offset X:
End Offset Y:
Same as above, except for the ending point of the slur.
Strength: Strength of the curve; a positive value between 0 and 100. Default = 1
Balance: Left/right balance of the curve's shape; a value between -0.5 and 0.5. Default = 0 (center)

To add a slur to your score, position the cursor immediately before the note where you want the slur to start, and insert the object.

The following keys can be used to interactively adjust various parameters, while the Slur object marker is selected:

Please note that the slur object is ornamental only, and has no effect on note playback or lyric placement.

Following are a few notes on its usage:
Title: Re: Slur.ms (version 0.96)
Post by: Mike Shawaluk on 2015-08-02 09:06 pm
The Slur.ms user object has been updated, with the following changes:


Please refer to the parent post for a description of the available parameters.

As always, feedback and suggestions are greatly appreciated.

Mike
Title: Re: Slur.ms (version 1.0)
Post by: Mike Shawaluk on 2015-10-15 01:13 pm
It feels funny to be posting a bug report on my own object, but this is a sort of "heads up" to let people know that I may be making a fix soon, that could affect how slurs behave in other peoples' scores.

I've noticed that the default end point positions for certain types of notes are not "optimal". Generally, this happens with chords that have adjacent noteheads, both for normal and split-voice chords. It is most noticeable when the slur direction is explicitly set to Upward or Downward. Following is a clip that demonstrates both correct and incorrect placement.

There is logic in the object to detect the stem and slur directions of the starting and ending notes, that attempts to determine the best default end point placement. However, that logic isn't working correctly for the note types mentioned, so the user needs to use the start and end offset values to correct things.

I could leave the object as is, and let users adjust the slurs manually in these circumstances, but that doesn't seem like the correct course of action to me. However, I realize that if I change any of the rules, then users who have already tweaked slurs to look correct for these situation may need to "untweak/retweak" them.

If you use this object and have any feedback, comments or suggestions, I'd very much appreciate them.

Thanks,
Mike
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.75,Single)
|User|Slur.ms|Pos:-1
|User|Slur.ms|Pos:0|Dir:Downward
|Chord|Dur:4th|Pos:-1,0|Opts:Stem=Down
|Chord|Dur:4th|Pos:1,2|Opts:Stem=Down
|User|Slur.ms|Pos:1|Dir:Downward
|User|Slur.ms|Pos:-1
|Chord|Dur:4th|Pos:3|Opts:Stem=Up|Dur2:4th|Pos2:2
|Chord|Dur:4th|Pos:0|Opts:Stem=Down|Dur2:4th|Pos2:1
!NoteWorthyComposerClip-End
Title: Re: Slur.ms (version 1.0)
Post by: Peter Edwards on 2015-10-15 03:08 pm
I think the end result of the clip should be as below.
Two points:
Notes on a single stem should only have one slur, but in this instance the slur ending needs to be extended by one unit – in other words: where you would expect it to be with or without the extra notes. (But this is not the case for an upward stem :( )
In the second pair, obviously the slur shouldn't cross the stem.

FWIW I'd make the changes  ;)

Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.75,Single)
|User|Slur.ms|Pos:-1|EndOffsetX:1
|Chord|Dur:4th|Pos:-1,0|Opts:Stem=Down
|Chord|Dur:4th|Pos:1,2|Opts:Stem=Down
|User|Slur.ms|Pos:1|Dir:Downward|StartOffsetX:1
|User|Slur.ms|Pos:-1
|Chord|Dur:4th|Pos:3|Opts:Stem=Up|Dur2:4th|Pos2:2
|Chord|Dur:4th|Pos:0|Opts:Stem=Down|Dur2:4th|Pos2:1
!NoteWorthyComposerClip-End
Title: Re: Slur.ms (version 1.0)
Post by: Mike Shawaluk on 2015-10-15 04:03 pm
I think the end result of the clip should be as below.
Two points:
Notes on a single stem should only have one slur, but in this instance the slur ending needs to be extended by one unit – in other words: where you would expect it to be with or without the extra notes. (But this is not the case for an upward stem :( )
In the second pair, obviously the slur shouldn't cross the stem.

FWIW I'd make the changes  ;)

Thanks for the feedback and examples, Peter. One change I would make to your first slur is to move the left end point so it is over the "strong" stem side notehead. I.e. so it displays the same as a native slur. The main change I plan to make to the logic is to correctly detect strong vs. weak stem side note heads, which NWC already does correctly for native slurs. In general, the slurs created by Slur.ms should look identical to native NWC slurs when on the notehead side, and should be almost the same on the stem side (I tend to choose to place the vertical location closer to the notehead by default).

Thanks again,
Mike
Title: Re: Slur.ms (1.1)
Post by: Mike Shawaluk on 2015-10-17 05:21 pm
The Slur.ms user object has been updated, with the following changes:


Please refer to the parent post for a description of the available parameters.
Title: Re: Slur.ms (1.1)
Post by: hmmueller on 2015-11-16 10:18 am
When I copied a "slur" object (ctrl-C, ctrl-V) to another position, I got the error

Slur.ms.nwcuser.lua:110: attempt to perform arithmetic on local 'x2' (a nil value)

in the "Alert Log."
(Moreover, I had to copy this text manually - it seems that it is not possible to copy-paste from the Alert Log :( )

Regards
Harald M.
Title: Re: Slur.ms (1.1)
Post by: NoteWorthy Online on 2015-11-16 10:50 am
it seems that it is not possible to copy-paste from the Alert Log :( )

When in doubt, always try right click...
Title: Re: Slur.ms (1.1)
Post by: hmmueller on 2015-11-16 11:12 am
Thx :) - learned something ...
Title: Re: Slur.ms (1.1)
Post by: Mike Shawaluk on 2015-11-16 12:10 pm
When I copied a "slur" object (ctrl-C, ctrl-V) to another position, I got the error

Slur.ms.nwcuser.lua:110: attempt to perform arithmetic on local 'x2' (a nil value)

in the "Alert Log."
(Moreover, I had to copy this text manually - it seems that it is not possible to copy-paste from the Alert Log :( )

Regards
Harald M.

Hello Harald,

Are you able to reproduce this error consistently? It seems to be very sporadic; I have gotten it to happen once after doing many copy operations, but now I can't make it occur again. It would help if you tell me what kind of notes were at the destination site (where you were copying the slur object). I am pretty sure I know the cause of the error, but I want to make sure the error won't occur once I put a fix in place.

Never mind, I can reproduce it now. Working on a fix.

Thanks,
Mike
Title: Re: Slur.ms (1.1)
Post by: NoteWorthy Online on 2015-11-16 12:15 pm
Are you able to reproduce this error consistently?

If the end of the span is a Rest, then this error will always occur. It is caused by:

Code: (lua) [Select · Download]
local x2 = endNote:xyStemAnchor(endStem)
Title: Re: Slur.ms (1.1)
Post by: Mike Shawaluk on 2015-11-16 12:34 pm
If the end of the span is a Rest, then this error will always occur. It is caused by:

Code: (lua) [Select · Download]
local x2 = endNote:xyStemAnchor(endStem)
It will also happen if the first "note" is a rest. (but it errors on the previous line, due to the x1 assignment)

I am surprised it took this long for someone to discover this.
Title: Re: Slur.ms (1.2)
Post by: Mike Shawaluk on 2015-11-16 09:04 pm
The Slur.ms user object has been updated, with the following changes:


Please refer to the parent post for a description of the available parameters.

Mike
Title: Re: Slur.ms (1.3)
Post by: Mike Shawaluk on 2015-11-27 05:40 am
The Slur.ms user object has been updated, with the following changes:


In addition to the new parameter, I have added an experimental "interactive parameter adjustment" mode, using the object's right-click menu and the + and - "spin" keys. Saying more would spoil the fun - try it out and let me know what you think.

Mike
Title: Re: Slur.ms (1.3)
Post by: Richard Woodroffe on 2015-11-27 07:57 am
Great update Mike.  Being able to make the Noteworthy slur invisible and then adding a "Slur.ms slur"  gives the best of all options for shaping, style, playback and lyric control.

Title: Re: Slur.ms (1.3)
Post by: Flurmy on 2015-11-27 08:39 am
Kudos to Mike!
But, call me insatiable, I long for when the native slurs will have that flexibility.
Having to hide the "real" slur (or maybe substituting it with a hidden "legato" and ending them with "semplice"), then adding the slur object and adjusting it as needed each time is quite cumbersome. I'll do it just in case of "emergency".
Eric?
Title: Re: Slur.ms (1.3)
Post by: NoteWorthy Online on 2015-11-27 03:28 pm
Demo video of this new menu:

https://youtu.be/Zwdz9of2RqY
Title: Re: Slur.ms (1.5)
Post by: Mike Shawaluk on 2015-11-28 04:25 am
The Slur.ms user object has been updated, with the following changes:


Mike
Title: Re: Slur.ms (1.6)
Post by: Mike Shawaluk on 2015-12-04 03:08 pm
The Slur.ms user object has been updated, with the following changes:


Mike
Title: Re: Slur.ms (1.6)
Post by: hmmueller on 2016-03-17 10:35 am
Hi Mike, all -

what is the "best practice" regarding long slurs that possibly/probably/certainly will go over (automatic) line breaks?

The (IMHO) greatest feature of NWC is that one does in general nothing to get acceptable line breaks. This is a wonderful thing that makes work much easier for many typical "internal use scores". NWC's slurs work nicely over such automatic line and page breaks - the slur plugin, as far as I can see, does not (yet?) support continuing of slurs after a break. I would not want to add new slur objects exactly at (after) each break, especially as I usually create different printouts from one score with different breaks. Is there something I'm supposed to do instead?

(Ah - of course: Use the slur object only for slurs not going over a bar boundary ... makes them somewhat less usable than they could be - especially as the NWC slurs are not that beautifully bowed when long).

Thanks!
Harald

Title: Re: Slur.ms (1.6)
Post by: hmmueller on 2016-03-17 10:39 am
I just saw this:
... Being able to make the Noteworthy slur invisible and then adding a "Slur.ms slur"  gives the best of all options for shaping, style, playback and lyric control.

I do not know a way to "make the Noteworthy slur invisible" - how would that work?

Thanks!
Harald
Title: Re: Slur.ms (1.6)
Post by: Mike Shawaluk on 2016-03-17 10:55 am
Hi Mike, all -

what is the "best practice" regarding long slurs that possibly/probably/certainly will go over (automatic) line breaks?

The (IMHO) greatest feature of NWC is that one does in general nothing to get acceptable line breaks. This is a wonderful thing that makes work much easier for many typical "internal use scores". NWC's slurs work nicely over such automatic line and page breaks - the slur plugin, as far as I can see, does not (yet?) support continuing of slurs after a break. I would not want to add new slur objects exactly at (after) each break, especially as I usually create different printouts from one score with different breaks. Is there something I'm supposed to do instead?
I am currently working on a way to allow Slur.ms and SlurCubic.ms to span systems, based on suggestions I've gotten from Eric. The programming is a bit tricky (at least to me) so stay tuned while I work out the kinks.

Thanks,
Mike
Title: Re: Slur.ms (1.6)
Post by: Mike Shawaluk on 2016-03-17 10:58 am
I just saw this:
... Being able to make the Noteworthy slur invisible and then adding a "Slur.ms slur"  gives the best of all options for shaping, style, playback and lyric control.
I do not know a way to "make the Noteworthy slur invisible" - how would that work?
Thanks!
Harald
To make a native slur invisible, insert a Marker before the first note of the slur, and set the Visibility of the Marker to "Never".
Title: Re: Slur.ms (1.6)
Post by: hmmueller on 2016-03-17 12:15 pm
Thank you! ... ... and thank you!!
Harald
Title: Re: Slur.ms (1.6)
Post by: Warren Porter on 2016-03-20 06:41 pm
In creating a "muted, displayed" staff, I had a trilled half-note slured into a pair of graced 16ths that did not slur into the following measure.  The tool did exactly what was needed.  :)
Title: Re: Slur.ms (1.6)
Post by: Mike Shawaluk on 2017-08-28 09:51 pm
The Slur.ms user object has been updated for version 2.75a, with the following changes:

Title: Re: Slur.ms (2.1)
Post by: SEBC on 2018-03-09 08:40 pm
Hi Mike
I was trying to work with the slur today but having trouble because when I removed the nwc slur then the lyrics got messed up. Can you talk me through the process? Was I doing it wrong?

Title: Re: Slur.ms (2.1)
Post by: Rick G. on 2018-03-09 08:52 pm
when I removed the nwc slur then the lyrics got messed up.
One solution is to keep the slur and hide it with a Marker.
Code: (nwc) [Select · Download]
!NoteWorthyComposer(2.751)
|AddStaff|Name:"Staff"
|StaffProperties|EndingBar:Open (hidden)|BoundaryBottom:16
|Lyrics|Align:Standard Rules
|Lyric1|Text:"a b\n"
|Marker|Pos:0|Visibility:Never
|Note|Dur:4th,Slur|Pos:0
|Note|Dur:4th|Pos:1
|Note|Dur:4th|Pos:2
!NoteWorthyComposer-End
Title: Re: Slur.ms (2.1)
Post by: Mike Shawaluk on 2018-03-09 09:11 pm
@Rick G. is spot on as usual. If you want to replace a native slur with an object slur, you will usually want to hide the native one as per Rick's example, since the object version doesn't affect playback or lyric placement as a native slur does.
Title: Re: Slur.ms (2.1)
Post by: SEBC on 2018-03-09 09:33 pm
Ok. Thanks.

I always forget about the marker. What else can it do? I think I used it once to hide a troublesome triplet marking...
Title: Re: Slur.ms (2.1)
Post by: Mike Shawaluk on 2018-03-09 11:18 pm
Ok. Thanks.

I always forget about the marker. What else can it do? I think I used it once to hide a troublesome triplet marking...
Besides visibility and color, it can also be used to adjust the vertical positions of slurs, triplets and articulations. There is a bit more description of its uses here (https://noteworthycomposer.com/hh/nwc2/MNU_ADDMARKER.htm).
Title: Re: Slur.ms (1.6)
Post by: Opagust on 2021-06-30 09:15 pm
I am currently working on a way to allow Slur.ms and SlurCubic.ms to span systems, based on suggestions I've gotten from Eric. The programming is a bit tricky (at least to me) so stay tuned while I work out the kinks.

Thanks,
Mike

Hello Mike,
Did you ever found a way to fix that?

Title: Re: Slur.ms (1.6)
Post by: Mike Shawaluk on 2021-07-01 12:01 am
Hello Mike,
Did you ever found a way to fix that?
It's hard to believe that I wrote that message 5 years ago...  The short answer is "not yet".  One of the tricky parts about a spanned slur is that there needs to be a way to specify the slur endpoints at each end of the span. Given that the slur objects are visual only, it seems easier to just notate them as two slurs.

As part of my research, I recall that there may have been something along the lines of "perhaps there will be a mechanism in NWC (next version) to make this easier". But we know where that topic leads.

Sorry I don't have better news.
Title: Re: Slur.ms (2.1)
Post by: Opagust on 2021-07-01 08:49 pm
OK, I can live with that.

The reason I asked is that I'm writing a tool to convert MusxXML files to NWC. 'Nested' slurs are not provided in NWC itself, but can be done with your user object. So I planned to use that object for every slur, and then I ran into that problem while testing. So now I'm going to make the necessary adjustments to only use slur.ms in case of a slur within a slur. The chance that such a slur will cross a bar and a system break at the same time is very small, I think.

Keep up the good work!