Пример #1
0
 /**
  * Returns the Note at the specified index across all parts
  *
  * @param index the index of the Note to get
  * @return the Note at the specified index
  */
 public Note getNote(int index) {
   int sizeOfPart = chordProg.size();
   int partNum = index / sizeOfPart;
   int indexWithinPart = index % sizeOfPart;
   MelodyPart part = partList.get(partNum);
   return part.getNote(indexWithinPart);
 }
Пример #2
0
 /**
  * Adds the specified number of empty Parts to the Score.
  *
  * @param parts the number of Parts to add
  */
 public void addParts(int parts) {
   // Trace.log(0, "adding " + parts + " new parts to score");
   for (int i = 0; i < parts; i++) {
     MelodyPart mp = new MelodyPart(length);
     if (partList.size() > 0) {
       mp.setInstrument(partList.get(0).getInstrument());
     }
     partList.add(mp);
   }
 }
Пример #3
0
 /**
  * Returns the Part at the specified index.
  *
  * @param index the index of the Part to get
  * @return Part the Part at the specified index
  */
 public MelodyPart getPart(int index) {
   return partList.get(index);
 }