|
|
|
|
|
|
|
|
var TripletElem = function TripletElem(number, anchor1, options) { |
|
|
this.type = "TripletElem"; |
|
|
this.anchor1 = anchor1; |
|
|
this.number = number; |
|
|
this.durationClass = ('d' + (Math.round(anchor1.parent.durationClass * 1000) / 1000)).replace(/\./, '-'); |
|
|
this.middleElems = []; |
|
|
this.flatBeams = options.flatBeams; |
|
|
}; |
|
|
|
|
|
TripletElem.prototype.isClosed = function () { |
|
|
return !!this.anchor2; |
|
|
}; |
|
|
|
|
|
TripletElem.prototype.middleNote = function (elem) { |
|
|
this.middleElems.push(elem); |
|
|
}; |
|
|
|
|
|
TripletElem.prototype.setCloseAnchor = function (anchor2) { |
|
|
this.anchor2 = anchor2; |
|
|
|
|
|
|
|
|
if (!this.anchor1.parent.beam || this.anchor1.stemDir === 'up') |
|
|
this.endingHeightAbove = 4; |
|
|
}; |
|
|
|
|
|
module.exports = TripletElem; |
|
|
|