Yah, I think you're right. I tried everything available in Acrobat Pro and could not reveal the font. Ah well. Too bad. I am now trying out pycairo. It is much more of a PITA to install and write scripts for, but it has a much more mature, well-documented PDF output module. It does embed subsets of system fonts only, which is undesirable for sending to a service provider. I found a simple workaround for this. pycairo can also output to a PS (postscript) file that can be converted in GhostView (GhostScript GUI) to PDF. I set EmbedAllFonts to true and SubsetFonts to false and the PDF now contains full embedded fonts. Great.
↧
Re : No font in exported PDF
↧
Re : Calendar class related error in latest Processing 2.0b7
I had the same problem.
PROCESSING 2.0b7 (REV 0215) - 7 December 2012 475,382 bug fixes in this release as we work on finalizing 2.0. [ changes ] + Removed all imports that aren't covered in the Processing reference. If you use java.awt, java.util, or other classes in your sketch, you will need to add an import line to the beginning of your sketch.
Solution
Put this line on top of the program
- import java.util.Calendar;
↧
↧
then get busy
Just learn to be a bit more disciplined. Are you really hungry? If so think about what you eat... something small and sugary or ‘empty calories’ will not be filling and will have you hungry again very quickly. If you are searching for food through boredom then get busy – look for something to do, not something to eat!
chelsea vs qpr live stream - qpr vs chelsea live stream - liverpool vs sunderland live stream - sunderland vs liverpool live stream - everton vs newcastle live stream - newcastle united vs everton live stream
chelsea vs qpr live stream - qpr vs chelsea live stream - liverpool vs sunderland live stream -*
chelsea vs qpr live stream - liverpool vs sunderland live stream - everton vs newcastle live stream -*
sunderland vs liverpool live stream - everton vs newcastle live stream - newcastle united vs everton live stream
chelsea vs qpr live stream - qpr vs chelsea live stream - liverpool vs sunderland live stream - sunderland vs liverpool live stream - everton vs newcastle live stream - newcastle united vs everton live stream
chelsea vs qpr live stream - qpr vs chelsea live stream - liverpool vs sunderland live stream - sunderland vs liverpool live stream - everton vs newcastle live stream - newcastle united vs everton live stream
chelsea vs qpr live stream - qpr vs chelsea live stream - liverpool vs sunderland live stream -*
chelsea vs qpr live stream - liverpool vs sunderland live stream - everton vs newcastle live stream -*
sunderland vs liverpool live stream - everton vs newcastle live stream - newcastle united vs everton live stream
chelsea vs qpr live stream - qpr vs chelsea live stream - liverpool vs sunderland live stream - sunderland vs liverpool live stream - everton vs newcastle live stream - newcastle united vs everton live stream
↧
Re : How to port old PGraphicsOpenGL code to Processing 2 alpha - Additive Blending
For the blending problem, you should be able to replace the opengl calls with blendMode(ADD). This is a new function added in Processing which sets screen blending with OpenGL under P2D and P3D for most of the blending modes supported by blend.
Enclosing the drawing calls for your semi-transparent geometry between hint(DISABLE_DEPTH_MASK) / hint(ENABLE_DEPTH_MASK) could help to minimize artifacts due to the lack of depth-sorting.
About the noise that appears momentarily when the sketch starts, this is an acknowledged issue.
↧
Re : [2.0xx] How to set multiple render targets for a fragment shader?
I think that GLES 2.0 doesn't support multiple render targets. On the other hand, OpenGL desktop does support MRT (by writing to gl_FragData[0], gl_FragData[1], etc in the fragment shader), and the FrameBuffer class in the opengl renderer does allow you to attach several textures to an FBO. However the functionality is not used by the P2D/P3D renderers. You could enable it by subclassing your own renderer from PGraphicsOpenGL and overriding the initOffscreen() method and adding all the necessary code to attach textures to the color attachement points after 0.
↧
↧
Color tracking. How to detect colors clashing?
Hi.
I'm working on a game as part of a school assignment, the basics is that it's a fighting game in real life. What I need to do is track two colors (or possibly more but two will do for now) and I need to have an image appear on screen when two colors collide or clash (when their x and y coordinates are the same basically). I have been away from programming for a couple of years and could use some help with this.
I'm using the following code from the "Learning Processing" book to track colors, which works fine but I have no clue how to add this last part that I described above.
CODE: http://www.learningprocessing.com/examples/chapter-16/example-16-11/
Any help is appriciated!
↧
Trying to compile two sketches on one
So, I am new to processing and I am trying to do a sketch that uses the webcam to take a picture and within that image sample color from a specified area (pixel). What I did was make two sketches separately: one that takes the picture and saves it, and a second one that takes the saved picture and samples color from the specified area.
Now what i want to do is compile it into one sketch...
This is the one that captures the image and saves it
I would really appreciate any help that i can get from you guys
Now what i want to do is compile it into one sketch...
This is the one that captures the image and saves it
And this is the one that samples the color
/**
* Getting Started with Capture.
*
* Reading and displaying an image from an attached Capture device.
*/
import processing.video.*;
Capture cam;
void setup() {
size(640, 480, P2D);
String[] cameras = Capture.list();
if (cameras.length == 0) {
println("There are no cameras available for capture.");
exit();
} else {
println("Available cameras:");
for (int i = 0; i < cameras.length; i++) {
println(cameras[i]);
}
// The camera can be initialized directly using an element
// from the array returned by list():
cam = new Capture(this, cameras[0]);
cam.start();
}
}
void draw() {
if (cam.available() == true) {
cam.read();
}
image(cam, 0, 0);
// The following does the same, and is faster when just drawing the image
// without any additional resizing, transformations, or tint.
//set(0, 0, cam);
}
void keyPressed() {
if (key == ' ')
saveFrame("../pics/1.jpg");
}
/**I have saved the sketches in different folders of the same name of the sketch and the pictures are saved in one folder up from the sketches in a pics folder
* Pixel Array.
*
* Click and drag the mouse up and down to control the signal and
* press and hold any key to see the current pixel being read.
* This program sequentially reads the color of every pixel of an image
* and displays this color to fill the window.
*/
// The next line is needed if running in JavaScript Mode with Processing.js
/* @pjs preload="sea.jpg"; */
PImage img;
int direction = 0;
float signal;
void setup() {
size(640, 480);
noFill();
stroke(255);
frameRate(30);
}
void draw() {
img = loadImage("../pics/1.jpg");
redraw();
if (signal > img.width*img.height-1 || signal < 0) {
direction = direction * -1;
}
if (mousePressed) {
int mx = constrain(mouseX, 0, img.width-1);
int my = constrain(mouseY, 0, img.height-1);
signal = my*img.width + mx;
} else {
signal += 0.33*direction;
}
int sx = int(signal) % img.width;
int sy = int(signal) / img.width;
if (keyPressed) {
set(0, 0, img); // fast way to draw an image
point(sx, sy);
rect(sx - 5, sy - 5, 10, 10);
} else {
color c = img.get(sx, sy);
background(c);
}
}
I would really appreciate any help that i can get from you guys
↧
Re : Trying to compile two sketches on one
Don't call loadImage() in draw()!
Actually, don;t call loadImage() at all.
There is no need to save the file to disk while merging the two sketches.
Actually, don;t call loadImage() at all.
There is no need to save the file to disk while merging the two sketches.
You can create a PImage from the camera directly:
img = cam.get();
↧
Re : Color tracking. How to detect colors clashing?
So your process should be:
Draw the camera's image.
Scan the image for the pixels that are the best match to the first and second colors.
Draw the camera's image.
Scan the image for the pixels that are the best match to the first and second colors.
Record their X and Y positions. (Hint: X1, Y1, X2, Y2.)
Determine the distance between those two points. (Hint: Use the dist() function!)
If the distance is small, (Hint: If( dist( X1, Y1, X2, Y2 ) < someValue ){ )
Then draw something near them (Hint: imageMode(CENTER); image( theImage, X1+X2/2.0, Y1+Y2/2.0); )
If the distance is small, (Hint: If( dist( X1, Y1, X2, Y2 ) < someValue ){ )
Then draw something near them (Hint: imageMode(CENTER); image( theImage, X1+X2/2.0, Y1+Y2/2.0); )
That should get you started!
Remember: You don't have to scan the image TWICE! Just ONCE, remembering TWO different "best matching" points.
Remember: You don't have to scan the image TWICE! Just ONCE, remembering TWO different "best matching" points.
↧
↧
Re : [2.0xx] How to set multiple render targets for a fragment shader?
Thanks for your response andres. I gave this a shot. However when I try to use the FrameBuffer class, I'm running into visibility issues for it's methods, fields and constructors. Is there a way around this or am I handling this in the wrong way perhaps?
PGraphicsCustom.java
PGraphicsCustom.java
- import processing.opengl.PGraphics3D;
- import processing.opengl.FrameBuffer;
- import processing.opengl.Texture;
- public class PGraphicsCustom extends PGraphics3D {
- public PGraphicsCustom() {
- super();
- }
- public void initOffscreen() {
- super.initOffscreen();
- // Error message: "The method release() from the type FrameBuffer is not visible"
- // offscreenFramebuffer.release();
- // Error message: "The constructor FrameBuffer(...) is not visible"
- // offscreenFramebuffer = new FrameBuffer(parent, texture.glWidth, texture.glHeight,
- 1, 2, 0, 0, false, false);
- Texture[] multiTex = new Texture[2];
- // Error message: "The field FrameBuffer.numColorBuffers is not visible"
- // offscreenFramebuffer.numColorBuffers = 2;
- // Error message: "Wrong number of textures to set the color buffers."
- // offscreenFramebuffer.setColorBuffers(multiTex);
- }
- }
↧
Re : Trying to compile two sketches on one
Hi
I couldn't follow what you were suggesting me before, so i tried something different and it is more simple now...
So I was advancing a little on the idea. No I have other problem. I need the sample color data to go to a text file (colors.txt) in a single line everytime I press SPACE (take a picture) so I use the output.println to add the hex data color to the text file but it only works once per session.
So my question is how can I make the println value to overwrite the last value?
Or, how I add a single line of the println to the text file?
Thanks
/**
* Getting Started with Capture.
*
* Reading and displaying an image from an attached Capture device.
*/
PImage img;
PrintWriter output;
import processing.video.*;
Capture cam;
void setup() {
size(640, 480, P2D);
output = createWriter("colors.txt");
String[] cameras = Capture.list();
if (cameras.length == 0) {
println("There are no cameras available for capture.");
exit();
}
else {
println("Available cameras:");
for (int i = 0; i < cameras.length; i++) {
println(cameras[i]);
}
// The camera can be initialized directly using an element
// from the array returned by list():
cam = new Capture(this, cameras[0]);
cam.start();
}
}
void draw() {
if (cam.available() == true) {
cam.read();
}
image(cam, 0, 0);
// The following does the same, and is faster when just drawing the image
// without any additional resizing, transformations, or tint.
//set(0, 0, cam);
img = loadImage("../pics/1.jpg");
colorMode(RGB);
color cp = img.get(320, 360);
fill(cp);
rect(30, 20, 55, 55);
println(hex(cp, 6));
output.println(hex(cp, 6));
output.flush();
output.close();
}
void keyPressed() {
if (key == ' ')
saveFrame("../pics/1.jpg");
}
I couldn't follow what you were suggesting me before, so i tried something different and it is more simple now...
So I was advancing a little on the idea. No I have other problem. I need the sample color data to go to a text file (colors.txt) in a single line everytime I press SPACE (take a picture) so I use the output.println to add the hex data color to the text file but it only works once per session.
So my question is how can I make the println value to overwrite the last value?
Or, how I add a single line of the println to the text file?
Thanks
/**
* Getting Started with Capture.
*
* Reading and displaying an image from an attached Capture device.
*/
PImage img;
PrintWriter output;
import processing.video.*;
Capture cam;
void setup() {
size(640, 480, P2D);
output = createWriter("colors.txt");
String[] cameras = Capture.list();
if (cameras.length == 0) {
println("There are no cameras available for capture.");
exit();
}
else {
println("Available cameras:");
for (int i = 0; i < cameras.length; i++) {
println(cameras[i]);
}
// The camera can be initialized directly using an element
// from the array returned by list():
cam = new Capture(this, cameras[0]);
cam.start();
}
}
void draw() {
if (cam.available() == true) {
cam.read();
}
image(cam, 0, 0);
// The following does the same, and is faster when just drawing the image
// without any additional resizing, transformations, or tint.
//set(0, 0, cam);
img = loadImage("../pics/1.jpg");
colorMode(RGB);
color cp = img.get(320, 360);
fill(cp);
rect(30, 20, 55, 55);
println(hex(cp, 6));
output.println(hex(cp, 6));
output.flush();
output.close();
}
void keyPressed() {
if (key == ' ')
saveFrame("../pics/1.jpg");
}
↧
Re : Trying to compile two sketches on one
As tfguy44 said, avoid loading the image in draw(), because accessing such file 60 times per second isn't necessary / useful, it can only slow down your sketch.
You can load it in setup(), even more as img is already a global variable.
I see you save this image (in the same location? not sure...) on keyPressed(), so you might need to reload it at the same time (although I fail to see why you go through a file, something like PImage.copy() or PImage.get() can do the same thing faster).
I am not too sure of what you want to do: keep an history of the colors? Only keep the latest?
In the second case, a simple saveStrings() can do the job too.
You can load it in setup(), even more as img is already a global variable.
I see you save this image (in the same location? not sure...) on keyPressed(), so you might need to reload it at the same time (although I fail to see why you go through a file, something like PImage.copy() or PImage.get() can do the same thing faster).
I am not too sure of what you want to do: keep an history of the colors? Only keep the latest?
In the second case, a simple saveStrings() can do the job too.
↧
Controlling Video
Hello I am about to undertake a project using Processing and it involves controlling a video using keys on a keyboard.
Initially, the 'Frames' example caught my eye..
and I want to be able to control my video using numbers 1 to 5...
'1' Pauses the video (and a pause symbol appears in the middle)
When paused, by pressing '1' again, it continues to play it.
'2' stop the video.
Holding '3' rewinds it.
and Holding '4' fast-forwards the video.
If it helps I am using version 2.0b3
Could anybody please help me to get started as I am new to Processing and I am finding it hard, but I am eager to learn as I find it very interesting seeing what can be created.
Thank you
↧
↧
Minim - AudioOutput - how do you know the song is done ?
Hi there,
I'm new on Processing and Minim and i was looking at the ADSR example in UGEN (Minim BETA) to help me for my project and I don't understand how you can know when the song played is done playing ?
I've been looking for some time now in the Javadoc and can't find an answer.
I have to use the AudioOutput object (I use the playNote() method).
Can anyone help me with this ?
Thx a lot !
K
I'm new on Processing and Minim and i was looking at the ADSR example in UGEN (Minim BETA) to help me for my project and I don't understand how you can know when the song played is done playing ?
I've been looking for some time now in the Javadoc and can't find an answer.
I have to use the AudioOutput object (I use the playNote() method).
Can anyone help me with this ?
Thx a lot !
K
↧
enough to leave
propelled her to global recognition, Malala was targeted in Pakistan by Taliban gunmen for speaking out in favor of education for Pakistani girls. She was left with life-threatening head and neck wounds.
man city vs watford live stream - man city vs watford live stream - manchester city vs watford live stream - Aston villa vs ipswich live stream - Aston villa vs ipswich live stream - southampton vs chelsea live stream - chelsea vs southampton live stream - chelsea vs southampton live stream - chelsea vs southampton live stream - west ham vs man utd live stream - man utd vs west ham live stream - man utd vs west ham live stream - manchester united vs west ham live stream - Tottenham vs coventry live stream - Tottenham hotspur vs coventry live stream - qpr vs west brom live stream - bolton vs sunderland live stream - sunderland vs bolton live stream - sunderland vs bolton live stream - Brighton vs Newcastle Live Stream - Newcastle vs Brighton Live Stream - Newcastle vs Brighton Live Stream - fulham vs blackpool live stream - fulham vs blackpool live stream - arsenal vs swansea live stream - arsenal vs swansea live stream - arsenal vs swansea live stream - swansea vs arsenal live stream - liverpool vs mansfield live stream - liverpool vs mansfield live stream - liverpool vs mansfield live stream - mansfield vs liverpool live stream - Real Madrid vs Real Sociedad live stream - Real Madrid vs Real Sociedad live stream - barcelona vs espanyol live stream - barcelona vs espanyol live stream - Leeds vs Birmingham live stream - Leeds vs Birmingham live stream - Cheltenham vs Everton live stream - Cheltenham vs Everton live stream - Everton vs Cheltenham live stream - Everton vs Cheltenham live stream - Bengals vs Texans live stream - Texans vs Bengals live stream - Houston Texans vs Cincinnati Bengals live stream - Cincinnati Bengals vs Houston Texans live stream - Vikings vs Packers Live stream - Packers vs Vikings Live stream - Minnesota Vikings vs Green Bay Packers Live stream - Green Bay Packers vs Minnesota Vikings Live stream - AFC Wild Card 2013 live stream - AFC Wild Card Bengals vs Texans live stream - NFC Wild Card 2013 live stream - NFC Wild Card Vikings vs Packers live stream - live stream - AFC Wild Card 2013 live stream - NFC Wild Card 2013 live stream - BCS National Championship 2013 Live Stream - BCS National Championship 2013 Live Stream - BCS National Championship 2013 Live Stream - BCS National Championship 2013 Live Stream - BCS Championship 2013 Live Stream - BCS Championship 2013 Live Stream - BCS Championship 2013 Live Stream - Notre Dame vs Alabama Live Stream - Notre Dame vs Alabama Live Stream - BCS Notre Dame vs Alabama Live Stream ------ Brighton and Hove Albion vs Newcastle United Live Stream
man city vs watford live stream - man city vs watford live stream - manchester city vs watford live stream - Aston villa vs ipswich live stream - Aston villa vs ipswich live stream - southampton vs chelsea live stream - chelsea vs southampton live stream - chelsea vs southampton live stream - chelsea vs southampton live stream - west ham vs man utd live stream - man utd vs west ham live stream - man utd vs west ham live stream - manchester united vs west ham live stream - Tottenham vs coventry live stream - Tottenham hotspur vs coventry live stream - qpr vs west brom live stream - bolton vs sunderland live stream - sunderland vs bolton live stream - sunderland vs bolton live stream - Brighton vs Newcastle Live Stream - Newcastle vs Brighton Live Stream - Newcastle vs Brighton Live Stream - fulham vs blackpool live stream - fulham vs blackpool live stream - arsenal vs swansea live stream - arsenal vs swansea live stream - arsenal vs swansea live stream - swansea vs arsenal live stream - liverpool vs mansfield live stream - liverpool vs mansfield live stream - liverpool vs mansfield live stream - mansfield vs liverpool live stream - Real Madrid vs Real Sociedad live stream - Real Madrid vs Real Sociedad live stream - barcelona vs espanyol live stream - barcelona vs espanyol live stream - Leeds vs Birmingham live stream - Leeds vs Birmingham live stream - Cheltenham vs Everton live stream - Cheltenham vs Everton live stream - Everton vs Cheltenham live stream - Everton vs Cheltenham live stream - Bengals vs Texans live stream - Texans vs Bengals live stream - Houston Texans vs Cincinnati Bengals live stream - Cincinnati Bengals vs Houston Texans live stream - Vikings vs Packers Live stream - Packers vs Vikings Live stream - Minnesota Vikings vs Green Bay Packers Live stream - Green Bay Packers vs Minnesota Vikings Live stream - AFC Wild Card 2013 live stream - AFC Wild Card Bengals vs Texans live stream - NFC Wild Card 2013 live stream - NFC Wild Card Vikings vs Packers live stream - live stream - AFC Wild Card 2013 live stream - NFC Wild Card 2013 live stream - BCS National Championship 2013 Live Stream - BCS National Championship 2013 Live Stream - BCS National Championship 2013 Live Stream - BCS National Championship 2013 Live Stream - BCS Championship 2013 Live Stream - BCS Championship 2013 Live Stream - BCS Championship 2013 Live Stream - Notre Dame vs Alabama Live Stream - Notre Dame vs Alabama Live Stream - BCS Notre Dame vs Alabama Live Stream ------ Brighton and Hove Albion vs Newcastle United Live Stream
Brighton vs Newcastle Utd Live Stream
Macclesfield Town vs Cardiff City Live Stream
Middlesbrough vs Hastings United live stream
Bolton vs Sunderland live stream
Sunderland vs Bolton live stream
Bolton Wanderers vs Sunderland live stream
Sheffield Wednesday vs Milton Keynes Dons live stream
Wednesday vs Keynes Dons live stream
Crawley Town vs Reading live stream
Town vs Round live stream
Barnsley vs Burnley live stream
Aldershot Town vs Rotherham United live stream
Southampton vs Chelsea live stream
Chelsea vs Southampton live stream
Chelsea vs Southampton live stream
Chelsea vs Southampton live stream
Nottingham Forest vs Oldham Athletic live stream
Leicester City vs Burton Albion live stream
Blackburn Rovers vs Bristol City live stream
Derby vs Tranmere Rovers live stream
Millwall vs Preston live stream
Manchester City vs Watford live stream
Man City vs Watford live stream
Man City vs Watford live stream
Luton Town vs Wolverhampton live stream
Oxford vs Sheffield live stream
Southend vs Brentford live stream
Leeds United vs Birmingham City live stream
Hull City vs Lleyton live stream
Peterborough United vs Norwich City live stream
Queens Park Rangers vs West Bromwich Albion live stream
Qpr vs West Brom live stream
Charlton Athletic vs Huddersfield Town live stream
Tottenham Hotspur vs Coventry City live stream
Tottenham vs Coventry live stream
Aston Villa vs Ipswich Town live stream
Crystal Palace vs Stoke City live stream
Fulham vs Blackpool live stream
Fulham vs Blackpool live stream
West Ham United vs Manchester United live stream
West Ham vs Man United Live Stream
Man United vs West Ham Live Stream
Manchester United vs West Ham Live Stream
Man United vs West Ham Live Stream
Macclesfield Town vs Cardiff City Live Stream
Middlesbrough vs Hastings United live stream
Bolton vs Sunderland live stream
Sunderland vs Bolton live stream
Bolton Wanderers vs Sunderland live stream
Sheffield Wednesday vs Milton Keynes Dons live stream
Wednesday vs Keynes Dons live stream
Crawley Town vs Reading live stream
Town vs Round live stream
Barnsley vs Burnley live stream
Aldershot Town vs Rotherham United live stream
Southampton vs Chelsea live stream
Chelsea vs Southampton live stream
Chelsea vs Southampton live stream
Chelsea vs Southampton live stream
Nottingham Forest vs Oldham Athletic live stream
Leicester City vs Burton Albion live stream
Blackburn Rovers vs Bristol City live stream
Derby vs Tranmere Rovers live stream
Millwall vs Preston live stream
Manchester City vs Watford live stream
Man City vs Watford live stream
Man City vs Watford live stream
Luton Town vs Wolverhampton live stream
Oxford vs Sheffield live stream
Southend vs Brentford live stream
Leeds United vs Birmingham City live stream
Hull City vs Lleyton live stream
Peterborough United vs Norwich City live stream
Queens Park Rangers vs West Bromwich Albion live stream
Qpr vs West Brom live stream
Charlton Athletic vs Huddersfield Town live stream
Tottenham Hotspur vs Coventry City live stream
Tottenham vs Coventry live stream
Aston Villa vs Ipswich Town live stream
Crystal Palace vs Stoke City live stream
Fulham vs Blackpool live stream
Fulham vs Blackpool live stream
West Ham United vs Manchester United live stream
West Ham vs Man United Live Stream
Man United vs West Ham Live Stream
Manchester United vs West Ham Live Stream
Man United vs West Ham Live Stream
↧
Processing audio player customization?
Hey people,
I am new to all this processing stuff (not familiar with all the fancy terms yet) but have a quick question. I am using the following code to match music played with processing to control PWMs on my arduino. Unfortunately the music player that opens if very simple. I can't play/pause the music or fast forward/rewind. Just curious if there is anything to add that might add some more features to the music player?
Thanks
-NJ
Edit: I forgot to mention that I am using processing 1.5.1 for this. No other version will work with this stuff.
//processing code for communicating with arduino using
//Firmata library.
//In the arduino I've uploaded the StandardFirmata sketch.
//this program blink 5 leds in pins 3,5,6,9,10
//detecting music rythm
//Code by Damiano Andreghetti
//Example song: No time to stop - Luca Guardigli
//For more information visit www.ilblogdidami.blogspot.com
import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*; //Import ddf.minim library
import processing.serial.*; //Import serial library
import cc.arduino.*; //Import Arduino library
Arduino arduino;
Minim minim;
AudioPlayer song;
FFT fft;
//I create the objects
//To play another song change the song_file value
String song_file = "mag3.mp3";
int xmax = 600; //window width
int ymax = 300;//window height
void setup()
{
size(xmax, ymax);
minim = new Minim(this);
arduino = new Arduino(this, "COM5", 57600);
song = minim.loadFile(song_file);
song.play();
fft = new FFT(song.bufferSize(), song.sampleRate());
// in this function I create the minim object, I start
//communicating with Arduino,I load the song and I play it and
// I start the Fast Fourier Transofrm
}
void draw()
{
background(0);
fft.forward(song.mix);
stroke(127, 255, 0, 200); //I set the color of my lines
for(int i = 10; i < fft.specSize(); i++){
line(i, height-30, i, height - (30+fft.getFreq(i*10)));
// I create lines that represent the amplitude
// of each frequency.
text("Min Freq", 10, height-10);
text("Max Freq", fft.specSize(), height-10);
}
ledcontrol(); //I call the function for the arduino
}
void ledcontrol(){
//In this function I use arduino analogWrite function
// to write in PWM pins the amplitude
// of five general frequency
// arduino.analogWrite(6, gate(120,100));
//arduino.analogWrite(5, gate(80,80));
arduino.analogWrite(3, gate(120,100));
//arduino.analogWrite(5, int(fft.getFreq(60)));
// arduino.analogWrite(6, int(fft.getFreq(220)));
// arduino.analogWrite(3, gate(64,200));
// arduino.analogWrite(6, gate(300,100));
// arduino.analogWrite(3, gate(220,100));
// arduino.analogWrite(5, gate(120,100));
// arduino.analogWrite(3, int(fft.getFreq(220)));
// arduino.analogWrite(3, int(fft.getFreq(1000)));
// arduino.analogWrite(6, int(fft.getFreq(600)));
// arduino.analogWrite(5, int(fft.getFreq(1000)));
}
int gate(int i, int j)
{
if(int(fft.getFreq(i))>j)
{
return 255;
}
return 0;
}
↧
Re : Processing audio player customization?
there actually is
(just look here: http://code.compartmental.net/minim/javadoc/ in AudioPlayer)
for example:
player.pause()
&
player.cue(int millis) which can be used to cue back to 0 or any desired position.
if hooked up to the controlP5 gui slider for example you can then even slide through your track like in any other player.
BUT
i always had big problems here with syncronisation, as it wont do this imediatly and sometime after a pause, new cue, and play, it would play a last snipplet from the old cue and then continue with the new, which is rather annoying.
So if you find a good way here, I'd be happy to know.
↧
↧
Where is my PDF?
OK, I fully realize I must be doing something extremely stupid and yes, I've looked through this forum for an answer but...
When I copy and run a simple demo program on Windows 7 using the vanilla download of Processing 2.0b7, namely:
import processing.pdf.*;
void setup() {
size(400, 400, PDF, "testfile.pdf"); }
void draw() {
// Draw something good here
line(0, 0, width/2, height);
// Exit the program
println("Finished."); exit(); }
I get no errors, 'Finished' is printed but there's no pdf. What am I doing wrong?
MTIA,
HH
↧
Re : Where is my PDF?
Resulting .pdf is rendered in the same folder as the source .pde.
Use CTRL+K to open the folder where current .pde is in.
Use CTRL+K to open the folder where current .pde is in.
↧
Re : Where is my PDF?
Simples.
Because I was just pasting an example without saving, there was no .pde folder created. 'Save' and the problem is solved.
Many thanks.
HH
↧