Skip to main content
Topic: Dur vs. Dur2 (Read 5324 times) previous topic - next topic

Dur vs. Dur2

In a chord (or restchord) where two durations are specified, is Dur: always less than (perhaps equal to) Dur2:?

TIA.  I'm working on another script.
Since 1998

Re: Dur vs. Dur2

Reply #1
Correct. Dur2 cannot be less than Dur
Among other things, this allows you to ignore Dur2 when accumulating the duration of a clip.

It seems that when NWC parses a chord that violates the rule, it drops the Dur2 portion:
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.5,Single)
|Chord|Dur:4th|Pos:0|Opts:Stem=Down|Dur2:Half|Pos2:0
|Chord|Dur:Half|Pos:0|Opts:Stem=Down|Dur2:4th|Pos2:0
|Bar
|RestChord|Dur:4th|Opts:Stem=Down|Dur2:Half|Pos2:0
|RestChord|Dur:Half|Opts:Stem=Down|Dur2:4th|Pos2:0
!NoteWorthyComposerClip-End

As of NWC 2.5.5, there seem to be some new wrinkles. In the past, all objects with Dur2 required that the stem direction be set and not result in inverted voicing. Failure to do so resulted in an invalid object which the parser converted to text:
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.5,Single)
|Chord|Dur:4th|Pos:2|Opts:Stem=Up|Dur2:Half|Pos2:0
|Chord|Dur:4th|Pos:2|Opts:Stem=Down|Dur2:Half|Pos2:0 ; invalid
|Chord|Dur:4th|Pos:2|Dur2:Half|Pos2:0 ; invalid
!NoteWorthyComposerClip-End

Now it seems that for a unison Chord, the parser drops Dur and uses Dur2
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.5,Single)
|Chord|Dur:4th|Pos:0|Opts:Stem=Down|Dur2:Half|Pos2:0
|Chord|Dur:4th|Pos:0|Opts:Stem=Up|Dur2:Half|Pos2:0
|Chord|Dur:4th|Pos:0|Dur2:Half|Pos2:0 ; becomes a half note!
!NoteWorthyComposerClip-End

It also seems that for a RestChord, the parser will supply a stem direction:
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.5,Single)
|RestChord|Dur:4th|Opts:Stem=Down|Dur2:Half|Pos2:0
|RestChord|Dur:4th|Opts:Stem=Up|Dur2:Half|Pos2:0
|RestChord|Dur:4th|Dur2:Half|Pos2:0 ; now valid
!NoteWorthyComposerClip-End

Registered user since 1996

 

Re: Dur vs. Dur2

Reply #2
Correct. Dur2 cannot be less than Dur
Among other things, this allows you to ignore Dur2 when accumulating the duration of a clip.
Fantastic!  That's exactly what I'll need to do--it will be moving text from one staff to another (one window to another).
Quote
...
Now it seems that for a unison Chord, the parser drops Dur and uses Dur2
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.5,Single)
|Chord|Dur:4th|Pos:0|Opts:Stem=Down|Dur2:Half|Pos2:0
|Chord|Dur:4th|Pos:0|Opts:Stem=Up|Dur2:Half|Pos2:0
|Chord|Dur:4th|Pos:0|Dur2:Half|Pos2:0 ; becomes a half note!
!NoteWorthyComposerClip-End
...
Shucks.  I think I can safely ignore this for what I'm writing this for, perhaps code for it for a later revision.

Thank you for a very informative answer (as always!).
Since 1998

Re: Dur vs. Dur2

Reply #3
My sentiments exactly. I can't get more worked up over it without getting bitten by it.

More weirdness:
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.5,Single)
|Chord|Dur:4th|Pos:1|Dur2:Half|Pos2:1 ; =>4th/Half
|Chord|Dur:4th|Pos:0|Dur2:Half|Pos2:0 ; =>Half/Half
|Chord|Dur:4th|Pos:-1|Dur2:Half|Pos2:-1 ; =>Half/Half
!NoteWorthyComposerClip-End
Registered user since 1996