Get a chord object out of a segment
I have a segment with segmentType == Segment.ChordRest. How can I get a chord object out of it?
I have a segment with segmentType == Segment.ChordRest. How can I get a chord object out of it?
Do you still have an unanswered question? Please log in first to post your question.
Comments
segment.elementAt(tracknumber)
With
tracknumber
being(staffIndex * 4) + voiceIdx
.The method will either return the element in that position (which you can then test for its type again) or
null
In reply to segment.elementAt… by jeetee
Thank you very much. It works just as you said. If I'm right, The test for existence is (element && element.notes).