Search in sources :

Example 1 with BeamNotation

use of com.xenoage.zong.musiclayout.notation.BeamNotation in project Zong by Xenoage.

the class BeamsSpacer method compute.

public Map<Beam, BeamSpacing> compute(Score score, Notations notations, FramesSpacing frames) {
    Map<Beam, BeamSpacing> ret = map();
    BeamIterator itB = new BeamIterator(score);
    for (Beam beam : itB) {
        MP mp = itB.getMp();
        int staffLinesCount = score.getStaff(mp).getLinesCount();
        val frame = frames.getFrame(mp.measure);
        val system = frame.getSystem(mp.measure);
        val beamNotation = (BeamNotation) notations.get(beam);
        ret.put(beam, beamSpacer.compute(beamNotation, system, score));
    }
    return ret;
}
Also used : Beam(com.xenoage.zong.core.music.beam.Beam) lombok.val(lombok.val) BeamSpacing(com.xenoage.zong.musiclayout.spacing.BeamSpacing) MP(com.xenoage.zong.core.position.MP) BeamIterator(com.xenoage.zong.core.util.BeamIterator) BeamNotation(com.xenoage.zong.musiclayout.notation.BeamNotation)

Example 2 with BeamNotation

use of com.xenoage.zong.musiclayout.notation.BeamNotation in project Zong by Xenoage.

the class BeamNotator method compute.

@MaybeNull
public BeamNotation compute(Beam beam, Notations notations) {
    // compute fragments
    List<Fragments> fragments = beamFragmenter.compute(beam);
    // get minimum stem length and gap
    BeamRules beamRules = BeamRules.getRules(beam);
    float gapIs = beamRules.getGapIs();
    // collect chords
    List<ChordNotation> chords = notations.getBeamChords(beam);
    // create notation
    BeamNotation beamNotation = new BeamNotation(beam, beam.getMP(), fragments, gapIs, chords);
    return beamNotation;
}
Also used : ChordNotation(com.xenoage.zong.musiclayout.notation.ChordNotation) Fragments(com.xenoage.zong.musiclayout.notation.beam.Fragments) BeamRules(com.xenoage.zong.musiclayout.notator.beam.lines.BeamRules) BeamNotation(com.xenoage.zong.musiclayout.notation.BeamNotation) MaybeNull(com.xenoage.utils.annotations.MaybeNull)

Aggregations

BeamNotation (com.xenoage.zong.musiclayout.notation.BeamNotation)2 MaybeNull (com.xenoage.utils.annotations.MaybeNull)1 Beam (com.xenoage.zong.core.music.beam.Beam)1 MP (com.xenoage.zong.core.position.MP)1 BeamIterator (com.xenoage.zong.core.util.BeamIterator)1 ChordNotation (com.xenoage.zong.musiclayout.notation.ChordNotation)1 Fragments (com.xenoage.zong.musiclayout.notation.beam.Fragments)1 BeamRules (com.xenoage.zong.musiclayout.notator.beam.lines.BeamRules)1 BeamSpacing (com.xenoage.zong.musiclayout.spacing.BeamSpacing)1 lombok.val (lombok.val)1