how to find trill lines programmatically

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

how to find trill lines programmatically

Jim Newton
I'm trying to extend the ornament playback implementation to also work for
line trills.
I see there are several types of these.
      Trill::Type::TRILL_LINE,    
      Trill::Type::UPPRALL_LINE,
      Trill::Type::DOWNPRALL_LINE,
      Trill::Type::PRALLPRALL_LINE,
      Trill::Type::PURE_LINE  
     

It is not clear to me however how to find which a trill line is used on a chord, and thereafter which trill type it is.
Can someone help me figure it out?

How can I find the trill line object given the chord?

Reply | Threaded
Open this post in threaded view
|

Re: how to find trill lines programmatically

lasconic
Administrator
There is no direct link between a chord and a trill.
A Trill (see trill.cpp) is a spanner anchored to segment, so with a start tick and a end tick. You will find them in the _spanner map of the score.

Also as mentioned earlier, there is something for trill playback here: https://github.com/musescore/MuseScore/blob/master/libmscore/cmd.cpp#L273
but it's not working.

lasconic

2015-05-28 17:33 GMT+02:00 Jim Newton <[hidden email]>:
I'm trying to extend the ornament playback implementation to also work for
line trills.
I see there are several types of these.
      Trill::Type::TRILL_LINE,
      Trill::Type::UPPRALL_LINE,
      Trill::Type::DOWNPRALL_LINE,
      Trill::Type::PRALLPRALL_LINE,
      Trill::Type::PURE_LINE


It is not clear to me however how to find which a trill line is used on a
chord, and thereafter which trill type it is.
Can someone help me figure it out?

How can I find the trill line object given the chord?





--
View this message in context: http://dev-list.musescore.org/how-to-find-trill-lines-programmatically-tp7579417.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: how to find trill lines programmatically

Jim Newton
Do I really need to verify the end tick?  Didn't you say that musescore does not support multi-note trills?
Reply | Threaded
Open this post in threaded view
|

Re: how to find trill lines programmatically

lasconic
Administrator
No idea. But MuseScore definitely allows to create a trill line starting on a note and extending to another note further down the music. The trill line can even go over a line break.

lasconic

2015-05-28 17:52 GMT+02:00 Jim Newton <[hidden email]>:
Do I really need to verify the end tick?  Didn't you say that musescore does
not support multi-note trills?



--
View this message in context: http://dev-list.musescore.org/how-to-find-trill-lines-programmatically-tp7579417p7579419.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

trill.mscz (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: how to find trill lines programmatically

Jim Newton
In reply to this post by lasconic
It two voices both have chords beginning and ending in the same segment, will they be indistinguishable with regard to the trill line?
Reply | Threaded
Open this post in threaded view
|

Re: how to find trill lines programmatically

Jim Newton
In reply to this post by lasconic
OK, but this is different information than I had gathered so far.  I need to remember the source of the conversation.  But I asked what should the playback to if the trill line spans multiple notes.  The answer was that it will never happen.
Reply | Threaded
Open this post in threaded view
|

Re: how to find trill lines programmatically

Jim Newton
In reply to this post by lasconic
Reply | Threaded
Open this post in threaded view
|

Re: how to find trill lines programmatically

lasconic
Administrator
I guess this comment was wrong.

As demonstrated, MuseScore is currently able to draw a trill line on several notes, even on several systems. The trill has only a start tick and end tick, also a start track and end track so you could eventually make a difference between voices if you use the track. 
The main thing to understand is that this has been designed long time ago to accommodate graphical needs and not playback needs.
I have no idea if such a trill line is used in the current literature and no idea how it should sound.

lasconic

2015-05-28 18:12 GMT+02:00 Jim Newton <[hidden email]>:
Take a look here

https://musescore.org/en/node/56281#comment-282251



--
View this message in context: http://dev-list.musescore.org/how-to-find-trill-lines-programmatically-tp7579417p7579423.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer
Reply | Threaded
Open this post in threaded view
|

Re: how to find trill lines programmatically

Jim Newton
I must admit that code snippet you sent me is very difficult for me to read.

I don't see how to get from the segment to the spanner,  is it in the element list?
Reply | Threaded
Open this post in threaded view
|

Re: how to find trill lines programmatically

lasconic
Administrator
The spanners (crescendo, trills, etc...) are in SpannerMap _spanner in the Score object. SpannerMap derives from std::multimap<int, Spanner*>.
Where the index is the start tick of the spanner. Grep _spanner or SpannerMap or spannerMap() to find out more. or check how crescendo are taken into account in rendermidi.cpp.

lasconic

2015-05-28 18:29 GMT+02:00 Jim Newton <[hidden email]>:
I must admit that code snippet you sent me is very difficult for me to read.

I don't see how to get from the segment to the spanner,  is it in the
element list?



--
View this message in context: http://dev-list.musescore.org/how-to-find-trill-lines-programmatically-tp7579417p7579427.html
Sent from the MuseScore Developer mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer


------------------------------------------------------------------------------

_______________________________________________
Mscore-developer mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mscore-developer