コード例 #1
0
ファイル: CpnZoomScreen.java プロジェクト: klesun/jMusic_fork
 // How many measures in a Phrase ?
 private double countMeasures(Phrase p) {
   double answer = 0.0;
   for (int i = 0; i < p.size(); ++i) {
     answer = answer + p.getNote(i).getRhythmValue();
   }
   return answer / p.getNumerator();
 }
コード例 #2
0
ファイル: CpnZoomScreen.java プロジェクト: klesun/jMusic_fork
 // Move measures from the start of one Phrase to another
 private void moveMeasures(Phrase fromPhrase, Phrase toPhrase, double nMeasures) {
   double beatCount = nMeasures * fromPhrase.getNumerator();
   double beatValue;
   Note theNote;
   while ((beatCount > 0.005) && (fromPhrase.size() > 0)) {
     theNote = fromPhrase.getNote(0);
     beatValue = theNote.getRhythmValue();
     toPhrase.addNote(theNote);
     fromPhrase.removeNote(0);
     beatCount -= beatValue;
   }
 }