Skip to main content

Topic: WingedRepeats.fso (version 1.5) (Read 2633 times) previous topic - next topic

  • Lloyd
  • NWC2 User
WingedRepeats.fso (version 1.5)
This plugin draws winged Repeat Bars in the staff, just the same than Mike's (https://forum.noteworthycomposer.com/?topic=9264)

To start the plugin just insert an instance of the User Object at the beginning of the staff and it will automatically draw "wing" decorations to any Master Repeat Bar.

OPTIONS:
  • If you select "One Staff" the object will draw both up and down decorations. Selecting "System: Upper Staff" or "System: Lower Staff" will draw up or down decorations, respectively.
  • Length: This will set the length of the wing decoration.
  • Angle: This will set the angle of the wing decoration.
  • Thickness: This will set the thickness of the wing decoration.
  • When class is seet to 'Standard' the object will draw wings only once.  ← NEW

To start using this Object just copy the following clip and paste as a new file in NWC2.75.
Code: (nwc) [Select · Download]
!NoteWorthyComposer(2.75)
|AddStaff|Name:"Staff-1"|Group:"Standard"
|StaffProperties|EndingBar:Section Close|Visible:Y|BoundaryTop:12|BoundaryBottom:12|Lines:5|Color:Default
|StaffProperties|Muted:N|Volume:127|StereoPan:64|Device:0|Channel:1
|StaffInstrument|Trans:0|DynVel:10,30,45,60,75,92,108,127
|User|WingedRepeats.fso|Pos:1|Class:StaffSig
|Clef|Type:Treble
|TimeSig|Signature:4/4
|Bar|Style:MasterRepeatOpen
|Note|Dur:Half|Pos:1
|Note|Dur:Half|Pos:3
|Bar|Style:MasterRepeatClose
|Spacer|Width:50
|Bar|Style:MasterRepeatOpen
|Note|Dur:Half|Pos:3
|Note|Dur:Half|Pos:1
|Bar|Style:MasterRepeatClose
|Note|Dur:Half|Pos:1
|Note|Dur:Half|Pos:1
|AddStaff|Name:"Staff-2"|Group:"Standard"
|StaffProperties|EndingBar:Section Close|Visible:Y|BoundaryTop:10|BoundaryBottom:10|Lines:5|WithNextStaff:Brace,ConnectBars|Color:Default
|StaffProperties|Muted:N|Volume:127|StereoPan:64|Device:0|Channel:2
|StaffInstrument|Trans:0|DynVel:10,30,45,60,75,92,108,127
|User|WingedRepeats.fso|Pos:1|Class:StaffSig|System:"System: Upper Staff"
|Clef|Type:Treble
|TimeSig|Signature:4/4
|Bar|Style:MasterRepeatOpen
|Note|Dur:4th|Pos:1
|Note|Dur:4th|Pos:2
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:4
|Bar|Style:MasterRepeatClose
|Spacer|Width:50
|Bar|Style:MasterRepeatOpen
|Note|Dur:4th|Pos:4
|Note|Dur:4th|Pos:3
|Note|Dur:4th|Pos:2
|Note|Dur:4th|Pos:1
|Bar|Style:MasterRepeatClose
|Note|Dur:4th|Pos:1
|Note|Dur:4th|Pos:1
|Note|Dur:4th|Pos:1
|Note|Dur:4th|Pos:1
|AddStaff|Name:"Staff-3"|Group:"Standard"
|StaffProperties|EndingBar:Section Close|Visible:Y|BoundaryTop:10|BoundaryBottom:10|Lines:5|Color:Default
|StaffProperties|Muted:N|Volume:127|StereoPan:64|Device:0|Channel:3
|StaffInstrument|Trans:0|DynVel:10,30,45,60,75,92,108,127
|User|WingedRepeats.fso|Pos:1|Class:StaffSig|System:"System: Lower Staff"
|Clef|Type:Bass
|TimeSig|Signature:4/4
|Bar|Style:MasterRepeatOpen
|Note|Dur:4th|Pos:-1|Opts:Stem=Down
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:1
|Note|Dur:4th|Pos:2
|Bar|Style:MasterRepeatClose
|Spacer|Width:50
|Bar|Style:MasterRepeatOpen
|Note|Dur:4th|Pos:2
|Note|Dur:4th|Pos:1
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:-1|Opts:Stem=Down
|Bar|Style:MasterRepeatClose
|Note|Dur:4th|Pos:-1
|Note|Dur:4th|Pos:-1
|Note|Dur:4th|Pos:-1
|Note|Dur:4th|Pos:-1
!NoteWorthyComposer-End
  • Last Edit: 2015-11-17 06:14 pm by Lloyd
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

  • Lloyd
  • NWC2 User
Re: WingedRepeats.fso (version 1.0)
Reply #1
Thanks Mike, your version looks very good to mee, I specially like smooth edges on your wings.

Looking at both codes I think we get the same solution for the same question, and of course with the same limitations (the need of a spacer between close-open bars and, as you said in yours, missing wings to a Master Repeat Close Ending Bar).

I don't see the need of pulling down your version. I think that if there's more options it will be better for users, don't you think?  ;)
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: WingedRepeats.fso (version 1.0)
Reply #2
Lloyd, Mike - you guys are amazing - I love these objects :D :D :D

Thank you both so much!
I plays 'Bones, crumpets, coronets, floosgals 'n youfonymums - gonna lern tubies next

Re: WingedRepeats.fso (version 1.0)
Reply #3
Hi Lloyd,
I'm just doing some testing, and I've run into a small issue...

In copying your object from staff to staff in preparation for score preparation I've run into the error:
Quote
Execution limit exceeded.
The 'WingedRepeats.fso' object plugin has been suspended

It seems to happen when there are no repeats on a staff but it isn't predictable.  E.G. I had inserted it onto the right hand of a grand staff, then copied it to the left hand - no repeats existed in either location - and after the copy I got the suspension message.

Another time I inserted it onto a staff, the copied it to several others, none with any repeats yet, and the error occurred after the 4th or 5th paste.  A score refresh will clear the error if there are repeats for it to work on.
I plays 'Bones, crumpets, coronets, floosgals 'n youfonymums - gonna lern tubies next

Re: WingedRepeats.fso (version 1.0)
Reply #4
Hi Lloyd,
Just found another buglet:
CORRECTION
When an ending repeat is flagged to force a system break appears at the end of a staff, the wings appear in the editor, but not in print preview nor on the printed page for that repeat sign.

Placing a normal barline immediately after the repeat barline and moving the system break to it resolves the visual problem even if the barline is set to visibility never, but I don't think this workaround should be necessary.
I plays 'Bones, crumpets, coronets, floosgals 'n youfonymums - gonna lern tubies next

  • Lloyd
  • NWC2 User
Re: WingedRepeats.fso (version 1.0)
Reply #5
Thanks for reporting bugs  ;)
Gonna work for solving them, so wait for a little time.
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

  • Lloyd
  • NWC2 User
Re: WingedRepeats.fso (version 1.2)
Reply #6
Object updated to version 1.2
It tries to correct some bug fixes (thanks Lawrie) and now supports staff ending bars when they are set to Master Repeat Close (thanks Mike).
It also hides wings on hidden repeat bars and tries to solve the problems when Repeat Close and Repeat Open bars are found together.

Please hardly test it to ensure there's no bugs on the new functions, thanks.


Lawrie, please let me know if the bugs you found are solved. If not, then paste an nwctxt clip with an example of the errors, thanks  :D
  • Last Edit: 2015-10-30 10:02 am by lloyd
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: WingedRepeats.fso (version 1.2)
Reply #7
Hi Lloyd,
just did a quick test and it looks OK.  Will know more the next time I need to use it "in anger" but for now it seems like a winner :)

Adjacent repeat bars seem to work fine.
I plays 'Bones, crumpets, coronets, floosgals 'n youfonymums - gonna lern tubies next

  • Lloyd
  • NWC2 User
Re: WingedRepeats.fso (version 1.2)
Reply #8
Thanks a lot  :D if someone find more bugs, please report.
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: WingedRepeats.fso (version 1.2)
Reply #9
I am finding some problems with this otherwise excellent object.

After executing a "print preview" on a piece of music that has this object running, I get two error messages (see attached) - "Execution limit exceeded" followed by "The WingedRepeats.fso object plugin has been suspended".  The wings disappear from the score.  The only way to recover the winged version of the score is to exit nwc and restart the program and load the file afresh.

Is this a bug or am I doing something wrong ?

  • Lloyd
  • NWC2 User
Re: WingedRepeats.fso (version 1.2)
Reply #10
Hi melismata,
Quote
Is this a bug or am I doing something wrong ?
Both must be posible... since I'm very bad with script programing it can be a bug, of course (I'm almost sure it will be...), but I cannot solve it unless you upload your score, or a NWC text clip with the staff with the error to this post. So please, upload it and I'll review it. If there's a bug in the plugin script I'll update as soon as I can  ;)
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: WingedRepeats.fso (version 1.2)
Reply #11
In my experience, the most common way for "execution limit exceed" to happen is if a plug-in manages to go into an infinite loop.  If you show a sample score that is causing the error, hopefully we can see what is happening.

Mike

Re: WingedRepeats.fso (version 1.2)
Reply #12
A simple suggestion that might help safeguard your plug-in code. Change your repeat to guard against passing last bar, or exceeding your xLast calculation:

Code: (lua) [Select · Download]
repeat
if not NextBar:find('next', 'bar') then break end
...
until x >= xLast

Note that LastBar:find('last') is not guaranteed to be a bar line.

  • Lloyd
  • NWC2 User
Re: WingedRepeats.fso (version 1.2)
Reply #13
Thanks for the suggestion, this will solve infinite loop problems, but since the last version, I've been making changes to the code (I've been trying to add a non-staffsig function) so the bug that causes this error might be already fixed, that's because I think it would be better if melismata shows a sample score (as Mike said). Anyway I will add this line to the code, thanks ;D .

Quote
Note that LastBar:find('last') is not guaranteed to be a bar line.
I thought that find('last') would always find a barline (the "ending bar" in edit view or the bar with "system break" in print preview)
Was I wrong?
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: WingedRepeats.fso (version 1.2)
Reply #14
Was I wrong?

My recommendation: Do not assume that this will always be the case. It is a good practice to not make assumptions about what a plugin will find while indexing through notation positions.

  • Lloyd
  • NWC2 User
Re: WingedRepeats.fso (version 1.2)
Reply #15
Thanks for your suggestion, I'll keep that in mind  :)
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

  • Lloyd
  • NWC2 User
Re: WingedRepeats.fso (version 1.5)
Reply #16
Object updated.
The object now has a function for drawing wings "only once" by setting object's class to 'Standard'. The script has been reviewed for fixing bugs.

If there's some other (or new) bugs, please report.
[...] y el mayor bien es pequeño: que toda la vida es sueño, y los sueños, sueños son.

Re: WingedRepeats.fso (version 1.5)
Reply #17
Thanks Lloyd.

This fixed my "disappearing" wings after preview.  Now I can "fly" whenever I want to ...  ;D 

Melismata