private void readBend(TGNoteEffect effect) throws IOException {
    TGEffectBend bend = getFactory().newEffectBend();
    skip(5);
    int points = readInt();
    for (int i = 0; i < points; i++) {
      int position = readInt();
      int value = readInt();
      readByte();

      int pointPosition =
          Math.round(position * TGEffectBend.MAX_POSITION_LENGTH / GP_BEND_POSITION);
      int pointValue = Math.round(value * TGEffectBend.SEMITONE_LENGTH / GP_BEND_SEMITONE);
      bend.addPoint(pointPosition, pointValue);
    }
    if (!bend.getPoints().isEmpty()) {
      effect.setBend(bend);
    }
  }
  private void readBend(TGNoteEffect effect) throws IOException {
    skip(5);
    BendingEffect bend = new BendingEffect();
    int numPoints = readInt();
    for (int i = 0; i < numPoints; i++) {
      int bendPosition = readInt();
      int bendValue = readInt();
      readByte();

      int pointPosition =
          Math.round(bendPosition * EffectPoint.MAX_POSITION_LENGTH / GP_BEND_POSITION);
      int pointValue = Math.round(bendValue * EffectPoint.SEMITONE_LENGTH / GP_BEND_SEMITONE);
      bend.addPoint(pointPosition, pointValue);
    }
    if (!bend.getPoints().isEmpty()) {
      effect.setBend(bend);
    }
  }
  private void readNoteEffect(TGNoteEffect effect) {
    // leo el vibrato
    effect.setVibrato(readBoolean());

    // leo el bend
    if (readBoolean()) {
      effect.setBend(readBendEffect());
    }

    // leo la nota muerta
    effect.setDeadNote(readBoolean());

    // leo el slide
    effect.setSlide(readBoolean());

    // leo el hammer
    effect.setHammer(readBoolean());
  }
Exemple #4
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));
  }