예제 #1
0
 private void readChord(int strings, TGBeat beat) throws IOException {
   TGChord chord = getFactory().newChord(strings);
   if ((readUnsignedByte() & 0x01) == 0) {
     chord.setName(readStringByteSizeOfInteger());
     chord.setFirstFret(readInt());
     if (chord.getFirstFret() != 0) {
       for (int i = 0; i < 6; i++) {
         int fret = readInt();
         if (i < chord.countStrings()) {
           chord.addFretValue(i, fret);
         }
       }
     }
   } else {
     skip(16);
     chord.setName(readStringByte(21));
     skip(4);
     chord.setFirstFret(readInt());
     for (int i = 0; i < 7; i++) {
       int fret = readInt();
       if (i < chord.countStrings()) {
         chord.addFretValue(i, fret);
       }
     }
     skip(32);
   }
   if (chord.countNotes() > 0) {
     beat.setChord(chord);
   }
 }
예제 #2
0
  private void readChord(TGBeat beat) {
    TGChord chord = this.factory.newChord(readByte());

    // leo el nombre
    chord.setName(readUnsignedByteString());

    // leo el primer fret
    chord.setFirstFret(readByte());

    // leo las cuerdas
    for (int string = 0; string < chord.countStrings(); string++) {
      chord.addFretValue(string, readByte());
    }
    beat.setChord(chord);
  }
예제 #3
0
 private void readChord(int strings, TGBeat beat) throws IOException {
   TGChord chord = new TGChordImpl(strings);
   this.skip(17);
   chord.setName(readStringByte(21));
   this.skip(4);
   chord.setFirstFret(readInt());
   for (int i = 0; i < 7; i++) {
     int fret = readInt();
     if (i < chord.countStrings()) {
       chord.addFretValue(i, fret);
     }
   }
   this.skip(32);
   if (chord.countNotes() > 0) {
     beat.setChord(chord);
   }
 }