Live Audio Translating Into Hue Change

edited November 2016 in Library Questions

Hello everyone!

So for this assignment I have to take either an audio file or live audio input and have it translate to a hue change on a photo! Overall it seems pretty simple but I'm stuck on how to put the information in to change the hue. I've inserted what I have so far below.

    import ddf.minim.*;
    import ddf.minim.signals.*;
    import ddf.minim.analysis.*;
    import ddf.minim.effects.*;
    PImage img;

    Minim minim;
    AudioInput in;

    void setup()
    {
        img = loadImage("Ash.jpg");
        size( 540, 687 );
        smooth();

        minim = new Minim( this );

        in = minim.getLineIn( Minim.STEREO, 512 );

        background(img);
    }

    void draw()
    {
    }
    void stop()
    {
        in.close();
        minim.stop();
        super.stop();
    }

Answers

  • @lbrez16 --

    Well, if you want your img to change each time, you can't draw it once in setup(). You need to draw it repeatedly, in draw, as an image().

    Have you looked at the tint() command examples? Read the reference page carefully -- notice what it says about colorMode, as your assignment has a hue requirement.

    1. First try just changing the image color based on anything -- mouseX, seconds(), whatever.
    2. Then try making it work on hue.
    3. Then try mapping that to the values you get from your AudioInput in.
Sign In or Register to comment.