We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Index › Recent Posts
1  Programming Questions & Help / Electronics,  Serial Library / May 20th 2010 3 45pm
 on: Nov 22nd, 2011, 8:24am 
Started by paw | Post by PoryNundopponKI  
Welcome back to playing this crazy game we love so much

You could wait until the new EP Generations comes out and see if challenges will be introduced again since well be getting memories back in that EP.  Itll be out May 31, 2011 here in North America so not too long to wait now

2  Programming Questions & Help / Electronics,  Serial Library / Test, just a test
 on: Nov 12th, 2011, 8:19am 
Started by AbseseHedVR | Post by AbseseHedVR  
Hello. And Bye.

3  Programming Questions & Help / Electronics,  Serial Library / so so easy walker horse shoes fisher cat
 on: Nov 6th, 2011, 9:02pm 
Started by moinkimmuptNX | Post by moinkimmuptNX  
angiotensin i

4  Suggestions & Bugs / Website,  Documentation,  Book Bugs / Re: PGraphicsPDF
 on: Jun 3rd, 2011, 8:47am 
Started by Herbert Spencer | Post by Herbert Spencer  
fry wrote on Aug 14th, 2008, 1:44pm:
sorry about that, it looks like those examples need to be cleaned up a bit. here's a fixed version of the one you mentioned:

Quote:
import processing.pdf.*;

boolean recording;
PGraphicsPDF pdf;

void setup() {
 size(400, 400);
 pdf = (PGraphicsPDF) createGraphics(width, height, PDF, "pause-resume.pdf");
}

void draw() {
 // Be sure not to call background, otherwise your file
 // will just accumulate lots of mess, only to become invisible
 
 // Draw something good here
 if (mousePressed) {
   line(pmouseX, pmouseY, mouseX, mouseY);
 }
}

void keyPressed() {
 if (key == 'r') {
   if (recording) {
     endRecord();
     println("Recording stopped.");
     recording = false;
   } else {
     beginRecord(pdf);
     println("Recording started.");
     recording = true;
   }
 } else if (key == 'q') {
   if (recording) {
     endRecord();
   }
   exit();
 }
}



Unfortunately this example overwrites the previous recording. I mean you can keep in the PDF file only the last sequence of your drawing.
Is there a way you could append the lines over and over or even press a key for nextPage() or something

Thanks in advance

5  Discussion / Events,  Publications,  Opportunities / Re: online processing classes
 on: Jul 28th, 2010, 3:41pm 
Started by geoffroy | Post by Joseph Gray  
The course mentioned below is being offered here now:

http://training.oreilly.com/arduino/

Cheers!
-Joe


Joseph Gray wrote on Jun 4th, 2010, 3:31pm:
Hi,

Interesting that you ask.  I'm developing a class right now with O'Reilly Media that will be starting August 31st.  It will be a live, free, video course, while it's going.  There will also be a pay version that includes downloads (pdf of all slides etc.) and access to the videos anytime.

It will be at http://training.oreilly.com and you can send an email to training@oreilly.com to be notified when the class is available.

Cheers,
Joseph Gray
http://grauwald.com


6  Programming Questions & Help / Other Libraries / Re: using cocoa library to run applescript
 on: Jul 5th, 2010, 8:34am 
Started by sean.duncan | Post by brsma  
Wind Up Toy wrote on Mar 27th, 2010, 2:07pm:
I also cannot find "com" inside my /System/Library/Java folder...

OS X 10.6.2


The Java/Cocoa bridge has been removed by Apple in 10.6. :-( AFAIK you can use the files from 10.5 – or switch to http://code.google.com/p/rococoa/

7  Programming Questions & Help / Programs / Re: Using light, shading 3d
 on: Jun 30th, 2010, 1:31am 
Started by Cedric | Post by hexenez  
Hi everyone !

I'm pretty near the solution, but I cant make it work:

I've got a sketch running with toxiclib's triangleMesh.
I've got another one running with surfaceLib.

They both work fine, and i can use useVertexNormals() with surfaceLib, but I can't figure out how to connect those two.
I understand that it's possible to have a toxiclib's triangleMesh with the nice useVertexNormals from surfaceLib. But how ?!
Does anyone have an example ?

Thanks for your help

8  Programming Questions & Help / Video Capture,  Movie Playback,  Vision Libraries / Re: camara resolution erratic / windows 7x64 & Vista
 on: Jun 23rd, 2010, 7:13pm 
Started by maer | Post by vjfader  
I was having the same issue with video capture being distorted in Windows 7.

Just installed winVDIG version 1.01 (not 1.05), it did the trick. You may download here: http://www.eden.net.nz/7/20071008/

9  Programming Questions & Help / Programs / Re: Program to find the shortest path
 on: Jun 18th, 2010, 12:50pm 
Started by Ryan.pennell | Post by Ryan.pennell  
ox and oy is the x and y cordinates of the object that needs to move to the goal.  gx and gy is the x and y position of the goal.  thanks for the out of bounds comment.  I'll try that.

10  Programming Questions & Help / Syntax Questions / why the outer circle does not fade away
 on: Jun 18th, 2010, 12:37pm 
Started by archieboy | Post by archieboy  
I'm just testing minim library, I want to create cirles that are fading away eventually. I get the main circle work(which radius is 2*radius), and I don't know why the outer ring doesn't work.

P.S.: you need to change the add your own mp3 to the data folder.

Code:
import processing.video.*;
import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.*;


Minim minim;
AudioPlayer song;
//WaveformRenderer waveform;
FFT fft;
ArrayList trails;
MovieMaker mm;
boolean play = false;

void setup()
{
size(1024, 800);
background(0);
smooth();
//frameRate(128);
//mm = new MovieMaker(this, width,height,"bubbles.mov",30,MovieMaker.VIDEO, MovieMaker.LOSSLESS);
// always start Minim first!
minim = new Minim(this);

// specify 1024 for the length of the sample buffers
// the default buffer size is 1024
song = minim.loadFile("糖不厌.mp3", 1024);
play();

//waveform = new WaveformRenderer();
//song.addListener(waveform);

// an FFT needs to know how
// long the audio buffers it will be analyzing are
// and also needs to know
// the sample rate of the audio it is analyzing
fft = new FFT(song.bufferSize(), song.sampleRate());

trails = new ArrayList();

}

void play(){
if(play == true) song.play();
}

void draw()
{

//waveform.draw();
//spectrum
// first perform a forward fft on one of song's buffers
// I'm using the mix buffer
// but you can use any one you like
fft.forward(song.mix);

//stroke(255, 0, 0, 128);
//strokeWeight(5);
// draw the spectrum as a series of vertical lines
// I multiple the value of getBand by 4
// so that we can see the lines better
for(int i = 0; i < (fft.specSize()-1)*2; i+=1024/(fft.specSize()-1))
{
//line(i, height, i, height - fft.getBand(i)*5);

if(dist(i,height, i, height - fft.getBand(i)*5)>height/20){
Circle c = new Circle(int(random(0,width)), int(random(0,height)), random(10,50), 255);
c.drawOneCircle();
}
}

//trails
for(int j = 0; j < trails.size(); j++){
Trail t = (Trail) trails.get(j);
t.update();
t.drawOneCircle();
}


//waveform
stroke(255);
strokeWeight(0);
// we draw the waveform by connecting neighbor values with a line
// we multiply each of the values by 50
// because the values in the buffers are normalized
// this means that they have values between -1 and 1.
// If we don't scale them up our waveform
// will look more or less like a straight line.
for(int i = 0; i < song.bufferSize() - 1; i++)
{
// line(i, height/2 - 50 + song.left.get(i)*50, i+1, height/2 - 50 + song.left.get(i+1)*50);
// line(i, height/2 + 50 + song.right.get(i)*50, i+1, height/2 + 50 + song.right.get(i+1)*50);
// line(i, height/2 + song.mix.get(i)*50, i +1, height/2 + song.mix.get(i+1)*50);
}

//mm.addFrame();


}

void stop()
{
song.close();
minim.stop();

super.stop();
}

void keyPressed(){
if(key == 'f'){
mm.finish();
println("movie saved");
}

if ( key == 'p' ) {
play = true;
play();
}
}

class Circle{
//variable
int posx;
int posy;
float radius;
float magnatude;

//constructor
Circle(int _posx, int _posy, float _radius, float _magnatude){
posx = _posx;
posy = _posy;
radius = _radius;
magnatude = _magnatude;
}

//method
void drawOneCircle(){

noStroke();
fill(magnatude,10);
ellipse(posx,posy,radius*4,radius*4);
//fill(magnatude,magnatude,magnatude,10);
ellipse(posx,posy,radius*3,radius*3);
//fill(magnatude,magnatude,magnatude,10);
ellipse(posx,posy,radius*2.5,radius*2.5);

//stroke(0,60);
fill(magnatude);
ellipse(posx,posy,radius*2,radius*2);


//color
//noStroke();
// for(int k = 1; k < 30; k++){
// fill(random(0,magnatude),random(0,magnatude),random(0,magnatude),20);
// arc(posx, posy, radius*2, radius*2, random(0,2*PI), random(0,2*PI));
// }


// for(float i = 0.0; i < 2.0*PI; i+=0.5-radius/200){
// stroke(0,random(0,100));
// line(posx,posy,posx+sin(i)*radius,posy+cos(i)*radius);
// }

trails.add(new Trail(posx, posy, radius, magnatude));

}


}

class Trail{
//variable
int posx;
int posy;
float radius;
float magnatude;

//constructor
Trail(int _posx, int _posy, float _radius, float _magnatude){
posx = _posx;
posy = _posy;
radius = _radius;
magnatude = _magnatude;
}

//method
void update(){
magnatude-=30;

if(magnatude < 0){
trails.remove(this);
//println("circle remove");
}
}

void drawOneCircle(){

noStroke();
fill(magnatude,10);
ellipse(posx,posy,radius*4,radius*4);
//fill(magnatude,magnatude,magnatude,10);
ellipse(posx,posy,radius*3,radius*3);
//fill(magnatude,magnatude,magnatude,10);
ellipse(posx,posy,radius*2.5,radius*2.5);

//stroke(0,60);
fill(magnatude);
ellipse(posx,posy,radius*2,radius*2);


//color
// noStroke();
// for(int k = 1; k < 30; k++){
// fill(random(0,magnatude),random(0,magnatude),random(0,magnatude),20);
// arc(posx, posy, radius*2, radius*2, random(0,2*PI), random(0,2*PI));
// }


// for(float i = 0.0; i < 2.0*PI; i+=0.5-radius/200){
// stroke(0,random(0,100));
// line(posx,posy,posx+sin(i)*radius,posy+cos(i)*radius);
// }

}


}