示例#1
0
 private void readGrace(TGNoteEffect effect) throws IOException {
   int fret = readUnsignedByte();
   int dynamic = readUnsignedByte();
   int transition = readByte();
   int duration = readUnsignedByte();
   int flags = readUnsignedByte();
   TGEffectGrace grace = new TGEffectGrace();
   grace.setFret(fret);
   grace.setDynamic(
       (TGVelocities.MIN_VELOCITY + (TGVelocities.VELOCITY_INCREMENT * dynamic))
           - TGVelocities.VELOCITY_INCREMENT);
   grace.setDuration(duration);
   grace.setDead((flags & 0x01) != 0);
   grace.setOnBeat((flags & 0x02) != 0);
   if (transition == 0) {
     grace.setTransition(Transition.NONE);
   } else if (transition == 1) {
     grace.setTransition(Transition.SLIDE);
   } else if (transition == 2) {
     grace.setTransition(Transition.BEND);
   } else if (transition == 3) {
     grace.setTransition(Transition.HAMMER);
   }
   effect.setGrace(grace);
 }
 private void readGrace(TGNoteEffect effect) throws IOException {
   int fret = readUnsignedByte();
   TGEffectGrace grace = getFactory().newEffectGrace();
   grace.setOnBeat(false);
   grace.setDead((fret == 255));
   grace.setFret(((!grace.isDead()) ? fret : 0));
   grace.setDynamic(
       (TGVelocities.MIN_VELOCITY + (TGVelocities.VELOCITY_INCREMENT * readUnsignedByte()))
           - TGVelocities.VELOCITY_INCREMENT);
   int transition = readUnsignedByte();
   if (transition == 0) {
     grace.setTransition(TGEffectGrace.TRANSITION_NONE);
   } else if (transition == 1) {
     grace.setTransition(TGEffectGrace.TRANSITION_SLIDE);
   } else if (transition == 2) {
     grace.setTransition(TGEffectGrace.TRANSITION_BEND);
   } else if (transition == 3) {
     grace.setTransition(TGEffectGrace.TRANSITION_HAMMER);
   }
   grace.setDuration(readUnsignedByte());
   effect.setGrace(grace);
 }
示例#3
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));
  }