Ejemplo n.º 1
0
  private void readChannel(TGTrack track) {
    // leo el canal
    track.getChannel().setChannel(readShort());

    // leo el canal de efectos
    track.getChannel().setEffectChannel(readShort());

    // leo el instrumento
    track.getChannel().setInstrument(readShort());

    // leo el volumen
    track.getChannel().setVolume(readShort());

    // leo el balance
    track.getChannel().setBalance(readShort());

    // leo el chorus
    track.getChannel().setChorus(readShort());

    // leo el reverb
    track.getChannel().setReverb(readShort());

    // leo el phaser
    track.getChannel().setPhaser(readShort());

    // leo el tremolo
    track.getChannel().setTremolo(readShort());

    // leo el solo
    track.setSolo(readBoolean());

    // leo el mute
    track.setMute(readBoolean());
  }
Ejemplo n.º 2
0
  private TGTrack readTrack(int number, TGSong song) {
    // header
    int header = readHeader();

    TGTrack track = this.factory.newTrack();

    track.setNumber(number);

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

    // leo el solo
    track.setSolo((header & TRACK_SOLO) != 0);

    // leo el mute
    track.setMute((header & TRACK_MUTE) != 0);

    // leo el canal
    readChannel(song, track);

    // leo la cantidad de compases
    int measureCount = song.countMeasureHeaders();

    // leo los compases
    TGMeasure lastMeasure = null;
    for (int i = 0; i < measureCount; i++) {
      TGMeasure measure = readMeasure(song.getMeasureHeader(i), lastMeasure);
      track.addMeasure(measure);
      lastMeasure = measure;
    }

    // leo la cantidad de cuerdas
    int stringCount = readByte();

    // leo las cuerdas
    for (int i = 0; i < stringCount; i++) {
      track.getStrings().add(readInstrumentString(i + 1));
    }

    // leo el offset
    track.setOffset(TGTrack.MIN_OFFSET + readByte());

    // leo el color
    readRGBColor(track.getColor());

    // leo el lyrics
    if (((header & TRACK_LYRICS) != 0)) {
      readLyrics(track.getLyrics());
    }

    return track;
  }