use of com.xenoage.zong.musiclayout.spacer.beam.stem.BeamedStem in project Zong by Xenoage.
the class Example method getStems.
public BeamedStems getStems() {
val stems = new CList<BeamedStem>();
int[] notesLp = getNotesLp();
val stemDir = getStemDir();
float distance = getStemsDistanceIs();
for (int i : range(notesLp)) {
float stemXIs = i * distance;
float stemLengthIs;
if (i == 0)
stemLengthIs = leftStemLengthIs;
else if (i == notesLp.length - 1)
stemLengthIs = rightStemLengthIs;
else
stemLengthIs = stemDrawer.getPreferredStemLengthIs(new ChordLps(notesLp[i]), stemDir, Companion.getStaff5Lines());
float stemEndLp = notesLp[i] + stemDir.getSign() * stemLengthIs * 2;
stems.add(new BeamedStem(stemXIs, stemDir, slp(0, notesLp[i]), slp(0, stemEndLp)));
}
return new BeamedStems(stems.close());
}
Aggregations