PLUGIN-DEV: plugin suggestions

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

PLUGIN-DEV: plugin suggestions

renema
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: PLUGIN-DEV: plugin suggestions

Ian Cugley
Neither of these is intrinsically difficult — I wrote a plug-in for Sibelius 2 which would do the first, and Sibelius makes a fair fist of the second.  Life is much much easier now that manuScript can create and destroy tuplet objects (though I've never got round to updating my own plug-ins, which did the job to my satisfaction). 
 
Have a go — you might find you're more clever than you thought
 
----- Original Message -----
Sent: Thursday, September 24, 2009 9:31 PM
Subject: PLUGIN-DEV: plugin suggestions

Hello,
 
I have two plugin ideas suggestions; for the moment they are too difficult for me to do, but somebody possibly could be interested:
 
Reply | Threaded
Open this post in threaded view
|

PLUGIN-DEV: Possibly useful code: Hide Page Numbers

Bob Zawalich
In reply to this post by renema

Someone on the tech support chat page mentioned hiding page numbers in a score. There is nothing I know of published that does this, but I have had some code for a while that will hide the page numbers in a score, and I thought I would offer it up as public domain code. Feel free to use it if you like. It needs Sib 6 to run.

 

Note that the plugin will not hide the page number on page 1 if it is visible (it can’t). Fortunately, most scores are set up by default to hide page number 1, and so it is usually not a problem.

 

Since at least Sib 5, page numbering is controlled by page number changes (PNCs). Page number changes are unusual in that they are not Bar Object objects. You cannot find or delete them by using for each…Instead, you need to look for them using bar.GetPageNumber and then delete them with bar.DeletePageNumber.

 

So HidePageNumbers has 2 jobs. The first is to find any Page Number Changes and delete them. The second is to add a page number change to hide the page numbers.

 

Note that it is possible to open a score, hide the page numbers, print the score, and then close the score without saving, so the page numbers can be removed temporarily. One can also use similar techniques to set up page numbering for a series of scores, as for printing a series of scores in a single job. (Though the lack of ability to change page 1 kind of puts a damper on that sort of process).

 

So if you look at the code, you see that it finds any page number changes, including those on blank pages.  It builds a pseudo array of bars and a corresponding array of page offsets, and then deletes from the list. You could probably use the new SparseArrays for this, but I am comfortable with the pseudo arrays, so this is how I did it.

 

Adding a page number change is also a bit tricky. Note 2 things: a page number change applies to the *following* bar, and adding a page number change forces a page break at the point where the change is added. So you cannot add a PNC to the start of the score, which is why you cannot hide page 1. (And I have confirmed with Daniel that there is no way to do it).

 

To avoid an unwanted page break, I put the page number change in the last bar of the first page. So there is now a page break, but it is at the same point where the page broke anyway, and so is at least functionally invisible, and this works great especially if you close without saving.

 

How do you find the last bar on the first page? You can use the new (Sib 6) code that tells you what page a bar is on. I am sure you can write simpler code than I am using to do this, but I had already written a routine that created an array indexed by bar number that told the bar’s position on the page. It handles things like knowing that the last bar on the only page is a last bar, without waiting to see if you got a first bar on the next page. So I used that and wrote a helper function to find the last bar on a page, so that is what GetBarPosStaffPage and GetLastBarOnPage do.

 

So once you find the last bar on page 1, you add a PNC there, set it to be page 2, and then set it up to hide the page number.

 

So that’s it. I hope someone will find it to be useful.

 

Bob

 


HidePageNumbers.zip (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PLUGIN-DEV: Possibly useful code: Hide Page Numbers

musictranscriber
Thanks Bob,
   I'm sure everyone will find that useful. I know personally I like to dabble with those parameters, nice to see a more intensive workup on it.

Regards,
The Music Transcriber
Roman Molino Dunn
http://www.musictranscriber.xbuild.com
http://www.musictranscriber.xbuild.com/plugin-store
610-392-4807

--- On Thu, 11/19/09, Bob Zawalich <[hidden email]> wrote:

From: Bob Zawalich <[hidden email]>
Subject: PLUGIN-DEV: Possibly useful code: Hide Page Numbers
To: [hidden email]
Date: Thursday, November 19, 2009, 7:54 PM

Someone on the tech support chat page mentioned hiding page numbers in a score. There is nothing I know of published that does this, but I have had some code for a while that will hide the page numbers in a score, and I thought I would offer it up as public domain code. Feel free to use it if you like. It needs Sib 6 to run.

 

Note that the plugin will not hide the page number on page 1 if it is visible (it can’t). Fortunately, most scores are set up by default to hide page number 1, and so it is usually not a problem.

 

Since at least Sib 5, page numbering is controlled by page number changes (PNCs). Page number changes are unusual in that they are not Bar Object objects. You cannot find or delete them by using for each…Instead, you need to look for them using bar.GetPageNumber and then delete them with bar.DeletePageNumber.

 

So HidePageNumbers has 2 jobs. The first is to find any Page Number Changes and delete them. The second is to add a page number change to hide the page numbers.

 

Note that it is possible to open a score, hide the page numbers, print the score, and then close the score without saving, so the page numbers can be removed temporarily. One can also use similar techniques to set up page numbering for a series of scores, as for printing a series of scores in a single job. (Though the lack of ability to change page 1 kind of puts a damper on that sort of process).

 

So if you look at the code, you see that it finds any page number changes, including those on blank pages.  It builds a pseudo array of bars and a corresponding array of page offsets, and then deletes from the list. You could probably use the new SparseArrays for this, but I am comfortable with the pseudo arrays, so this is how I did it.

 

Adding a page number change is also a bit tricky. Note 2 things: a page number change applies to the *following* bar, and adding a page number change forces a page break at the point where the change is added. So you cannot add a PNC to the start of the score, which is why you cannot hide page 1. (And I have confirmed with Daniel that there is no way to do it).

 

To avoid an unwanted page break, I put the page number change in the last bar of the first page. So there is now a page break, but it is at the same point where the page broke anyway, and so is at least functionally invisible, and this works great especially if you close without saving.

 

How do you find the last bar on the first page? You can use the new (Sib 6) code that tells you what page a bar is on. I am sure you can write simpler code than I am using to do this, but I had already written a routine that created an array indexed by bar number that told the bar’s position on the page. It handles things like knowing that the last bar on the only page is a last bar, without waiting to see if you got a first bar on the next page. So I used that and wrote a helper function to find the last bar on a page, so that is what GetBarPosStaffPage and GetLastBarOnPage do.

 

So once you find the last bar on page 1, you add a PNC there, set it to be page 2, and then set it up to hide the page number.

 

So that’s it. I hope someone will find it to be useful.

 

Bob

 


Reply | Threaded
Open this post in threaded view
|

PLUGIN-DEV: what objects can be legally in the system staff?

Bob Zawalich
In reply to this post by Bob Zawalich

I am looking at a plugin to clear staff objects out of the system staff. These should not have gotten there, but converters and plugins can put them there.

 

To do this I need to know which kinds of bar objects are legal in the system staff. I have identified all these object types as valid:

 

 

SystemTextItem

SystemSymbolItem

TimeSignature

KeySignature (not IsOneStaffOnly)

SpecialBarline

RehearsalMark

 

RepeatTimeLine (all system lines appear to be one of these types)

RitardLine

 

 

Can anyone think of any that I have missed?

 

 

Thanks

 

bob

Reply | Threaded
Open this post in threaded view
|

PLUGIN-DEV: RE: what objects can be legally in the system staff?

Bob Zawalich
In reply to this post by Bob Zawalich

As far as I can tell, Bar Number changes also live in the system staff, but neither Page Number changes nor Hit Points nor Live Tempo Tap points are bar objects that normally live in the system staff.

 

(Anyone at Sib reading this and can confirm?)

 

bob

 


From: Bob Zawalich [mailto:[hidden email]]
Sent: Wednesday, December 30, 2009 9:58 AM
To: '[hidden email]'
Subject: what objects can be legally in the system staff?

 

I am looking at a plugin to clear staff objects out of the system staff. These should not have gotten there, but converters and plugins can put them there.

 

To do this I need to know which kinds of bar objects are legal in the system staff. I have identified all these object types as valid:

 

 

SystemTextItem

SystemSymbolItem

TimeSignature

KeySignature (not IsOneStaffOnly)

SpecialBarline

RehearsalMark

 

RepeatTimeLine (all system lines appear to be one of these types)

RitardLine

 

 

Can anyone think of any that I have missed?

 

 

Thanks

 

bob