jit.jen example, cryptic?
attached picture shows jit.gen.maxpat
on the left is jit.gen object and to its right its insides.
next to it my understanding of the internals of the gen. cleary wrong…
0. whats the equivalent jit.op code ?
1. what is [* amp] ? can we use variables(?) in max objects now?
2.[bug?] i cannot access help files inside the jit.gen subpatch (whats the correct term again?)
3. message [param amp pi] is not connected to any object. what is it?
4. the help file description states that "the patcher and code describes how each cell of jit.matrix will be processed by jit.gen".
is there code? is ‘code’ the keyword for gen internals?
0. Within a gen patcher, the ops are much simpler:
[jit.op @op +] becomes [+]
[jit.op @op + @val 1.] becomes [+ 1]
1. Only in gen patchers. The ‘amp’ variable is available because it is defined by the [param amp] object. Also a few defined constants can be used, such as pi, sqrt2, e, log10e etc. See the Gen reference vignettes for the full list.
2. There is no inline help for objects in gen patcher yet, that will come soon. Have a look at the references (under the ? tab of the jit.gen help patcher).
3. See (1). A [param] object becomes a value that can be modified from outside the gen patcher, in this case by sending the (param amp $1) message to the jit.gen object.
thanks for the tips,
so whats the correct unGen patch?
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 403.3ocuU9sSBCCEF+5QhuCM8RbRn6O.yqvmCigzsUfR5ZWVK5Thu611QgEU hKpzKFGx470d95utb1gaFE.yEsDIDbO3QPPvAcl.aNSl.Wh.XEtsfgkVgv0L AeeEL7XM8+obFQYKhbYWK3JNthXWwCMTLq+BD6UtUD4RSKsZE46tCkbRbcCQ R3JrhJ3qZHEpNuNKFMYZH.sHwDld7GvStk00.0q0jN8FSiUvP.LGy2.OKz3S I8MqLTrdeb8EqJ1R4atXOSsMMB0uq03F8QVQZVQ33blcSmZq89MiLQcHbvbl SdQCiSjPQZsFAtiplHpAK0O2BV9LloO5oe+0Qz+y0ABdQtpMypJrpg1Zf6uC royM0AwnN9FO6LYulvarefWjWfWzhivK1OvqPHulTKyOPKI0Dx7DyFeMIVhe HFxRr4KtHw51cHix+x2Uraqovm3nTruovYV27ePu4pkDohxseCnmJiHzYQao kkDa8SmiRpzLFt7GlCObeEMDeYFW1WkGLV1f7Uj280ftGy9S1x7BnN7AR4C9 fB -----------end_max5_patcher-----------
regarding the simplified gen specific operators. from my understanding jit.op multi plane abilities are lost and gen will treat only a single plane. is this correct? or is [+ pass *] possible?
thankx again, i understand you are still working on the docs
The difference you’re seeing is actually one of the benefits of jit.gen and the extra precision afforded by Gen patchers. Your input matrix type is char. jit.op’s output will also be char, so everything will be clamped to [0, 255]. Within a Gen patcher, there is no such restriction on the range of values so negative values are permissible. Code in the sentence you cite is referring to GenExpr, the text language for Gen patchers
Under Max help, there’s a Gen vignette. Have a read through the Gen Overview and Gen Expr pages. If you have questions about it, please fire away.
oh, its float32 inside, didn’t catch this as jit.cellblock [my main jitter debugging tool] is not available inside gen object. strange new world…
anyways, to be a nag, i see no diff in CPU between them.
with jit.gl came a few cpu Vs gpu examples who made a big impact on me. please include a few of those with Gen. it will be a good selling point/.
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 1468.3oc4Z00aihCE84LRy+ADZepSlHrMeD1m596XzpJWvIwcIXD3zzYGs+2 W+ADfTRhaC3Do4g1Hrw1Getm60Wayu95Wl49L6MRkqye57CmYy9knjYpxjkL qofYtawukjgqTun65p8TdxFn675Zy2sklmQ3ppgcJksi+thoopNg87KeGDdn KzuI+mEDMVbcmK9y4uapu.KFQZ95mJIIb8q36iV3M2ABVtHXtCJV9.Btvqai JwaIbR4Sjb7yYpt1SU2+80uH+U7ybim14j8BPe.wbxaJf39BkuXKlWReyw2Y UFCyQPAP7bf9dNOhSwEbGug4JPSoqX47bAVUc3eURwYte.ZL3zzn.bOoA2QD pbDqn+q58.Rh7zDcPPfjaAg.EeCqocIS+oISAOIlXSJq3e3kKJIUjbNlSY4c lWgH0DBrzW9iW8+Zon2QlJiqjGeFmu9ywkgApwADqFS8CZpbZDsRwYwdZdJa +EHaCXTzkXzfkJFEEnlcB8uleOOqdYO8ZAHR5ceb2NItyr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b+IZhLE592cPOzTnGc2Aci8 TCu+bTME5iqaZmH9ojBRtneR94SI3jM0fqYshllMlWzXk7ze99qzTBartrQu gtve2O0kPq+VrBa+xFtxuyimO5XtFNAWCtvcjQWdZ6ccdf3RIaYJ1dg.XEXt 6Em+.e8mRpNgK.LX.FPOP8SXnlQN1KngWdu5W5PBZgrQKQMfte.M+flJyA1Q CoIAwsBtBMAW1muPl.qis1CfqszzBFMmWqnPpiDDFo2vej1cr2SfP8EkWqaG 7oHn5TaCi69k.L5VFeSUL.6pX.FYZP1WJCMBX.qCrXivEz53xHAVr0g0x6yH RFEnLx5vxn0UBuSiea+XDdlfqkWEtjI1H94+AcbhCh. -----------end_max5_patcher-----------
@wesly, i’ll get there asap
hi Yair, have you looked in the jitter-examples/gen folder? There are some benchmarking patches as well as some Gen patchers that run in both CPU and GPU with jit.pix and jit.gl.pix.
I see a 10% difference in CPU usage, but that’s using activity monitor. Really, this is not a very good way to benchmark. There’s the pwindow, fpsgui, copy and conversion into the float32. It’s better to specifically measure the jit.ops v. jit.gen. See the benchmarking examples for a way to do this.
not thoroughly, i did a search for jit.gen* but missed all the rest.
on my win7/64bit/i7-920 its 4-11 times faster (especially impressive if you crank the dim up to 1920×1080).
but these benchmarks are incomplete as they don’t challenge jit.gl strategies.
my understanding is gen code should be equal to GPU code with the added benefit of ability to translate GLSL code to some new and old max object [swiz, mix, etc].
I am really looking forward to that inline help for gen. Currently, some help patches are missing and some nodes are linked to non-gen help patches (e.g., standard operators).
Forums > Beta