PLUGIN-DEV: Adding notes which cross barlines

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

PLUGIN-DEV: Adding notes which cross barlines

Peter Aschbacher
Hi,

when trying to add a note to a bar with Staff.AddNote which does not fit
anymore in the bar (barposition + notelength > barlength) Sibelius crashes.

What is your strategy to avoid this? Do you make possibly complex
calculations to get the remaining space in the bar, then add a tied note
with the length of the remaining space of the bar and then add the
remaining part of the note to the next bar? Or is there a more simple or
even semi-automatic method to do this?

Kind regards,
Peter Aschbacher

Reply | Threaded
Open this post in threaded view
|

Re: PLUGIN-DEV: Adding notes which cross barlines

Hans-Christoph Wirth
Peter Aschbacher wrote:
> Hi,
>
> when trying to add a note to a bar with Staff.AddNote which does not fit
> anymore in the bar (barposition + notelength > barlength) Sibelius crashes.

Staff.* routines had their problems back in time.  Many have been fixed
since then.  First I'd try to use the corresponding Bar.* routines and
see whether that works better.

I think I have experimented with this and the worst I could produce were
shortenend notes but no reproducable crashes.


Reply | Threaded
Open this post in threaded view
|

RE: PLUGIN-DEV: Adding notes which cross barlines

Bob Zawalich
I agree with Hans-Christoph that the Staff level methods have been
problematic; I virtually never use them.

For bar.Add... routines I generally test to see if notes will fit in the bar
and whether a specific duration can be created with a single note or a
series of tied notes. It is, as one might expect, pretty tedious.

-----Original Message-----
From: Majordomo Pseudo User [mailto:[hidden email]] On Behalf Of
Hans-Christoph Wirth
Sent: Friday, September 18, 2009 4:23 PM
To: [hidden email]
Subject: Re: PLUGIN-DEV: Adding notes which cross barlines

Peter Aschbacher wrote:
> Hi,
>
> when trying to add a note to a bar with Staff.AddNote which does not fit
> anymore in the bar (barposition + notelength > barlength) Sibelius
crashes.

Staff.* routines had their problems back in time.  Many have been fixed
since then.  First I'd try to use the corresponding Bar.* routines and
see whether that works better.

I think I have experimented with this and the worst I could produce were
shortenend notes but no reproducable crashes.



Reply | Threaded
Open this post in threaded view
|

RE: PLUGIN-DEV: Adding notes which cross barlines

musictranscriber
Hey coders,
     I wrote a little ago, but it was 'embedded' ( :) ) in my main message... 

I have a 103 controls in my dialog and on Mac only 98 will show up when I run the plugin, yet when I run it on Windows Vista, all my controls show up. I remember Bob writing about the number of controls acceptable within a dialog when he was updating the Edit Instrument Names plugin, but I can't quite recall his findings. Does anyone know the limit of controls, and, also, why the limit seems to be different on Mac versus Windows? I'm sure you ran across this Bob but was wondering if anything changed in Sib. 6 (it seems to since I haven't found a real limit in Sib 6). 

Post Scriptum, this was in regards to making a very thorough settings dialog for Stefan's articulation proof-reading plugin suggestion. I really like having a dialog with all the settings as opposed to having additional dialogs called for each articulation or having a dynamic dialog (although it seems I may have to use that approach once again to work with in the MS bounds). Otherwise, It is working great aside from my dialog. 

Thanks for the help, and wanted to mention how great it is all the activity we have been having on the developers mailing list. Makes for a good day to not be working on plugins alone :) a great joy.

post post scriptum, any other MS programmers live in NYC?

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

--- On Fri, 9/18/09, Bob Zawalich <[hidden email]> wrote:

From: Bob Zawalich <[hidden email]>
Subject: RE: PLUGIN-DEV: Adding notes which cross barlines
To: [hidden email]
Date: Friday, September 18, 2009, 9:20 PM

I agree with Hans-Christoph that the Staff level methods have been
problematic; I virtually never use them.

For bar.Add... routines I generally test to see if notes will fit in the bar
and whether a specific duration can be created with a single note or a
series of tied notes. It is, as one might expect, pretty tedious.

-----Original Message-----
From: Majordomo Pseudo User [mailto:majordom@...] On Behalf Of
Hans-Christoph Wirth
Sent: Friday, September 18, 2009 4:23 PM
To: plugin-dev@...
Subject: Re: PLUGIN-DEV: Adding notes which cross barlines

Peter Aschbacher wrote:
> Hi,
>
> when trying to add a note to a bar with Staff.AddNote which does not fit
> anymore in the bar (barposition + notelength > barlength) Sibelius
crashes.

Staff.* routines had their problems back in time.  Many have been fixed
since then.  First I'd try to use the corresponding Bar.* routines and
see whether that works better.

I think I have experimented with this and the worst I could produce were
shortenend notes but no reproducable crashes.




Reply | Threaded
Open this post in threaded view
|

RE: PLUGIN-DEV: Adding notes which cross barlines

Bob Zawalich

There was definitely a limit of 100 controls in the dialog editor, and I believe that was going to be doubled to 200 in Sib 6. When I mentioned this to the guys at Sibelius, they thought that you could have more controls if you added them in an external text editor, but maybe not. I think that I had reduced my dialog to 99 controls, and have not really looked at it on a Mac (Edit Instrument Names was the plugin) to be sure that they all got there.  I always define my active controls before the text controls, so at worst if it overflowed it would lose a couple of text fields.

 

(I just fired up my Mac and looked at Edit Instrument Names in 6.01, and the 99th control is visible, so I guess the fixes did get in).

 

Also up to Sib 6 it was not possible to use the plugin dialog editor to set the control order for more than about 30 controls without it tossing away some controls. I think they were also going to fix that in Sib 6 but I don’t think I have done anything recently with more than 30 controls to check. I tend not to use so many controls if I can avoid it, but sometimes you do need to process a lot of data in a dialog.

 

So they were definitely talking about fixing these limits for Sib 6, but I really don’t remember checking to see if the changes were made.

 

If you can get more than 100 controls in the dialog editor and Set Creation Order works, then the fixes did make it. Of course you can’t try that on a Mac…

 

Bob

 


From: Majordomo Pseudo User [mailto:[hidden email]] On Behalf Of Transcriber OfMusic
Sent: Friday, September 18, 2009 11:37 PM
To: [hidden email]
Subject: RE: PLUGIN-DEV: Adding notes which cross barlines

 

Hey coders,

     I wrote a little ago, but it was 'embedded' ( :) ) in my main message... 

 

I have a 103 controls in my dialog and on Mac only 98 will show up when I run the plugin, yet when I run it on Windows Vista, all my controls show up. I remember Bob writing about the number of controls acceptable within a dialog when he was updating the Edit Instrument Names plugin, but I can't quite recall his findings. Does anyone know the limit of controls, and, also, why the limit seems to be different on Mac versus Windows? I'm sure you ran across this Bob but was wondering if anything changed in Sib. 6 (it seems to since I haven't found a real limit in Sib 6). 

 

Post Scriptum, this was in regards to making a very thorough settings dialog for Stefan's articulation proof-reading plugin suggestion. I really like having a dialog with all the settings as opposed to having additional dialogs called for each articulation or having a dynamic dialog (although it seems I may have to use that approach once again to work with in the MS bounds). Otherwise, It is working great aside from my dialog. 

 

Thanks for the help, and wanted to mention how great it is all the activity we have been having on the developers mailing list. Makes for a good day to not be working on plugins alone :) a great joy.

 

post post scriptum, any other MS programmers live in NYC?

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

--- On Fri, 9/18/09, Bob Zawalich <[hidden email]> wrote:


From: Bob Zawalich <[hidden email]>
Subject: RE: PLUGIN-DEV: Adding notes which cross barlines
To: [hidden email]
Date: Friday, September 18, 2009, 9:20 PM

I agree with Hans-Christoph that the Staff level methods have been
problematic; I virtually never use them.

For bar.Add... routines I generally test to see if notes will fit in the bar
and whether a specific duration can be created with a single note or a
series of tied notes. It is, as one might expect, pretty tedious.

-----Original Message-----
From: Majordomo Pseudo User [mailto:majordom@...] On Behalf Of
Hans-Christoph Wirth
Sent: Friday, September 18, 2009 4:23 PM
To: plugin-dev@...
Subject: Re: PLUGIN-DEV: Adding notes which cross barlines

Peter Aschbacher wrote:
> Hi,
>
> when trying to add a note to a bar with Staff.AddNote which does not fit
> anymore in the bar (barposition + notelength > barlength) Sibelius
crashes.

Staff.* routines had their problems back in time.  Many have been fixed
since then.  First I'd try to use the corresponding Bar.* routines and
see whether that works better.

I think I have experimented with this and the worst I could produce were
shortenend notes but no reproducable crashes.


 

Reply | Threaded
Open this post in threaded view
|

Re: RE: PLUGIN-DEV: Adding notes which cross barlines

Peter Aschbacher
In reply to this post by Bob Zawalich
Bob,

thank you for the hint. The next time I will use bar.Add.

Kind regards,
Peter Aschbacher

Bob Zawalich schrieb:
I agree with Hans-Christoph that the Staff level methods have been
problematic; I virtually never use them.

For bar.Add... routines I generally test to see if notes will fit in the bar
and whether a specific duration can be created with a single note or a
series of tied notes. It is, as one might expect, pretty tedious.

-----Original Message-----
From: Majordomo Pseudo User [[hidden email]] On Behalf Of
Hans-Christoph Wirth
Sent: Friday, September 18, 2009 4:23 PM
To: [hidden email]
Subject: Re: PLUGIN-DEV: Adding notes which cross barlines

Peter Aschbacher wrote:
  
Hi,

when trying to add a note to a bar with Staff.AddNote which does not fit
anymore in the bar (barposition + notelength > barlength) Sibelius
    
crashes.

Staff.* routines had their problems back in time.  Many have been fixed
since then.  First I'd try to use the corresponding Bar.* routines and
see whether that works better.

I think I have experimented with this and the worst I could produce were
shortenend notes but no reproducable crashes.




  
Reply | Threaded
Open this post in threaded view
|

PLUGIN-DEV: Beware the .Selected field for bars and noterests

Bob Zawalich-2
In reply to this post by Bob Zawalich

I have recently realized that I have been using the .Selected field incorrectly for bars and noterests. I had assumed that if any part of a bar was selected, then the bar would have .Selected = True. This is not the case.

 

For bars, (as documented!) .Selected is true only if the entire bar is selected. This appears to mean that it is a passage selection covering the entire bar. If, for example, you filter all the notes in the bar, that bar will not show up. Passage selections of parts of bars give .Selected = False.

 

If, though, you loop on

 

for each Bar b in selection

 

you will get every bar that contains anything that is selected.

 

Similarly, for NoteRests, I had naively assumed that if any notes in a noterest were selected, then .Selected would be true for a noterest. This is also not the case. Only noterests all of whose notes are selected will have .Selected = True.

 

Again,

 

for each NoteRest nr in selection

 

will give you all noterests that have any selected component.

 

This may have seemed obvious, but I have been caught by it, and now have to go back and find all the places I have used .Selected and make them work as I intended.

 

So hopefully you will not have to do that too.

 

I have test plugins that demonstrate this, if anyone is interested.

 

Bob