Skip to main content
Topic: For Andrew P. - Transpose User Tool (Read 2751 times) previous topic - next topic

For Andrew P. - Transpose User Tool

Hi, Andrew -

I just ran your "transpose" user tool to modify the chord letters above the staff.  It works wonderfully, except for one small problem.  I ran it on a piece that has an introduction, so all the notes prior to the verse starting are set to "no lyrics".  When I ran the tool, however, they reverted back to displaying the lyrics.  Is there a way to trap this attribute, so it doesn't get changed when running the tool?  If you need the source file, I'd be happy to send it to you (I'd need an address, though).

Thanks,

John

Re: For Andrew P. - Transpose User Tool

Reply #1
Oh my goodness!!... A possible answer to my suffering, and I have missed it!!... Where might I find more information on the tool?  I've looked a bit on the web site and forum but can't seem to turn up anything.  I have drifted back to NWC lately, and I see that a lot has been going on.  Regards, Don

Re: For Andrew P. - Transpose User Tool

Reply #2
Andrew... I found your reply in the "are these 2 features interesting?" thread.  Thank you *very* much.  Regards, Don

Re: For Andrew P. - Transpose User Tool

Reply #3
Hi John,

Sorry I've been slow replying. I've been really busy and haven't visited the forum for a few days. Here's a copy of the reply I wrote in the newsgroup:
======================
Hmm. I just tried this here and can't replicate the problem.
Which version of the user tool kit are you using? We're up to v1.1 now.
Downloadable at http://www.noteworthysoftware.com/nwc2/tools.htm
Also which version of transpose_chords are you using? The curent version is 1.0.2, though the most recent change is trivial. It's at
http://nwc-scriptorium.org/nwc2scripts.html#Transpose_Chords

I've had a look at my code, and the relevant bit is shown below:
foreach ($clip->Items as $item)
{
$nothingToDo = FALSE ;
$o = new NWC2ClipItem($item);
if ($o->GetObjType() == "Text" &&
($t =& $o->GetTaggedOpt("Text")) && rootChordValue($t)
&& (isset($font) ? $o->GetTaggedOpt("Font") == $font : true))
{
transpose($t) ;
echo $o->ReconstructClipText()."\n" ;
}
else echo $item ;
unset($o);
}

The variable $item is simply the string that is being passed to the filter by NWC2, and hopefully you can see that unless it is a "Text" item, it gets printed without any alteration. This would lead me to suspect that NWC2 wasn't sending the Lyric=Never attribute, but since it works for me, I can't verify this. What version of NWC2 are you using? Perhaps it was a bug that is already fixed?

> If you need the source NWC file, I'd be happy to send it to you (I'd need an address, though).

Just remove NOTWAGNER, but you could also simply copy and paste a before and after.
For example, if I transpose
Code: [Select · Download]
!NoteWorthyComposerClip(2.0,Single)
|Text|Text:"B"|Font:StaffItalic|Pos:6
|Note|Dur:4th|Pos:-8|Opts:Lyric=Never
|Note|Dur:4th|Pos:-7|Opts:Lyric=Never
|Note|Dur:4th|Pos:-6|Opts:Lyric=Never
|Note|Dur:4th|Pos:-5|Opts:Lyric=Never
|Bar
|Text|Text:"C"|Font:StaffItalic|Pos:6
|Note|Dur:4th|Pos:-4
|Note|Dur:4th|Pos:-3
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-1
!NoteWorthyComposerClip-End
using  -4 C#, I get
Code: [Select · Download]
!NoteWorthyComposerClip(2.0,Single)
|Text|Text:"G"|Font:StaffItalic|Pos:6
|Note|Dur:4th|Pos:-8|Opts:Lyric=Never
|Note|Dur:4th|Pos:-7|Opts:Lyric=Never
|Note|Dur:4th|Pos:-6|Opts:Lyric=Never
|Note|Dur:4th|Pos:-5|Opts:Lyric=Never
|Bar
|Text|Text:"G#"|Font:StaffItalic|Pos:6
|Note|Dur:4th|Pos:-4
|Note|Dur:4th|Pos:-3
|Note|Dur:4th|Pos:-2
|Note|Dur:4th|Pos:-1
!NoteWorthyComposerClip-End

 

Re: For Andrew P. - Transpose User Tool

Reply #4
This is a bug in NWC2, not the fault of the User Tool script.

This is actually a more generic problem as well. The lyric property is also not maintained when adding a second note to form a chord, or when adding a note to a rest.

This will be corrected in the next release.