I had solved a previous problem of toggling an animation of a concentric circle to grow and stop on a mousePress event, but now I'd like the stop/start of the event to happen when you click the circle, and not just anywhere on the sketch. Here's my code:
int mil1 = 1;
void setup() {
size(200,200);
smooth();
}
void draw() {
background(0);
if(mil1 > 95) {
mil1 = 1;
} else if (mil1 >= 1) {
mil1 += 2;
}
//Circle ACTIVE RED 1
noFill();
stroke(255,0,0);
strokeWeight(4);
ellipse(100,100, 30*3.333,30*3.333);
fill(255,0,0);
stroke(255,0,0);
strokeWeight(4);
ellipse(100,100, mil1,mil1);
}
void mousePressed() {
if (mil1 >= 1) {
mil1 = 0;
} else if (mil1 == 0) {
mil1 = 1;
}
}
If anybody can help me with this one I'd be super grateful. I haven't had replies to my any of my threads yet, but I'm sure there's at least one knowledgable and generous enough person here in the forums! Much love and respect.
Hi, I'm working on a project that uses an iPad as a MIDI controller to drive audio-reactive visuals.
I'm using the proMidi library to receive MIDI signals in Processing from OSCulator and it's working very well. However, I cannot set different buttons on my controller to different things. Here's an example of the code:
void noteOn(promidi.Note note, int device, int channel){
int vel = note.getVelocity();
int pit = note.getPitch();
hVal = 130;
}
Here the MIDI controller triggers a variable (that controls the colour of my sketch), and I have a few buttons on my controller. Whenever I press ANY of the buttons on my controller, they all trigger this output. What I really want is to map one specific button to trigger this variable...So I can have map different buttons to trigger different colours etc.
Is midi mapping possible with proMidi? Would appreciate any help I can get. Thanks so much in advance.
Hey guys, Processing newbie here but I've started getting the hang of some things.
I've created a lovely processing visualisation using Minim, which is reacting fantastically well with the microphone. The thing is, I don't want the audio being taken from the microphone anymore, I want it from the output coming from another program (For use with Ableton Live 8 primarily, but iTunes and stuff for prototyping too).
This is for a live installation piece I'm working on, so the music generated in Ableton would influence the visuals. It seems fairly simple but I haven't found any other threads about this. Thank you!