01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
package music;
class Transpose implements Event {
  Event e;
  double f;
  public Transpose(Event e, double factor) {
    this.e = e;
    this.f = factor;
  }
  public void play() {
    Music.scalePitch(f);
    e.play();
    Music.scalePitch(1.0/f);
  }
}