Feedback patch, need to speed it up :)

Jul 26, 2007 at 6:14pm

Feedback patch, need to speed it up :)

Hey all, I’ve written a pretty kick-ass patch but I’m having some problems with a feedback loop.. this is the workflow:

- person speaks
- analyzes frequency
- produces n and m
- uses n and m for a chladni pattern in a circular membrane
- produces pattern

I’m using a sand algorithm from another patch that simulates the movement of sand on the plate, however, its too slow and I cant work out why…

The patch is below:

A bang starts the patch in the left inlet and on the right the pattern is passed as a matrix!.

max v2;
#N vpatcher 711 127 1311 527;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 172 88 52 196617 metro 20;
#P newex 284 205 34 196617 delay;
#P outlet 156 285 15 0;
#P inlet 210 61 15 0;
#N vpatcher 448 400 847 654;
#P outlet 62 194 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 62 165 64 196617 jit.op @op +;
#P inlet 212 60 15 0;
#P inlet 62 61 15 0;
#P inlet 310 68 15 0;
#P window linecount 0;
#P newex 310 105 30 196617 !- 1.;
#P window linecount 1;
#P newex 212 131 114 196617 jit.op @op * @val 0.06;
#P window linecount 0;
#P newex 62 132 114 196617 jit.op @op * @val 0.94;
#P connect 4 0 0 0;
#P connect 0 0 6 0;
#P connect 6 0 7 0;
#P fasten 1 0 6 1 217 157 121 157;
#P fasten 3 0 0 1 315 97 171 97;
#P connect 5 0 1 0;
#P connect 3 0 2 0;
#P connect 2 0 1 1;
#P pop;
#P newobj 156 195 45 196617 p mixer;
#P newex 156 230 65 196617 jit.op @op *;
#P newex 156 164 181 196617 jit.matrix 1 float32 256 256 @thru 0;
#P newex 172 129 134 196617 jit.noise 1 float32 256 256;
#P inlet 172 61 15 0;
#P window linecount 2;
#P comment 11 46 100 196617 Virtual sand , not written by Carlos.;
#P connect 9 0 3 0;
#P fasten 4 0 3 0 161 257 147 257 147 156 161 156;
#P connect 3 0 5 0;
#P connect 5 0 4 0;
#P connect 4 0 7 0;
#P connect 1 0 9 0;
#P connect 9 0 2 0;
#P connect 2 0 5 1;
#P connect 6 0 4 1;
#P pop;

I cant upload the full patch because there are too many java files, but once I’ve finished it I’ll get it on my website.

Nice one.

#33043
Jul 26, 2007 at 8:28pm

> its too slow and I cant work out why…

You could try jit.gl.slab with @file op.add.jxs and also @file op.mult.jxs instead of jit.op + and * objects, to speed up your process … ?

#109535
Jul 26, 2007 at 8:39pm

replace metro 20 with qmetro 2 ? ;)

On Jul 26, 2007, at 4:28 PM, derrickgiscloux wrote:

>
>> its too slow and I cant work out why…
>
> You could try jit.gl.slab with @file op.add.jxs and also @file
> op.mult.jxs instead of jit.op + and * objects, to speed up your
> process … ?
>

v a d e //

http://www.vade.info
abstrakt.vade.info

#109536
Jul 27, 2007 at 11:36am

eheh yeah, I thought that too but it doesn’t have an impact! Any other ideas guys?

#109537
Jul 27, 2007 at 11:39am

“ou could try jit.gl.slab with @file op.add.jxs and also @file op.mult.jxs instead of jit.op + and * objects, to speed up your process … ?”

I’ll try that, didnt see your reply at first :)

#109538
Aug 1, 2007 at 2:06pm

hmmm, none of that works and I’m pretty stuck.. can anyone think of any more ideas?

#109539
Aug 6, 2007 at 1:17pm

Am 01.08.2007 um 16:06 schrieb Carl Knott:

>
> hmmm, none of that works and I’m pretty stuck.. can anyone think of
> any more ideas?

jit.xfade will be a lot quicker that your homebuilt p mixer.
i even use it instead of [jit.op *] for scaling sometimes when i’m
really chasing fps. (see attached and zipped benchmark patches)

_f

#P window setfont “Sans Serif” 9.;
#P user jit.fpsgui 182 295 60 196617 0;
#P user jit.fpsgui 426 307 60 196617 0;
#P toggle 370 110 15 0;
#P window linecount 1;
#P newex 399 98 51 196617 qmetro 2;
#P outlet 383 295 15 0;
#P inlet 437 71 15 0;
#P newex 383 205 49 196617 jit.xfade;
#P newex 383 240 49 196617 jit.xfade;
#P newex 383 174 181 196617 jit.matrix 1 float32 256 256 @thru 0;
#P newex 399 139 134 196617 jit.noise 1 float32 256 256;
#P inlet 399 71 15 0;
#P toggle 143 100 15 0;
#P newex 172 88 51 196617 qmetro 2;
#P outlet 156 285 15 0;
#P inlet 210 61 15 0;
#N vpatcher 448 400 847 654;
#P outlet 62 194 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 62 165 64 196617 jit.op @op +;
#P inlet 212 60 15 0;
#P inlet 62 61 15 0;
#P inlet 310 68 15 0;
#P window linecount 0;
#P newex 310 105 30 196617 !- 1.;
#P window linecount 1;
#P newex 212 131 114 196617 jit.op @op * @val 0.06;
#P window linecount 0;
#P newex 62 132 114 196617 jit.op @op * @val 0.94;
#P connect 4 0 0 0;
#P connect 0 0 6 0;
#P connect 6 0 7 0;
#P fasten 1 0 6 1 217 157 121 157;
#P fasten 3 0 0 1 315 97 171 97;
#P connect 5 0 1 0;
#P connect 3 0 2 0;
#P connect 2 0 1 1;
#P pop;
#P newobj 156 195 45 196617 p mixer;
#P newex 156 230 65 196617 jit.op @op *;
#P newex 156 164 181 196617 jit.matrix 1 float32 256 256 @thru 0;
#P newex 172 129 134 196617 jit.noise 1 float32 256 256;
#P inlet 172 61 15 0;
#P window linecount 2;
#P comment 11 46 100 196617 Virtual sand , not written by Carlos.;
#P window linecount 1;
#P message 437 218 50 196617 xfade $1;
#P newex 437 199 30 196617 !- 1.;
#P connect 19 0 14 0;
#P connect 19 0 13 0;
#P fasten 15 0 14 0 388 267 374 267 374 166 388 166;
#P connect 15 0 18 0;
#P connect 15 0 21 0;
#P connect 14 0 16 0;
#P connect 13 0 16 1;
#P connect 20 0 19 0;
#P connect 12 0 19 0;
#P connect 10 0 5 0;
#P connect 10 0 4 0;
#P fasten 6 0 5 0 161 257 147 257 147 156 161 156;
#P connect 6 0 9 0;
#P connect 6 0 22 0;
#P connect 5 0 7 0;
#P connect 4 0 7 1;
#P connect 3 0 10 0;
#P connect 11 0 10 0;
#P connect 0 0 1 0;
#P connect 17 0 0 0;
#P connect 1 0 15 1;
#P connect 16 0 15 0;
#P connect 8 0 6 1;
#P connect 7 0 6 0;
#P window clipboard copycount 23;

#|
fredrikolofsson.com klippav.org musicalfieldsforever.com
|#

#109540

You must be logged in to reply to this topic.