public void megaWaveDouble(double x) {
    // logger.info("megaWaveDouble@ " + x);
    Content waveImage = anim.getContent("megaWave");

    int waveWidth = 256;
    int wave1End = 340;
    // pmvr2Start
    Clip wave1 =
        live.addClip(
            waveImage,
            cWidth - 15,
            0,
            waveWidth / 2,
            cHeight,
            1.0); // add it as 32px wide at the end of the stage
    Clip wave2 =
        live.addClip(
            waveImage,
            pmvr2Start - 8,
            0,
            waveWidth / 3,
            cHeight,
            1.0); // add it as 32px wide at the end of the stage
    wave1.zIndex = -100; // sets to far background
    wave2.zIndex = -100; // sets to far background

    // fadein, wait, fadeout
    Change waveMove1 = new LinearChange().xTo(wave1End - waveWidth).scaleWidth(3.0).alphaTo(0.0);
    Change waveMove2 = new LinearChange().xTo(0 - waveWidth).scaleWidth(3.0).alphaTo(0.0);

    wave1.queueChange(waveMove1, 3000).delete();
    wave2.queueChange(waveMove2, 3000).delete();
  }
  public void s1v1sparkle(double x) {
    // logger.info("s1v1sparkle@ " + x);

    Content sparkleClipFast = anim.getContent("sparkleClipFast");
    Clip faintSparkle = live.addClip(sparkleClipFast, 0, 0, cWidth, 16, 0.0);
    faintSparkle.zIndex = -100; // sets to far background

    // fadein, wait, fadeout
    Change lightFade = new LinearChange().alphaTo(.15);
    faintSparkle.delay(0).queueChange(lightFade, 800).delay(19000).fadeOut(2000).delete();
  }
 public void localStabExpand(double x) {
   // logger.info("localStabBig@ " + x);
   x = findNearestLight(x + lookAhead, true);
   int barWidth = 8;
   int of = 1;
   // create all bars, but at 0.0 alpha to popin later
   Content blurSquare = anim.getContent("blurSquare64grad");
   Clip stab1 = live.addClip(blurSquare, (int) x - barWidth / 2 - of, 0, barWidth, cHeight, 1.0);
   double newScale = 12.0;
   Change scale =
       new LinearChange().scaleWidth(newScale).xTo(x - barWidth / 2 * newScale - of).alphaTo(0.0);
   stab1.queueChange(scale, 800);
 }
 public EIAClipPlayer(AnimationManager am, ELUManager elu, SoundController sc) {
   this.anim = am;
   this.elu = elu;
   this.sc = sc;
   // quiet = screen saver
   quiet =
       anim.addClip(
           new SolidColorContent(null),
           0,
           0,
           am.getStageDimensions().width,
           am.getStageDimensions().height,
           0.0);
   // live = tracking users
   live =
       anim.addClip(
           new SolidColorContent(null),
           0,
           0,
           am.getStageDimensions().width,
           am.getStageDimensions().height,
           1.0);
 }
  public void screenSaverSparkle2(double x) {
    // logger.info("screenSaverSparkle2@ " + x);
    // use x as total time here as a hack
    int tFadeIn = 2000;
    int tFadeOut = 2000;
    int remain = (int) (x - tFadeOut - tFadeIn);

    Content sparkleClipFast = anim.getContent("sparkleClipSaver2");
    Clip faintSparkle = quiet.addClip(sparkleClipFast, 0, 0, cWidth, 16, 0.0);
    faintSparkle.zIndex = -100; // sets to far background

    // fadein, wait, fadeout
    Change lightFade = new LinearChange().alphaTo(0.35);
    faintSparkle.queueChange(lightFade, tFadeIn).delay(remain).fadeOut(tFadeOut).delete();
  }
  public void bigWaveAll(double x) {
    // logger.info("bigWaveAll@ " + x);
    Content waveImage = anim.getContent("waveImage");

    int waveWidth = 32;
    Clip waveImageClip =
        live.addClip(
            waveImage, 235, 0, waveWidth, 16, 1.0); // add it as 32px wide at the end of the stage
    waveImageClip.zIndex = -100; // sets to far background

    // fadein, wait, fadeout
    Change waveMove = new LinearChange().xTo(-waveWidth);
    waveImageClip.queueChange(waveMove, 10000).delay(500).delete();
    // one.delay(4000).queueChange(change6, 1000);
    // faintSparkle.delay(500).queueChange(lightFade, 4000).delay(12000).fadeOut(2000).delete();
  }
  public void randomWaves2(double x) {
    // logger.info("randomWaves2 @" + x);
    int xLow = 0;
    int xHigh = cWidth;
    int waveWidth = 40;

    // here we are using the x value as the number of waves to make
    int waves = (int) x;
    int pDelay = eNote / 3;
    Content waveImage = anim.getContent("waveImage");
    for (int p = 0; p < waves; p++) {
      int newx = (int) (Math.random() * (xHigh - xLow));
      Change moveIt = new LinearChange().xBy(-16).alphaTo(0.0);
      live.addClip(waveImage, newx, 0, waveWidth, cHeight, 1.0, p * pDelay)
          .queueChange(moveIt, 1500);
    }
  }
  public void megaThrob(double x) {
    // logger.info("megaThrob @" + x);

    int wave1End = 340;
    // use x here as a timing value for throb in/out
    int throbTime = (int) x;
    int throbOutTime = (int) (throbTime * 1.0);
    Content throbImage = anim.getContent("megaWave");
    live.addClip(throbImage, 0, 0, wave1End - 100, cHeight, 0.0)
        .fadeIn(throbTime)
        .delay(throbTime / 4)
        .fadeOut(throbOutTime)
        .delete();
    live.addClip(throbImage, wave1End, 0, cWidth - wave1End, cHeight, 0.0)
        .fadeIn(throbTime)
        .fadeOut(throbOutTime)
        .delete();
  }
  public void structuredWaves(double x) {
    // logger.info("structuredWaves @" + x);

    // here we are using the x value as the number of waves to make
    int waves = (int) x; // ?
    int wave1End = 340;
    int waveWidth = 32;
    int waveOffset = waveWidth / 3;
    int waveSpacing = waveWidth + waveOffset;
    waves = (cWidth - wave1End) / waveSpacing;

    int pDelay = eNote;
    Content waveImage = anim.getContent("waveImage");
    for (int p = 0; p < waves; p++) {
      int newx1 = wave1End + p * waveSpacing; // ppm 1
      int newx2 = 0 + p * waveSpacing; // ppm 2
      Change moveIt = new LinearChange().xBy(-1 * waveWidth / 2).alphaTo(0.0);
      live.addClip(waveImage, newx1, 0, waveWidth, cHeight, 1.0, p * pDelay)
          .queueChange(moveIt, 1500);
      live.addClip(waveImage, newx2, 0, waveWidth, cHeight, 1.0, p * pDelay)
          .queueChange(moveIt, 1500);
    }
  }