|
Author |
Topic: iterative convolution (Read 829 times) |
|
mrb
|
iterative convolution
« on: May 26th, 2003, 6:41am » |
|
so i've been silently hanging around these boards for a long time and finally had a chance to put something together (school ended!...for the summer). i ported a c++ app i wrote to processing, used some available UI widgets (thnx reas and arielm), and got it working at a decent speed...on my machine. could yall check out the applet and code and give any suggestions? much thanx and great work along the way. mrb the original app can be found at: http://149.31.1.65/~mrb/avsysfinal/ and the applet at: http://149.31.1.65/~mrb/java/snoop/
|
|
|
|
benelek
|
Re: iterative convolution
« Reply #1 on: May 26th, 2003, 10:31am » |
|
pretty cool. nice work. i don't think anyone's done any filters on this bboard like the ones you've done. the original concept incorporating sound would be interesting too, but i guess we'll have to wait for 055 for that..?
|
|
|
|
arielm
|
Re: iterative convolution
« Reply #2 on: May 26th, 2003, 8:46pm » |
|
hi silent reader, nice stuff! on my pIII-450 it's a bit slow, maybe optimizing the following part: int index2=0; for(int i=0; i<256; i++) { for(int j=0; j<256; j++) { pixels[index2] = color(routput[j][i], goutput[j][i], boutput[j][i]); index2++; } } by using something like: pixel[p] = r << 16 | g << 8 | b (i'm not sure of the bit-order, but you got the point...) instead of the (slower) color() method would help? added later: i saw that you commented-out the rectMode() methods within the Slider class... it doesn't interfere with this specific program but it could, if you happen to use rectMode(CENTER_DIAMETER) somewhere else... the point is whenever some rect is drawn in proce55ing, a rectMode(SOMETHING) should be placed before it, because you never know the context (i.e: you can't assume that CORNER is the current value)... added even later: hey, you were silent, but you now cross-post
|
« Last Edit: May 26th, 2003, 9:19pm by arielm » |
|
Ariel Malka | www.chronotext.org
|
|
|
mrb
|
Re: iterative convolution
« Reply #3 on: May 26th, 2003, 9:41pm » |
|
thanx for the suggestions, they've been helpful. i will be working on the optimizations in the next couple days. its a strange battle because my mac is pretty fast and i like the applet to be a bit slow, but not to noticably "click" or "transition" between iterations of the filter. with the c++ version i had to leave some code in to keep it a bit slow, and now with the java code, i am bitshifting all over the place. can reas/fry explain the exactitude of the color() method and how it functions on a lower level? that would be helpful for other projects as well. arielm: i had to take out the rect modes because they were screwing lots of other stuff up, and looked fine after a bit of tweaking. great classes, they work really nicely. cross posting was kind of a mistake, but it engendered two different conversations, so it couldnt have been that bad. also benelek: yeah the sound will have to wait for 055. kind of a big reason i did this now, so snapping in the sound would be this much easier. although my c++ app uses a sort of wavetable type synthesis, i may have to transfer it here to manipulating a sample. you do great work too! mrb
|
« Last Edit: May 26th, 2003, 9:43pm by mrb » |
|
|
|
|
arielm
|
Re: iterative convolution
« Reply #4 on: May 26th, 2003, 11:16pm » |
|
proud to see my Slider class in someone else's work! again, (yeah, i sound heavy on this one... this will be the last time i speak on the subject ), the rectMode() calls in Slider are okay... the problem come from everywhere else in your program where you use rect() without specifying which rectMode() you need... (well, maybe we need something like push() and pop() for rectMode() too in proce55ing)... a propos the color() method: on windows, i guess on mac too, you have tools like "decafe pro" to decompile java classes and watch how it looks from inside (for private instructional purposes only, of course)
|
« Last Edit: May 26th, 2003, 11:34pm by arielm » |
|
Ariel Malka | www.chronotext.org
|
|
|
benelek
|
Re: iterative convolution
« Reply #5 on: May 27th, 2003, 6:35am » |
|
hey mrb, you can use framerate() to specify the speed of the applet (or at least, how many times loop() runs per second). i'm not sure what the default framerate is set at, but from what i've seen of applets so far, it's generally as great as a host computer can handle. whoops, got to get to a lecture! cya
|
|
|
|
|