use of com.xenoage.zong.core.music.time.TimeSignature in project Zong by Xenoage.
the class VoicesBeatOffsetterTest method createTestScore3VoicesGrace.
private Score createTestScore3VoicesGrace() {
Score score = new Score();
score.getFormat().setInterlineSpace(10);
Cursor cursor = new Cursor(score, mp0, true);
cursor.write(new TimeSignature(Companion.getTime_4_4()));
// 2: half note, 4: quarter note, 8: eighth note, 3: quarter triplet, .: grace note
// voice 1: | 4 ...4 4 4 | (staff 1)
// voice 2: | 8 8 8 8 ..2 | (staff 1)
// voice 3: | 3 3 3 .8 8 4 | (staff 2)
// voice 1 (staff 1)
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
cursor.write(graceChord(Companion.pi(0, 0, 0)));
cursor.write(graceChord(Companion.pi(0, 0, 0)));
cursor.write(graceChord(Companion.pi(0, 0, 0)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
// voice 2 (staff 1)
cursor.setMp(atElement(0, 0, 1, 0));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(graceChord(Companion.pi(0, 0, 0)));
cursor.write(graceChord(Companion.pi(0, 0, 0)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 2)));
// voice 3 (staff 2)
cursor.setMp(atElement(1, 0, 0, 0));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 6)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 6)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 6)));
cursor.write(graceChord(Companion.pi(0, 0, 0)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
return score;
}
use of com.xenoage.zong.core.music.time.TimeSignature in project Zong by Xenoage.
the class VoicesBeatOffsetterTest method createTestScore3Voices.
private Score createTestScore3Voices() {
Score score = new Score();
score.getFormat().setInterlineSpace(10);
Cursor cursor = new Cursor(score, mp0, true);
cursor.write(new TimeSignature(Companion.getTime_4_4()));
// 2: half note, 4: quarter note, 8: eighth note, 3: quarter triplet
// voice 1: | 4 4 4 4 | (staff 1)
// voice 2: | 8 8 8 8 2 | (staff 1)
// voice 3: | 3 3 3 8 8 4 | (staff 2)
// voice 1 (staff 1)
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
// voice 2 (staff 1)
cursor.setMp(atElement(0, 0, 1, 0));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 2)));
// voice 3 (staff 2)
cursor.setMp(atElement(1, 0, 0, 0));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 6)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 6)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 6)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
return score;
}
use of com.xenoage.zong.core.music.time.TimeSignature in project Zong by Xenoage.
the class VoicesBeatOffsetterTest method createTestScore1Voice.
private Score createTestScore1Voice() {
Score score = new Score();
score.getFormat().setInterlineSpace(1);
Cursor cursor = new Cursor(score, mp0, true);
cursor.write(new Clef(ClefType.Companion.getClefTreble()));
cursor.write((MeasureElement) new TraditionalKey(-3));
cursor.write(new TimeSignature(TimeType.Companion.timeType(6, 4)));
// beats: 0, 2, 3, 4, 8.
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 4)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 2)));
cursor.write(chord(Companion.pi(0, 0, 0), Companion.fr(1, 2)));
return score;
}
use of com.xenoage.zong.core.music.time.TimeSignature in project Zong by Xenoage.
the class Base42a method getExpectedStaff.
/**
* Gets the expected musical data, but without the dynamics, fermatas, articulations and slurs.
*/
static Staff getExpectedStaff() {
Score score = ScoreFactory.create1Staff();
Cursor cursor = new Cursor(score, mp0, true);
cursor.write(new TimeSignature(TimeType.Companion.getTime_4_4()));
// measure 0, voice 0
cursor.write(addLyric(chord(Companion.pi('E', 0, 5), Companion.fr(1, 2)), "This"));
cursor.write(addLyric(chord(Companion.pi('D', 0, 5), Companion.fr(1, 4)), "is"));
cursor.write(addLyric(chord(Companion.pi('B', 0, 4), Companion.fr(1, 4)), "the"));
// measure 1, voice 0
cursor.write(new Rest(Companion.fr(1, 4)));
cursor.write(addLyric(chord(Companion.pi('D', 0, 5), Companion.fr(1, 4)), "lyrics"));
cursor.write(addLyric(chord(Companion.pi('B', 0, 3), Companion.fr(3, 8)), "of"));
cursor.write(addLyric(chord(Companion.pi('C', 0, 5), Companion.fr(1, 8)), "Voice1"));
// measure 0, voice 1
cursor.setMp(atElement(0, 0, 1, 0));
cursor.write(addLyric(chord(Companion.pi('C', 0, 5), Companion.fr(1, 2)), "This"));
cursor.write(addLyric(chord(Companion.pi('B', 0, 4), Companion.fr(1, 4)), "is"));
cursor.write(addLyric(chord(Companion.pi('G', 0, 4), Companion.fr(1, 4)), "the"));
// measure 1, voice 1
cursor.write(new Rest(Companion.fr(1, 4)));
cursor.write(addLyric(chord(Companion.pi('B', 0, 4), Companion.fr(1, 4)), "lyrics"));
cursor.write(addLyric(chord(Companion.pi('G', 0, 3), Companion.fr(3, 8)), "of"));
cursor.write(addLyric(chord(Companion.pi('A', 0, 4), Companion.fr(1, 8)), "Voice2"));
return score.getStaff(0);
}
use of com.xenoage.zong.core.music.time.TimeSignature in project Zong by Xenoage.
the class Base42b method getExpectedStaves.
/**
* Gets the expected musical data, but without the dynamics, articulations and slurs
* and also without the clef changes.
*/
static Staff[] getExpectedStaves() {
Score score = ScoreFactory.create1Staff();
Cursor cursor = new Cursor(score, mp0, true);
cursor.write(new TimeSignature(TimeType.Companion.getTime_6_8()));
// staff 1, measure 0
cursor.write(chord(Companion.pi('F', 0, 4), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('D', 0, 4), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('B', 0, 3), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('G', 0, 3), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('F', 0, 3), Companion.fr(1, 4)));
// staff 1, measure 1
cursor.write(chord(Companion.pi('E', 0, 5), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('C', 0, 5), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('G', 0, 4), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('G', 0, 4), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('F', 0, 4), Companion.fr(1, 4)));
// staff 1, measure 0
cursor.setMp(atElement(1, 0, 0, 0));
cursor.write(new Rest(Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('G', 0, 2), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('G', 0, 2), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('G', 0, 2), Companion.fr(1, 8)));
cursor.write(chord(Companion.pi('A', 0, 2), Companion.fr(1, 16)));
cursor.write(chord(Companion.pi('G', 0, 2), Companion.fr(1, 16)));
cursor.write(chord(Companion.pi('F', 1, 2), Companion.fr(1, 16)));
cursor.write(chord(Companion.pi('G', 0, 2), Companion.fr(1, 16)));
// staff 1, measure 1
cursor.write(chord(new Pitch[] { Companion.pi('C', 0, 3), Companion.pi('E', 0, 3), Companion.pi('G', 0, 3), Companion.pi('C', 0, 4) }, Companion.fr(1, 4)));
cursor.write(new Rest(Companion.fr(1, 8)));
cursor.write(new Rest(Companion.fr(1, 4)));
cursor.write(chord(Companion.pi('G', 0, 3), Companion.fr(1, 8)));
return new Staff[] { score.getStaff(0), score.getStaff(1) };
}
Aggregations