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.
Page Index Toggle Pages: 1
tablet library (Read 3870 times)
tablet library
Jan 9th, 2009, 2:44am
 
I wrapped the classes from the JPen package into a simpler library for accessing graphical tablets in Processing. More info a download link here:

http://codeanticode.wordpress.com/2009/01/08/protablet-tablet-library-for-processing-based-on-jpen/
Re: tablet library
Reply #1 - Jan 8th, 2010, 11:17am
 
ac,

Your wrapper is excellent! I have a couple of questions:

When you're using the JPen library, do you have to call some function to stop it or release resource when you close your program?

I found my genius-brand tablet lose its pressure reading after I start my sketch and stop it a few times but this occurs randomly. The tablet pen becomes a mouse pointer and its pressure is either 0 or 0.5 I guess. My solution is to unplug it and plug it back. Maybe it's my tablet or maybe I didn't release some resource and that prevents future access to the tablet.

Any help is highly appreciated.
Re: tablet library
Reply #2 - Jan 27th, 2010, 2:35pm
 
This is great - looking forward to getting it working....

I can't get the example to work yet .I get a message telling me the package "codeanticode" does not exist. I did place the unzipped files in the usual place for library files - other libraries are working fine....
Re: tablet library
Reply #3 - Jan 27th, 2010, 6:06pm
 
It's working fine for me.
libraries\protablet\library is it what you have?

Also, I was so pleased to play back with my tablet, it went fluidly and I was so productive that I've almost forgotten to say thank you.

Thank you very much!...
Re: tablet library
Reply #4 - Jan 28th, 2010, 10:59am
 
Nope...I've tried putting different library resources in various places, but I still can't get it to go. Can anyone tell me where different components are supposed to be placed?

I have put the Jar files in the sketches/libraries/ folder. I also placed the whole protablet folder in this driectory, which didn't help.

I got Philho's demo using jpen working, so obviously everything is working java-wise and hardware-wise. I'm still getting a ClassNotFoundException: jpen.event.penlistener with this one, though.
Re: tablet library
Reply #5 - Jan 28th, 2010, 12:19pm
 
I tested my tablet demo code with jpen-2.dll and jpen-2.jar in a code folder in the sketch folder.
Re: tablet library
Reply #6 - Jan 28th, 2010, 4:18pm
 
Yes!! Thanks, that was the missing element.
Re: tablet library
Reply #7 - Feb 15th, 2010, 3:30pm
 
Just thought I'd post a simple program I made using this - using the tablet as a simple synthesiser (very basic). I've still got using the tablet for something in the back of my mind.... I might even develop this program more with buttons etc for turning different effects on and off - or maybe using the existing buttons on the Wacom tablet.

Code:
import ddf.minim.*;
import ddf.minim.signals.*;
import codeanticode.protablet.*;

Minim minim;
AudioOutput out;
SineWave sine;
SawWave saw;
Tablet tablet;
float proportion;

void setup()
{
size(1024, 768);
background(0);
tablet = new Tablet(this);
minim = new Minim(this);
// get a line out from Minim, default bufferSize is 1024, default sample rate is 44100, bit depth is 16
out = minim.getLineOut(Minim.STEREO);
// create a sine wave Oscillator, set to 440 Hz, at 0.5 amplitude, sample rate from line out
sine = new SineWave(440, 0.5, out.sampleRate());
saw = new SawWave(440, 0.5, out.sampleRate());
// set the portamento speed on the oscillator to 200 milliseconds
sine.portamento(200);
saw.portamento(200);
// add the oscillator to the line out
out.addSignal(sine);
out.addSignal(saw);
}

void draw()
{
fill(0, 10);
noStroke();
rect(0,0,width, height);
stroke(255);
if (mousePressed && mouseX > 0 && mouseX < width && mouseY>0 && mouseY<height)
{
strokeWeight(30 * tablet.getPressure());
line(pmouseX, pmouseY, mouseX, mouseY);
}
if ( out.hasControl(Controller.GAIN) )
{

float val = tablet.getPressure();
out.setGain(-80+val*128);
}

float freq = map(mouseY, 0, height, 1500, 60);
sine.setFreq(freq);
saw.setFreq(freq);
proportion=map(mouseX, 0, width, 0, 1);
sine.setAmp(proportion);
saw.setAmp(1-proportion);

}

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

super.stop();
}
Re: tablet library
Reply #8 - Mar 18th, 2010, 12:08am
 
Hello,

I'm able to run the protablet example, and get the tablet data from my Wacom Intuos2 6x8 tablet. (Yeah it's very old, but seems pretty reliable so far.) However, when I run the example in full-screen mode, the tablet data seems to be fixed as constants. I've noticed this with the old infostuka library as well.

Is there a way to get tablet input in full-screen mode? (Do I need to get a new tablet?) I have driver version 6.1.4-2 on Mac OS 10.5 on an Intel-based MacBook Pro. Thanks...

Bill
Page Index Toggle Pages: 1