Skip to main content
Topic: Object for turns (Read 4220 times) previous topic - next topic

Object for turns

I am trying to avoid adding a hidden/played staff to a 4 part piece I'm transcribing. The objects work well for trills and tremolos, but is there something to do turns?  If not, what is a good resource for writing objects in lua?

Attached is a short example.

TIA
Since 1998


Re: Object for turns

Reply #2
I had briefly considered writing a Turn.ms object, after completing the one for trills, but I didn't know the rules for how they are played. As someone said in that other thread, there are apparently different types of turns, depending on the time period.

I don't think it would be very difficult to make one based on the Trill object, from what I am seeing in various web pages. Oddly, I can't seem to find any mention of them in Behind Bars, unless she calls them something else.

As far a resources for writing custom objects in Lua, there really aren't that many, other than looking at ones that other people have written. I would probably not recommend that people look at objects I've written as learning tools, because I tend to use a lot of tricks that might not be obvious to the casual observer. The BarLabel.ms object that I wrote might be a good example, because it's fairly short and to the point, but it doesn't do any playback. Trill.ms would make the most sense to use as a starting point, but that object has a bit of complicated muck to deal with system spanning, which I don't think would be needed for turns.

In any case, I would be more than happy to assist in troubleshooting, if someone out there wants to take a shot at this.  Or, I'm sure my arm wouldn't require too much twisting to create an object for this.

Re: Object for turns

Reply #3
Thank you, I'll be checking out BarLabel and getting a book on Lua.

Some of these may overlap, but I think these things would be needed by any programmer learning a new language.

  • What are the boiler plate items, things that must be in any nwc object?
  • Debugging tools: What can be used to display text and/or variables while working on it?
  • Communicating script failure with nwc and the user.
  • What part of the program receives control when it starts (probably included in 1.)?
  • How to add/modify things to be displayed?
  • How to add/modify what is played?
  • What must be included in the name of the script?

Thank you for looking at it.
Since 1998

Re: Object for turns

Reply #4
I am trying to avoid adding a hidden/played staff to a 4 part piece I'm transcribing.
You might try:
Code: (nwc) [Select · Download]
!NoteWorthyComposer(2.751)
|SongInfo|Copyright1:"Copyright © 2009 <Name>"
|PgSetup|StaffSize:19
|Font|Style:StaffItalic|Size:12
|Font|Style:StaffBold|Size:10
|Font|Style:StaffLyric|Size:8
|Font|Style:User1|CharSet:1
|Font|Style:User2|CharSet:1
|AddStaff|Name:"Staff"
|StaffInstrument|Name:"Violin"|Patch:40
|Clef|Type:Treble
|Dynamic|Style:mf|Pos:-8
|Note|Dur:Half|Pos:6^
|RestChord|Dur:16th|Opts:Stem=Up,Muted,HideRest|Dur2:4th,DblDotted|Pos2:6
|Note|Dur:4th,Grace|Pos:6^|Opts:Muted|Visibility:Never
|Note|Dur:16th,Slur|Pos:6|Opts:Stem=Down,Beam=First|Visibility:Never
|Note|Dur:16th,Slur|Pos:7|Opts:Stem=Down,Crescendo,Beam|Visibility:Never
|Note|Dur:16th,Slur|Pos:6|Opts:Stem=Down,Crescendo,Beam|Visibility:Never
|Note|Dur:16th,Slur|Pos:#5|Opts:Stem=Down,Crescendo,Beam|Visibility:Never
|Note|Dur:16th|Pos:6^|Opts:Stem=Down,Crescendo,Beam|Visibility:Never
|Note|Dur:16th,Staccato|Pos:6|Opts:Stem=Down,Crescendo,Beam=End|Visibility:Never
|Text|Text:"&"|Font:StaffSymbols|Pos:6.5|Justify:Center|Placement:BestFitForward
|Text|Text:"d"|Font:StaffCueSymbols|Pos:4.5|Justify:Center|Placement:BestFitForward
|Spacer|Width:200
|Text|Text:"I "|Font:StaffSymbols|Pos:9|Justify:Right|Placement:AtNextNote
|Note|Dur:16th|Pos:7|Opts:Stem=Down,Crescendo
|Dynamic|Style:f|Pos:-8|Visibility:Never
|Bar
|Note|Dur:Half,Slur|Pos:2|Opts:Diminuendo
|Note|Dur:4th|Pos:#1|Opts:Diminuendo
|Dynamic|Style:mf|Pos:-8|Visibility:Never
|Rest|Dur:4th
|Bar
!NoteWorthyComposer-End
I have replaced your Boxmarks chars with chars from NWC2STDA.
I removed the slur since it is confusing over a breath mark. I would think a turn would be played legato by default.
You might not like the staccato on the last turn note, but it does give some meaning to the breath mark.
The Spacer width may need adjustment for final printing. NWC has no command to center text between 2 notes.
Registered user since 1996

Re: Object for turns

Reply #5
Many thanks! I've printed your example and am studying it. Hopefully I can automate its application in the near future, Eine Kleine has a bunch of them in the 2nd movement.
Again, thank you.
Since 1998

Re: Object for turns

Reply #6
Rick:

My apology for using an example from something other than what I was working on. It had a note being tied into a turn and your example did an excellent job of using and implementing that. However, without that leading tie-in I am getting stumpped as to how to implement this. How can I create an 8th note B natural which will display only and be beamed to the previous G? My test so far is after the red bar line, all else is reference and your example.

TIA
Since 1998

Re: Object for turns

Reply #7
How can I create an 8th note B natural which will display only and be beamed to the previous G?
Code: (nwc) [Select · Download]
!NoteWorthyComposer(2.751)
|PgSetup|Zoom:6
|AddStaff|Name:"Staff"
|StaffProperties|EndingBar:Open (hidden)
|StaffInstrument|Name:"Violin"|Patch:40
|PerformanceStyle|Style:Legato|Pos:0|Visibility:Never
|Clef|Type:Treble
|Key|Signature:Bb,Eb,Ab|Tonic:C
|Tempo|Tempo:36|Pos:10.5
|Rest|Dur:4th
|User|Beam.hmm|Pos:-7.5|Beam2:"Max.1 @ both"|FinalStemLength:-6.5
|Dynamic|Style:p|Pos:-8
|Note|Dur:8th,Staccato|Pos:5|Opts:Stem=Down,StemLength=0
|Text|Text:"&"|Font:StaffSymbols|Pos:8|Justify:Center|Placement:AtNextNote
|Text|Text:"e"|Font:StaffCueSymbols|Pos:6.5|Justify:Center|Placement:AtNextNote
|Note|Dur:32nd,Slur|Pos:n0|Opts:Stem=Up,StemLength=0,Beam=First
|Note|Dur:32nd,Slur|Pos:1|Opts:Stem=Up,Beam|Visibility:Never
|Note|Dur:32nd,Triplet=First,Slur|Pos:0|Opts:Stem=Up,Beam|Visibility:Never
|Note|Dur:32nd,Triplet,Slur|Pos:n-1|Opts:Stem=Up,Beam|Visibility:Never
|Note|Dur:32nd,Triplet=End,Slur|Pos:0|Opts:Stem=Up,Beam=End|Visibility:Never
|Bar
|Note|Dur:8th|Pos:1
|Rest|Dur:8th
|Rest|Dur:4th
!NoteWorthyComposer-End
If you can tolerate a slight delay for the onset of the last note, you can use:
Code: (nwc) [Select · Download]
!NoteWorthyComposer(2.751)
|PgSetup|Zoom:6
|AddStaff|Name:"Staff"
|StaffProperties|EndingBar:Open (hidden)
|StaffInstrument|Name:"Violin"|Patch:40
|PerformanceStyle|Style:Legato|Pos:0|Visibility:Never
|Clef|Type:Treble
|Key|Signature:Bb,Eb,Ab|Tonic:C
|Tempo|Tempo:36|Pos:10.5
|Rest|Dur:4th
|Dynamic|Style:p|Pos:-8
|Note|Dur:8th,Staccato|Pos:5|Opts:Stem=Down,Beam=First
|Note|Dur:4th,Grace|Pos:n0|Opts:Stem=Up,StemLength=0|Visibility:Never
|Note|Dur:4th,Grace|Pos:1|Opts:Stem=Up|Visibility:Never
|Note|Dur:4th,Grace|Pos:0|Opts:Stem=Up|Visibility:Never
|Note|Dur:4th,Grace|Pos:n-1|Opts:Stem=Up|Visibility:Never
|Note|Dur:4th,Grace|Pos:0|Opts:Stem=Up|Visibility:Never
|Note|Dur:4th,Grace|Pos:1^|Opts:Stem=Up|Visibility:Never
|Text|Text:"&"|Font:StaffSymbols|Pos:8|Justify:Center|Placement:AtNextNote
|Text|Text:"e"|Font:StaffCueSymbols|Pos:6.5|Justify:Center|Placement:AtNextNote
|Note|Dur:8th|Pos:n0|Opts:Stem=Down,Beam=End,Muted
|Bar
|Note|Dur:8th|Pos:1
|Rest|Dur:8th
|Rest|Dur:4th
!NoteWorthyComposer-End
Registered user since 1996

 

Re: Object for turns

Reply #8
I am starting to collect notes and looking at nwctxt to first find the turn symbol:

Code: [Select · Download]
|Text|Text:"&"|Font:StaffSymbols|Pos:8|Justify:Center|Placement:AtNextNote

However, the text either contained an empty box or three characters with the hex codes of ef 80 a6. The next line (a natural below the turn) contained hex: ef 81 a5 from StaffCueSymbols.  Is this something I need to test for or just change it when it happens?

Once the Text turn symbol is found, it should be straightforward to identify the turned note, the one before, the one after, and any accidentals to implement Rick's 2nd suggestion in post number 7.

TIA
Since 1998