Handles at the end of a staff

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Handles at the end of a staff

SimonNathan
Hi all,

Does anyone know if there's a way in manuscript to access the position of the handle just to the right of the end of a system, which you can use to shorten the system? I'm talking about the little guy to the right of bar 4 in the attached picture.

My aim is to make a plugin that automates the creation of an arrow to fill up the horizontal space created by moving one of these handles, as shown at the end of bar 12 in the attached picture. I spend way too much time doing this...!

Thanks so much,

Simon

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com

handle-ss.png (102K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Handles at the end of a staff

Bob Zawalich-3

Sorry, but I don’t think you can do this with a plugin.

 

There is no access to the handles at the end of the staff.

 

In addition, there is no way to know the amount of space between the end of the staff and the page margin. One can get the lengths of bars, but those are in rhythmic units, and one can drag a bar with the same rhythmic size to different physical sizes.

 

Being unable to know physical sizes, for staves and bars and text and lines, for example, is a definite limitation for doing layout with a plugin.

 

 

Bob

 

From: Plugin-dev [mailto:[hidden email]] On Behalf Of Simon Nathan
Sent: Friday, January 26, 2018 12:48 AM
To: A mailing list for Sibelius plug-in developers <[hidden email]>
Subject: [Plugin-dev] Handles at the end of a staff

 

Hi all,

 

Does anyone know if there's a way in manuscript to access the position of the handle just to the right of the end of a system, which you can use to shorten the system? I'm talking about the little guy to the right of bar 4 in the attached picture.

 

My aim is to make a plugin that automates the creation of an arrow to fill up the horizontal space created by moving one of these handles, as shown at the end of bar 12 in the attached picture. I spend way too much time doing this...!

 

Thanks so much,

 

Simon


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Handles at the end of a staff

Dave Foster
In reply to this post by SimonNathan
Hi Simon,

You can do this, but it’s not quite how you’d imagine… The value is actually controlled by the first bar of the system, and by setting the bar.GapAfter value. So you have to find the first bar (using NthBarInSystem), and set the value on that bar. Note that if you then subsequently
change the layout, then things will get screwed up - so if you were doing a universal system, you might want to reset all bars to 0 before then parsing for the bars that you want. Note that you can also use negative numbers to move the value to the right (positive values move it to the left).

Here’s some example code that moves all the lines in a score to the left by increasing amounts.

x = 10;
for each bar in Sibelius.ActiveScore.SystemStaff
{
        if (bar.NthBarInSystem = 0)
        {
                bar.GapAfter = x;
                x = x + 10;
        }
}

Now, whether or not you can accurately place and measure an arrow line to meet your ultimate criteria is another challenge!

Hope that helps,

Dave

> On 26 Jan 2018, at 08:47, Simon Nathan <[hidden email]> wrote:
>
> Hi all,
>
> Does anyone know if there's a way in manuscript to access the position of the handle just to the right of the end of a system, which you can use to shorten the system? I'm talking about the little guy to the right of bar 4 in the attached picture.
>
> My aim is to make a plugin that automates the creation of an arrow to fill up the horizontal space created by moving one of these handles, as shown at the end of bar 12 in the attached picture. I spend way too much time doing this...!
>
> Thanks so much,
>
> Simon
> <handle-ss.png>_______________________________________________
> Plugin-dev mailing list
> [hidden email]
> http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Handles at the end of a staff

SimonNathan
Thank you both for these great responses. I'll have a play with Dave's idea - great Sibelius inner knowledge there!

Cheers,

Simon

On 27 Jan 2018 13:23, "Dave Foster" <[hidden email]> wrote:
Hi Simon,

You can do this, but it’s not quite how you’d imagine… The value is actually controlled by the first bar of the system, and by setting the bar.GapAfter value. So you have to find the first bar (using NthBarInSystem), and set the value on that bar. Note that if you then subsequently
change the layout, then things will get screwed up - so if you were doing a universal system, you might want to reset all bars to 0 before then parsing for the bars that you want. Note that you can also use negative numbers to move the value to the right (positive values move it to the left).

Here’s some example code that moves all the lines in a score to the left by increasing amounts.

x = 10;
for each bar in Sibelius.ActiveScore.SystemStaff
{
        if (bar.NthBarInSystem = 0)
        {
                bar.GapAfter = x;
                x = x + 10;
        }
}

Now, whether or not you can accurately place and measure an arrow line to meet your ultimate criteria is another challenge!

Hope that helps,

Dave

> On 26 Jan 2018, at 08:47, Simon Nathan <[hidden email]> wrote:
>
> Hi all,
>
> Does anyone know if there's a way in manuscript to access the position of the handle just to the right of the end of a system, which you can use to shorten the system? I'm talking about the little guy to the right of bar 4 in the attached picture.
>
> My aim is to make a plugin that automates the creation of an arrow to fill up the horizontal space created by moving one of these handles, as shown at the end of bar 12 in the attached picture. I spend way too much time doing this...!
>
> Thanks so much,
>
> Simon
> <handle-ss.png>_______________________________________________
> Plugin-dev mailing list
> [hidden email]
> http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Handles at the end of a staff

Bob Zawalich-3
In reply to this post by Dave Foster
Cool, Dave. I forgot about GapAfter. In my plugin Gap Before Bar I had code to reset that value in addition to the Gap Before values but I commented it out because I saw no obvious use for it. GapBefore and GapAfter are available only in Sib 7.5 and later.

Pretty weird that the GapAfter field is set in the first bar on a system rather than the last, but that's how it goes.

I note that GapAfter is documented to be in units of Spaces, though I really suspect it is in 1/32 of a space, so check that before you use it. Spaces, like inches and mm, are "physical" units, rather than "rhythmic" units, so you have the same kind of problem using these as you do with using the Dx and Dy units; you can't tell the physical position or length of a bar and you have to experiment and mix and match to do anything useful with it.

(Note that Spaces are based on the current staff size, so you can look at the Convert Spaces to Units plugin to see how to convert spaces to mm or inches, but not to rhythmic units).

So I would still say that in the general case, you will not be able to tell where the end of the system is in physical space, just its offset from the default width. In the general case that is probably not good enough for a lot of things, but if you know that you will have scores set up a specific way, then you might be able to do something.

Lines, such as arrows, are positioned by rhythmic position, and their duration is a rhythmic position (in 1/256 of a quarter note units). You might be able to start it at the end of the last bar on a system (bar.Length), shift the Dy value so it went down to the middle of the staff, and Dx to be a little left of the barline, and choose an arbitrary duration. You could do this only if the first bar in the system has a non-zero GapAfter. Then you would only need to manually adjust the length of the line. Not full automation, but it would be better than adding them all by hand.

Changing Gap Before/After is problematic when a score is reformatted and such bars end up not at the start or end of a system. This is a common problem and the reason why I wrote Gap Before Bar.

Good luck, and thanks to Dave to thinking about that field.

Bob

-----Original Message-----
From: Plugin-dev [mailto:[hidden email]] On Behalf Of Dave Foster
Sent: Saturday, January 27, 2018 5:23 AM
To: A mailing list for Sibelius plug-in developers <[hidden email]>
Subject: Re: [Plugin-dev] Handles at the end of a staff

Hi Simon,

You can do this, but it’s not quite how you’d imagine… The value is actually controlled by the first bar of the system, and by setting the bar.GapAfter value. So you have to find the first bar (using NthBarInSystem), and set the value on that bar. Note that if you then subsequently change the layout, then things will get screwed up - so if you were doing a universal system, you might want to reset all bars to 0 before then parsing for the bars that you want. Note that you can also use negative numbers to move the value to the right (positive values move it to the left).

Here’s some example code that moves all the lines in a score to the left by increasing amounts.

x = 10;
for each bar in Sibelius.ActiveScore.SystemStaff {
        if (bar.NthBarInSystem = 0)
        {
                bar.GapAfter = x;
                x = x + 10;
        }
}

Now, whether or not you can accurately place and measure an arrow line to meet your ultimate criteria is another challenge!

Hope that helps,

Dave

> On 26 Jan 2018, at 08:47, Simon Nathan <[hidden email]> wrote:
>
> Hi all,
>
> Does anyone know if there's a way in manuscript to access the position of the handle just to the right of the end of a system, which you can use to shorten the system? I'm talking about the little guy to the right of bar 4 in the attached picture.
>
> My aim is to make a plugin that automates the creation of an arrow to fill up the horizontal space created by moving one of these handles, as shown at the end of bar 12 in the attached picture. I spend way too much time doing this...!
>
> Thanks so much,
>
> Simon
> <handle-ss.png>_______________________________________________
> Plugin-dev mailing list
> [hidden email]
> http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: Handles at the end of a staff

SimonNathan
I don't know if this is interesting to anyone, but following on from below where I was talking about making a plugin to extend an arrow across a gap at the end of the system, I did manage to do it using the Rhdx variable of the arrow line object, which allows you to position a line's length in spaces rather than in rhythmic units. Hope that's useful to some people!

Simon

On Sat, Jan 27, 2018 at 10:23 PM, Bob Zawalich <[hidden email]> wrote:
Cool, Dave. I forgot about GapAfter. In my plugin Gap Before Bar I had code to reset that value in addition to the Gap Before values but I commented it out because I saw no obvious use for it. GapBefore and GapAfter are available only in Sib 7.5 and later.

Pretty weird that the GapAfter field is set in the first bar on a system rather than the last, but that's how it goes.

I note that GapAfter is documented to be in units of Spaces, though I really suspect it is in 1/32 of a space, so check that before you use it. Spaces, like inches and mm, are "physical" units, rather than "rhythmic" units, so you have the same kind of problem using these as you do with using the Dx and Dy units; you can't tell the physical position or length of a bar and you have to experiment and mix and match to do anything useful with it.

(Note that Spaces are based on the current staff size, so you can look at the Convert Spaces to Units plugin to see how to convert spaces to mm or inches, but not to rhythmic units).

So I would still say that in the general case, you will not be able to tell where the end of the system is in physical space, just its offset from the default width. In the general case that is probably not good enough for a lot of things, but if you know that you will have scores set up a specific way, then you might be able to do something.

Lines, such as arrows, are positioned by rhythmic position, and their duration is a rhythmic position (in 1/256 of a quarter note units). You might be able to start it at the end of the last bar on a system (bar.Length), shift the Dy value so it went down to the middle of the staff, and Dx to be a little left of the barline, and choose an arbitrary duration. You could do this only if the first bar in the system has a non-zero GapAfter. Then you would only need to manually adjust the length of the line. Not full automation, but it would be better than adding them all by hand.

Changing Gap Before/After is problematic when a score is reformatted and such bars end up not at the start or end of a system. This is a common problem and the reason why I wrote Gap Before Bar.

Good luck, and thanks to Dave to thinking about that field.

Bob

-----Original Message-----
From: Plugin-dev [mailto:[hidden email]] On Behalf Of Dave Foster
Sent: Saturday, January 27, 2018 5:23 AM
To: A mailing list for Sibelius plug-in developers <[hidden email]>
Subject: Re: [Plugin-dev] Handles at the end of a staff

Hi Simon,

You can do this, but it’s not quite how you’d imagine… The value is actually controlled by the first bar of the system, and by setting the bar.GapAfter value. So you have to find the first bar (using NthBarInSystem), and set the value on that bar. Note that if you then subsequently change the layout, then things will get screwed up - so if you were doing a universal system, you might want to reset all bars to 0 before then parsing for the bars that you want. Note that you can also use negative numbers to move the value to the right (positive values move it to the left).

Here’s some example code that moves all the lines in a score to the left by increasing amounts.

x = 10;
for each bar in Sibelius.ActiveScore.SystemStaff {
        if (bar.NthBarInSystem = 0)
        {
                bar.GapAfter = x;
                x = x + 10;
        }
}

Now, whether or not you can accurately place and measure an arrow line to meet your ultimate criteria is another challenge!

Hope that helps,

Dave

> On 26 Jan 2018, at 08:47, Simon Nathan <[hidden email]> wrote:
>
> Hi all,
>
> Does anyone know if there's a way in manuscript to access the position of the handle just to the right of the end of a system, which you can use to shorten the system? I'm talking about the little guy to the right of bar 4 in the attached picture.
>
> My aim is to make a plugin that automates the creation of an arrow to fill up the horizontal space created by moving one of these handles, as shown at the end of bar 12 in the attached picture. I spend way too much time doing this...!
>
> Thanks so much,
>
> Simon
> <handle-ss.png>_______________________________________________
> Plugin-dev mailing list
> [hidden email]
> http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com