Ejemplo n.º 1
0
  /** applies the transformation to the source MelodyPart */
  public void execute() {
    Trace.log(2, "executing SideSlipCommand");

    int start = original.getSize();

    if (direction.equals("up")) { // slide up
      cm.execute(new ShiftPitchesCommand(distance, dest, 0, start, 0, 128, keySig));
    } else if (direction.equals("down")) { // slide down
      cm.execute(new ShiftPitchesCommand(-1 * distance, dest, 0, start, 0, 128, keySig));
    }

    // add two of the same melodies with one transposed
    source.setSize(dest.getSize() * 2);
    source.pasteOver(dest, start);
  }