Skip to main content
Recent Posts
11
Object Plugins / Re: ChordPlay.nw
Last post by Mike Shawaluk -
If neither of you experts can think of a case where you wouldn't want transposition, then it seems silly to add an option to enable/disable it. Look for an update shortly.
13
Object Plugins / Re: ChordPlay.nw
Last post by Lawrie Pardy -
If it's easy to implement the option for GuitarChord.ms then it's probably worth doing.

I'm also inclined to agree that in this case the new parameter should be unchecked by default as IMHO having playback match the transposition is far more likely to be desired than otherwise.

In fact, I can't think of a scenario where object playback should not include staff transposition, it makes no sense to me.
14
Object Plugins / Re: ChordPlay.nw
Last post by Mike Shawaluk -
So, it is up to @NoteWorthy Online to decide if he wants to make this change to the object official. I can see that there could be circumstances in which might not be desirable to transpose the playback (such as when Ottavamatic.ms is being used). For GuitarChord.ms, I was considering an additional checkbox parameter "Prevent transposed playback" which, when checked, would disable the new behavior. While I normally try to implement a new parameter with backward compatibility, I think it makes more sense for this to have a default value of unchecked, so that transposed playback is on by default.  I would be interested in your opinions as to whether this makes sense, or if an additional parameter is even needed.
16
Object Plugins / Re: ChordPlay.nw
Last post by Lawrie Pardy -
Thanks Mike,
works a treat once I found the code section... and made ALL the changes  ::)

I note that in my installation the function is called this:
play_ChordPlay(t)

instead of this:
play_ChordPlay()

17
Object Plugins / Re: ChordPlay.nw
Last post by Mike Shawaluk -
I should add a caveat to that fix. Namely, if you are using ChordPlay.nw in a passage that uses the Ottavamatic.ms object, you will get some strange sounding chords in the 8va sections :)
18
Object Plugins / Re: ChordPlay.nw
Last post by Mike Shawaluk -
And... it turns out the fix is very simple.  The API has a convenient function named nwcplay.getTransposition() which will take into account staff transpositions, as well as octave shifts for a treble clef.

Make these changes to the code toward the end of the play_ChordPlay() function:

   local noteCount = #k
   local arpeggioShift = (strum ~= 'No') and math.floor(math.min(duration,nwcplay.PPQ)/math.max(12,noteCount+1)) or 0
   local trans = nwcplay.getTransposition()
   for i, v in ipairs(k) do
      local thisShift = math.min(duration-arpeggioShift, arpeggioShift * ((strum == 'Down') and (noteCount-i) or i))
      nwcplay.note(thisShift, duration-thisShift, startPitch+v+nshift+trans)
   end


(Note: I would have used the "code" block feature, but that wouldn't let me use colored text)
19
Object Plugins / Re: ChordPlay.nw
Last post by Mike Shawaluk -
It turns out that this problem isn't unique to ChordPlay.nw.  GuitarChord.ms has the same problem. (I was going to add Banjo.ms and Ukulele.ms to the list, but then I remembered that those objects don't include playback.)

When I saw this, I thought that perhaps more of my objects that have playback would suffer from this, but it appears that objects that look at existing notes, like Arpeggio and Trill, are getting the staff transposition information.  I will look at the code for GuitarChord.ms to see if there is an easy fix for this, which hopefully could be applied to the other objects.
20
Object Plugins / Re: ChordPlay.nw
Last post by Lawrie Pardy -
Thanks for the confirmation mate.

It isn't important enough to me to warrant any real effort to correct, I was more wanting confirmation that I hadn't lost what's left of my tiny, little mind  :))