correctly calculating pitch from line

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

correctly calculating pitch from line

Jim Newton
I've discovered a bug in my articulation/glissando calculating code which exhibits itself in transposing instruments.
The thing that is confusing to me is how to correctly calculate the pitch given the note->line().
apparently the function line2pitch() assumes the instrument is non-transposing.

There are three pitches attached to a note, and the comments in the Note class is confusing
note->pitch()    // midi pitch
note->epitch()  // effective pitch
note->ppitch()  // actual midi pitch (honoring ottavas) (read only)

ppitch is also documented as playback pitch

Does someone understand the semantics of these?  Can you help me understand?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: correctly calculating pitch from line

Jim Newton
It looks to me like to get the pitch which is correct to the ear (the actual pitch played)
I have to do the following.
line2pitch(line, clef, key) + note->ppitch() - note->epitch()

It is not clear to me whether any note will suffice? or whether it has to be a note on the given line, which might not yet exist.
Reply | Threaded
Open this post in threaded view
|

Re: correctly calculating pitch from line

Jim Newton
It is also not clear to me which key needs to be specified in the call to line2pitch?  Is it the concert key or the key as written for the transposing instrument?
Reply | Threaded
Open this post in threaded view
|

Re: correctly calculating pitch from line

Marc Sabatella
According to my understanding:

pitch() = the pitch that would result from actually playing this note, taking into consideration transposition but not accounting for ottavas
ppitch() = same as above but accounting for ottavas
epitch() = the "apparent" pitch of the note as currently displayed - not taking transposition or ottavas into consideration

So, middle "C" written for Bb trumpet (concert Bb) with an ottava over it should have pitch = 58, ppitch = 70.  epitch() is 60 until you turn "Concert Pitch" mode on, at which point it displays as Bb and now epitch() will be 58.  That's off the top of my head...

On Wed, May 13, 2015 at 3:21 AM, Jim Newton <[hidden email]> wrote:
It is also not clear to me which key needs to be specified in the call to
line2pitch?  Is it the concert key or the key as written for the transposing
instrument?



--
View this message in context: http://dev-list.musescore.org/correctly-calculating-pitch-from-line-tp7579337p7579339.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer



--
Marc Sabatella
[hidden email]

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer