• fullscreen
  • wmb.pde
  • /* My version of the famous Whitney Music Box
       based on the work of John Whitney and Jim Bumgardner.
       >> uses rwmidi library.
    import rwmidi.*;
    MidiOutput output;
    float steps = 60,
          speed = .0005,
    int  mbsize = 500,
         points = 36;
    float[] yprev = new float[points];
    void setup()
      center = mbsize/2;
      radius = mbsize*.48;
      colorMode(HSB, points);
      for (int i = 0; i < points; i++){yprev[i]= -1.0;}
      output = RWMidi.getOutputDevices()[0].createOutput();
    void draw()
      float time = millis()*speed;
      float step = time / steps;
      for (int i = 0; i < points; ++i)
        float angle = TWO_PI * step * (points - i);
        float wx = cos(angle);
        float wy = sin(angle);
        float pdist = (i/(float)points) * radius;
        float x = center + wx * pdist;
        float y = center + wy * pdist;
        float esize = 2 + i/4;
        if ((wy>=0) && (yprev[i]<0) && (wx>0)) { 
              int chan=0;
              int note=2*i+30;
              int vel=100;
              int ret =    output.sendNoteOff(chan, note, 0);
                  ret =    output.sendNoteOn(chan, note, vel);
        ellipse((int) x, height-(int) y, esize, esize);


    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.



    Report Sketch

    Report for inappropriate content

    Please provide details if possible:

    Your have successfully reported the sketch. Thank you very much for helping to keep OpenProcessing clean and tidy :)

    Make a Copyright Infringement claim

    Nom Bot

    whitney music box

    Add to Faves Me Likey@! 3
    You must login/register to add this sketch to your favorites.

    my version, based on the work of John Whitney and Jim Bumgardner.

    rupert russell
    24 Apr 2011
    I can not get the libary to work with processing 1.2 I have put a folder named rwmidi into my libraries folder and placed the file rwmidi.jar into it but processing reports that I may be missing a library. Very frustrating.
    You need to login/register to comment.