Skip to main content
Topic: ChordPlay.nw (Read 6622 times) previous topic - next topic

ChordPlay.nw

ChordPlay enables show and play of a named chord. For play back, the duration of the chord is determined by the indicated Span value, which defines the number of notes/rests for which the chord will play.

The Font, Size, and Style can be set within any instance of ChordPlay, but only the first instance in a staff generally needs to define the font details. By default, all subsequent ChordPlay objects will use the font details specified in the first instance in the staff. If the first instance is being used only for setting default display options, then it will show as a special object.

The following clip will get you started:

Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.75,Single)
|User|ChordPlay.nw|Pos:7|Font:MusikChordSerif|Size:8|Style:b|Visibility:Never
|Clef|Type:Treble
|Instrument|Name:"Acoustic Guitar (nylon)"|Patch:24|Bank:0,112|Trans:0|DynVel:10,30,45,60,75,92,108,127|Pos:-9
|TimeSig|Signature:4/4
|User|ChordPlay.nw|Pos:7|Name:A|Span:1
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:7|Span:1|Name:A
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:7|Span:1|Name:D
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:7|Span:1|Name:A
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:7|Span:1|Name:D
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:7|Span:1|Name:F#m
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:7|Span:1|Name:A
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:7|Span:1|Name:C#m
|Rest|Dur:Half
|User|ChordPlay.nw|Pos:7|Span:1|Name:F#
|Rest|Dur:Half
|Bar
|User|ChordPlay.nw|Pos:7|Span:1|Name:B7
|Rest|Dur:Half
|User|ChordPlay.nw|Pos:7|Span:1|Name:E7
|Rest|Dur:Half
|Bar|Style:LocalRepeatClose|Repeat:4
!NoteWorthyComposerClip-End

Re: ChordPlay.nw

Reply #1
New version with strum direction and improved support for inversions. This clip is a good example of walking the bass note from C5 down to C4 within a chord progression.

Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.74974,Single)
|Clef|Type:Treble
|Text|Text:"walk the bass note from C5 down to C4"|Font:StaffBold|Pos:-11|Color:1|Visibility:Never
|User|ChordPlay.nw|Pos:8|Name:C|Span:1|Strum:Up|Font:MusikChordSerif|Size:10|Style:Bold|Octave:5
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:8|Name:G/B|Span:1|Strum:Down|Octave:4
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:8|Name:Am|Span:1|Strum:Up
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:8|Name:Am/G|Span:1|Strum:Down
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:8|Name:F|Span:1|Strum:Up
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:8|Name:C/E|Span:1|Strum:Down
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:8|Name:Dm7|Span:1|Strum:Up
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:8|Name:C|Span:1|Strum:Down
|Rest|Dur:Whole
!NoteWorthyComposerClip-End

Re: ChordPlay.nw

Reply #2
Updated to allow custom key sequences:

Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.74974,Single)
|User|ChordPlay.nw|Pos:7|Name:C|Span:1|Keys:0,4,7,16,19,24,28,31,28,24,19,16,7,4,0
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:7|Name:D|Span:1|Keys:0,4,7,16,19,24,28,31,28,24,19,16,7,4,0
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:7|Name:E|Span:1|Keys:0,4,7,16,19,24,28,31,28,24,19,16,7,4,0
|Rest|Dur:Whole
!NoteWorthyComposerClip-End

Updated again to fix timing errors when spanning small duration intervals.

Re: ChordPlay.nw

Reply #3
Updated to allow custom key sequences
Which allows it to be used to retime grace notes:
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.74974,Single)
|Clef|Type:Treble
|RestChord|Dur:8th|Opts:Stem=Down,HideRest|Dur2:4th|Pos2:-2
|User|ChordPlay.nw|Pos:6|Name:C|Span:3|Keys:0|Octave:5|Visibility:Never
|Rest|Dur:16th|Opts:Stem=Down|Visibility:Never
|User|ChordPlay.nw|Pos:8|Name:E|Span:2|Keys:0|Octave:5|Visibility:Never
|Rest|Dur:16th|Opts:Stem=Down|Visibility:Never
|Note|Dur:16th,Grace|Pos:-6^|Opts:Stem=Up,Beam=First,Muted
|Note|Dur:16th,Grace|Pos:-4^|Opts:Stem=Up,Beam=End,Muted
|Chord|Dur:4th|Pos:-6,-4,-2
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-2
!NoteWorthyComposerClip-End
Registered user since 1996

Re: ChordPlay.nw

Reply #4
Updated to support new property menu and native font selection dialog.

After adding a ChordPlay.nw object, you can refine its behavior by either right clicking on its anchor, or by selecting it and pressing J.

Re: ChordPlay.nw

Reply #5
I have to record my continued objection to the way the development and implementation of user objects is going.

1. When inserting a user object it is really counter productive to have to insert it blind without setting any parameters and then edit it using select and "j"  to look through each parameter to see what is set in there to see if you want / need to change it. What a waste of effort and additional keying action

2. Noteworthy Objects can normally be seen traditionally by selecting the object and pressing ALT and ENTER. With this new method, you can only see items that have been changed from the default. There is nowhere you can now see a list of parameters and how they have been set without numerous key actions via select and "j".

3. The only parameters passed in a copy to an nwctxt clip is defaults that have been changed. This means that if you want to do global changes on parameters via a text editor, you have to go and deliberately alter one so that it gets passed via nwctxt to the text editor. What a waste of time and effort.

Not being able to see what the parameters are and being able to change them when inserting a new object is a leap backward.
Not having all parameters in nwctxt for a particular user object is a leap backward.
Not having parameters displayed in the user object properties box unless they are not the default is a leap backward.

I've had my say !  I would ask for these leaps backward to be re-considered.


Rich.

Re: ChordPlay.nw

Reply #6
2. Noteworthy Objects can normally be seen traditionally by selecting the object and pressing ALT and ENTER.
Which brings up a Property Sheet that is customized for each object. That will not happen for User Objects.

We have been down this road with wxphp and User Tools. My head still hurts from the experience ...
Edit: Added strikethrough. My head hurts, but I am dealing with it.
Registered user since 1996

Re: ChordPlay.nw

Reply #7
Updated to include an integrated user tool, ChordPlay.nw: Convert Text Chords (new tool requires 2.75a Beta 2 or later)

Re: ChordPlay.nw

Reply #8
Updated as follows:

  • When not using Lawrie Pardy's chord fonts, '#' and 'b' are automatically mapped to true flat and sharp characters for display purposes.
  • When using one of Lawrie Pardy's Germanic chord fonts, B and Bb are automatically remapped to H and B for display purposes.

Re: ChordPlay.nw

Reply #9
Updated to protect from a song position out of range error when playing or exporting to a MIDI file.

Re: ChordPlay.nw

Reply #10
My daughter can read the chords written "the english way" but many of her friends don't.
It's a pity this tool doesn't manage "the italian way" too (I mean: Do, Re, Mi, Fa, Sol, La, Si).

Today I learned, courtesy of Mike, that these objects transpose automatically.
Very good, but I found no reference of it in the instructions.

Re: ChordPlay.nw

Reply #11
I'm trying to convert myself to use this plugin for convenience.
I inserted some chords, but I discovered that the chord names are by far too small.
I fought with the plugin until I discovered that I have to select it, click it with the right mouse button to access a submenu that can let me choose what to do, then, maybe, actually doing it... Bah!
To quote Rich: it is a leap backward.

Anyway, I went to modify the text size and I discovered it already is (so it says) 32 points! N.B. my staff is 18 points!
Looking at the source code I see:
Code: [Select · Download]
{id='Size',label='Font Size',type='float',default=nil,min=0.1,max=50,step=0.1},
Max 50? False. (Luckily) I can even use 100 or more... just to reach the same size of a 18 point text.
There's something wrong with the metric...

I think I should try to adjust it to my needs.

Re: ChordPlay.nw

Reply #12
Code: [Select · Download]
{id='Size',label='Font Size',type='float',default=nil,min=0.1,max=50,step=0.1},
Max 50? False. (Luckily) I can even use 100 or more... just to reach the same size of a 18 point text.
There's something wrong with the metric...

I think I should try to adjust it to my needs.

Not clear on your point. The size 50 max is clearly a thing. These two clips give the same result:

Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.751,Single)
|Clef|Type:Treble
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:-8.5|Name:B|Span:5|Font:MusikChordSerif|Style:b|Size:50|Strum:Up
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:0
|Bar
|Note|Dur:Whole|Pos:0
!NoteWorthyComposerClip-End
Code: (nwc) [Select · Download]
!NoteWorthyComposerClip(2.751,Single)
|Clef|Type:Treble
|Rest|Dur:Whole
|Bar
|User|ChordPlay.nw|Pos:-8.5|Name:B|Span:5|Font:MusikChordSerif|Style:b|Size:150|Strum:Up
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:0
|Note|Dur:4th|Pos:0
|Bar
|Note|Dur:Whole|Pos:0
!NoteWorthyComposerClip-End

Re: ChordPlay.nw

Reply #13
Not clear on your point. The size 50 max is clearly a thing. These two clips give the same result:
(snip)
Perhaps he was confused by the fact that the point size in the font chooser dialog is 4x the value that is returned to the program. So a 50 point font in the object properties corresponds to a 200 point font in the dialog.

Re: ChordPlay.nw

Reply #14
The limit is artificial. It can be increased with a proper justification.

Re: ChordPlay.nw

Reply #15
the point size in the font chooser dialog is 4x the value that is returned to the program
Right that!
I just didn't investigate what is tha ratio and why.
Quote
There's something wrong with the metric...

Re: ChordPlay.nw

Reply #16
I just discovered that if someone is missing the MusikChordSerif font the plugin crashes.
The bug is in line 192:
Quote
defaultChordFontFace = Arial
Arial is nil, so later the process is aborted.
The correct line should be:
Quote
defaultChordFontFace = "Arial"
in which Arial is the (quoted) typeface name.

N.B. I'm working on changing this object to show and print the chords "the italian way" too (I mean: Do, Re, Mi, Fa, Sol, La, Si).
It's almost ready and I will publish it here, but my feelings, from other tools and plugins, is that not many out there are interested in this option.

Re: ChordPlay.nw

Reply #17
N.B. What a mess in the font metrics!

Re: ChordPlay.nw

Reply #18
I just discovered that if someone is missing the MusikChordSerif font the plugin crashes.
Fortunately, NWC 2.75 and later include the font as part of the installation, so the only way it should be missing is if someone intentionally removed it.

Re: ChordPlay.nw

Reply #19
Just in case someone (else) cares about this feature, this new version of the object can show and print the chords "the italian way" (I mean: Do, Re, Mi, Fa, Sol, La, Si).
It only shows and prints the chords that way. While editing, the chords are still written as A..G.
The choice is in a new parameter, "Italian style chords", that can be "Default", "Yes" or "No".
I think "Yes" and "No" are self explaining.  :D
If it's "Default" then it "inherites" the status from the nearest preceeding ChordPlay.nw that has "Yes" or "No". If none is found then "No" is assumed, so it's perfectly compatible with the official version (1.6). This is the reason why I didn't change the "developer ID".

Re: ChordPlay.nw

Reply #20
Just in case someone (else) cares about this feature, this new version of the object can show and print the chords "the italian way" (I mean: Do, Re, Mi, Fa, Sol, La, Si).

I would have called it "the belgian way" ;)
Always look on the bright side of life!

Re: ChordPlay.nw

Reply #21
Well, what's important is to understand.  :)
Let me know if you find something wrong. I'm not an expert of Lua.

Re: ChordPlay.nw

Reply #22
Since it appears there are more than one country that use this style of chord, perhaps a better name would be "solfeggio chords".  And then perhaps another sub-option for Si vs. Ti as the 7th note?


Re: ChordPlay.nw

Reply #24
I always wondered where "Ti" comes from.
For a long time I was sure I misheard it!  :D  Then, somewhere, I read it...

Also the "solfeggio" name for what are, for us Italians, the standard notes was a bit of surprise to me.
It shouldn't. How can someone sing ("solfeggiare") "C" or "G"?  :))

UT queant laxis
REsonare fibris
...
LAbii reatum
Sancte Ioannes

The seventh note is called "Si" from "Sancte Ioannes"
Ut was replaced with Do at least since 1536 in a text by Pietro Aretino and comes from "Dominus".


 

Re: ChordPlay.nw

Reply #26
I don't know what I'm doing wrong, but Chordplay does not give me any font options.  Everything says "right-click" and they'll be there, but they just aren't.

Thanks if anyone can point me in the right direction.

Don H.

Re: ChordPlay.nw

Reply #27
It's a bit obscure, but if you highlight the object, then right click you get a context menu where you can select the Object (Chordplay...) option, where there is a font option.
Also, instead of highlighting the object, just right click it and it will take you straight to the submenu where the font option exists.

I plays 'Bones, crumpets, coronets, floosgals 'n youfonymums - 'n I'm lernin' tubies now too