private void readBeatEffects(TGBeat beat, TGNoteEffect noteEffect) throws IOException {
   int flags1 = readUnsignedByte();
   int flags2 = readUnsignedByte();
   noteEffect.setFadeIn(((flags1 & 0x10) != 0));
   noteEffect.setVibrato(((flags1 & 0x02) != 0));
   if ((flags1 & 0x20) != 0) {
     int effect = readUnsignedByte();
     noteEffect.setTapping(effect == 1);
     noteEffect.setSlapping(effect == 2);
     noteEffect.setPopping(effect == 3);
   }
   if ((flags2 & 0x04) != 0) {
     readTremoloBar(noteEffect);
   }
   if ((flags1 & 0x40) != 0) {
     int strokeDown = readByte();
     int strokeUp = readByte();
     if (strokeDown > 0) {
       beat.getStroke().setDirection(TGStroke.STROKE_DOWN);
       beat.getStroke().setValue(toStrokeValue(strokeDown));
     } else if (strokeUp > 0) {
       beat.getStroke().setDirection(TGStroke.STROKE_UP);
       beat.getStroke().setValue(toStrokeValue(strokeUp));
     }
   }
   if ((flags2 & 0x02) != 0) {
     readByte();
   }
 }
示例#2
0
  private void readNoteEffect(TGNoteEffect effect) {
    int header = readHeader(3);

    // leo el bend
    if (((header & EFFECT_BEND) != 0)) {
      effect.setBend(readBendEffect());
    }

    // leo el tremolo bar
    if (((header & EFFECT_TREMOLO_BAR) != 0)) {
      effect.setTremoloBar(readTremoloBarEffect());
    }

    // leo el harmonic
    if (((header & EFFECT_HARMONIC) != 0)) {
      effect.setHarmonic(readHarmonicEffect());
    }

    // leo el grace
    if (((header & EFFECT_GRACE) != 0)) {
      effect.setGrace(readGraceEffect());
    }

    // leo el trill
    if (((header & EFFECT_TRILL) != 0)) {
      effect.setTrill(readTrillEffect());
    }

    // leo el tremolo picking
    if (((header & EFFECT_TREMOLO_PICKING) != 0)) {
      effect.setTremoloPicking(readTremoloPickingEffect());
    }

    // vibrato
    effect.setVibrato(((header & EFFECT_VIBRATO) != 0));

    // dead note
    effect.setDeadNote(((header & EFFECT_DEAD) != 0));

    // slide
    effect.setSlide(((header & EFFECT_SLIDE) != 0));

    // hammer-on/pull-off
    effect.setHammer(((header & EFFECT_HAMMER) != 0));

    // ghost note
    effect.setGhostNote(((header & EFFECT_GHOST) != 0));

    // accentuated note
    effect.setAccentuatedNote(((header & EFFECT_ACCENTUATED) != 0));

    // heavy accentuated note
    effect.setHeavyAccentuatedNote(((header & EFFECT_HEAVY_ACCENTUATED) != 0));

    // palm mute
    effect.setPalmMute(((header & EFFECT_PALM_MUTE) != 0));

    // staccato
    effect.setStaccato(((header & EFFECT_STACCATO) != 0));

    // tapping
    effect.setTapping(((header & EFFECT_TAPPING) != 0));

    // slapping
    effect.setSlapping(((header & EFFECT_SLAPPING) != 0));

    // popping
    effect.setPopping(((header & EFFECT_POPPING) != 0));

    // fade in
    effect.setFadeIn(((header & EFFECT_FADE_IN) != 0));
  }