Forums > Jitter

float isn't float ?

June 8, 2007 | 8:09 pm

Hi list,

If I send a message "ceiling .5 .5" to [unpack s f f] I get "ceiling .5 .5"

it’s ok !

So, could somebody say to me why jit.freeframe message can’t be unpacked (precisely the second float(sometimes it is an int but same problem)) when I send it a "getparam ceiling" (or getparam currentparam) message ?

the second float given by jit.freeframe isn’t a float ?

max v2;
#N vpatcher 216 80 1186 782;
#P origin 13 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 464 269 83 196617 param qwe 1. 2.;
#P message 555 283 52 196617 qwe 1. 2.;
#P newex 555 359 32 196617 print;
#P newex 555 332 72 196617 unpack s 0. 0.;
#P newex 371 381 93 196617 sprintf %s %f %f;
#P newex 371 356 72 196617 unpack s 0. 0.;
#P message 371 428 123 196617 scale 0.333333 0.;
#P newex 371 405 62 196617 prepend set;
#P newex 743 512 40 196617 key;
#P newex 450 545 27 196617 pak;
#P newex 359 484 82 196617 append \$1 \$2;
#P message 359 571 93 196617 param floor $1 $2;
#P newex 359 505 62 196617 prepend set;
#P flonum 469 523 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 359 465 92 196617 sprintf param %s;
#P newex 577 561 76 196617 prepend param;
#P newex 605 583 32 196617 print;
#P flonum 648 523 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 612 523 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 577 542 80 196617 pak param 0. 0.;
#P newex 371 333 65 196617 route param;
#P flonum 430 523 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 81 49 33 196617 start;
#P message 81 67 29 196617 stop;
#P window linecount 2;
#P comment 692 106 197 196617 The parameter messages to the left refer to the "colorwarp" FreeFrame effect.;
#P window linecount 5;
#P comment 692 42 215 196617 Setting and getting parameters can either be accomplished using the param/getparam messages , or by simply sending messages called (name)/get(name) , where (name) is the parameter’s name.;
#P window linecount 1;
#P message 388 609 52 196617 jit.gl.slab;
#P hidden newex 258 672 104 196617 bgcolor 220 220 192;
#P message 322 609 64 196617 jit.gl.shader;
#P comment 258 595 48 196617 see also:;
#P hidden newex 258 631 64 196617 prepend help;
#P message 258 609 62 196617 jit.qt.effect;
#P hidden newex 258 652 45 196617 pcontrol;
#P hidden newex 110 633 110 196617 jit.obref jit.freeframe;
#P button 110 609 15 0;
#P comment 126 609 112 196617 ? view html reference.;
#P window setfont "Sans Serif" 18.;
#P comment 2 10 118 196626 jit.freeframe;
#P window setfont "Sans Serif" 9.;
#P comment 2 35 138 196617 Use FreeFrame video effects;
#P user panel -3 5 400 50;
#X brgb 255 255 255;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P window linecount 7;
#P comment 692 351 236 196617 To get the value of a parameter , the message "getparam" , followed by the name or index of the parameter , will query the value of the specified parameter (e.g. getparam hue_offset or getparam 0). Alternately , use the name of the parameter , preceded by the word "get" as the message (gethue_offset).;
#P window linecount 8;
#P comment 692 251 236 196617 Plugins parameters can be modulated after the plugin is loaded (loadeffect). The message "param" , followed by the name or index of the parameter and a new value (all FreeFrame values fall between 0. and 1.) will set the value of a parameter (e.g. param hue_offset 0.5 or param 0 0.5). Alternately , simply use the name of the parameter as the message (hue_offset 0.5).;
#P window linecount 3;
#P comment 692 198 225 196617 Mac or PC: A folder in the Max search path called "FreeFramePlugins". If 2 such folders exist , only the first one found is used.;
#P window linecount 1;
#P comment 692 184 247 196617 PC: C:\\Program Files\\Common Files\\FreeFrame;
#P comment 692 170 231 196617 Mac: /Library/Application Support/FreeFrame;
#P message 412 122 102 196617 getparam hue_offset;
#P message 400 103 105 196617 param hue_offset 0.9;
#P message 389 84 75 196617 hue_offset 0.6;
#P message 379 65 71 196617 gethue_offset;
#P newex 88 312 20 196617 t b;
#P message 307 85 35 196617 reload;
#P message 115 85 55 196617 dim 50 50;
#P newex 223 216 55 196617 route done;
#P newex 111 239 25 196617 iter;
#P newex 223 312 89 196617 prepend getparam;
#P user ubumenu 223 290 166 196617 0 1 1 0;
#X add angle standard;
#X add scale standard;
#X add layer_count standard;
#X add origin_x xpos;
#X add origin_y ypos;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P newex 223 261 75 196617 prepend append;
#P newex 304 262 39 196617 t clear;
#P newex 111 312 92 196617 prepend loadeffect;
#P newex 111 261 75 196617 prepend append;
#P user ubumenu 111 290 100 196617 0 1 1 0;
#X add backdropkey;
#X add backlight;
#X add bloom;
#X add burn;
#X add chromium;
#X add colourreduce;
#X add colourwarp;
#X add deinterlace;
#X add dilate;
#X add directionalblur;
#X add dodge;
#X add exclusion;
#X add fisheye;
#X add gaussianblur;
#X add glow;
#X add halftone;
#X add kaleidascope;
#X add levels;
#X add lionelblur;
#X add lumacycle;
#X add lumakey;
#X add lumaoffset;
#X add metaimage;
#X add mixer;
#X add panspinzoom;
#X add posterize;
#X add radialblur;
#X add rectdistort;
#X add refraction;
#X add slide;
#X add smear;
#X add solarize;
#X add spiralblur;
#X add squash;
#X add static;
#X add stretch;
#X add tile;
#X add timeblur;
#X add timeslice;
#X add timewarp;
#X add tvpixel;
#X add vectorize;
#X add wave;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 111 216 92 196617 t l clear;
#P newex 111 193 192 196617 route effectlist paramlist;
#P message 240 85 65 196617 getparamlist;
#P message 173 85 65 196617 geteffectlist;
#P newex 478 227 31 196617 print;
#P user jit.fpsgui 14 596 92 196617 0;
#P toggle 14 66 15 0;
#P newex 14 85 45 196617 metro 2;
#P user jit.pwindow 13 342 322 242 0 1 0 0 1 0;
#P button 62 85 15 0;
#P message 117 66 76 196617 read bball.mov;
#P newex 14 115 104 196617 jit.qt.movie 320 240;
#P newex 14 156 69 196617 jit.freeframe;
#B color 5;
#P window linecount 2;
#P comment 691 144 267 196617 The jit.freeframe object looks for FreeFrame-compliant plugins in the following directories:;
#P connect 7 0 6 0;
#P connect 6 0 2 0;
#P fasten 3 0 2 0 122 107 19 107;
#P fasten 4 0 2 0 67 107 19 107;
#P fasten 23 0 2 0 120 107 19 107;
#P connect 50 0 2 0;
#P connect 51 0 2 0;
#P fasten 11 0 1 0 245 147 19 147;
#P fasten 20 0 1 0 228 336 4 336 4 150 19 150;
#P fasten 29 0 1 0 417 147 19 147;
#P fasten 28 0 1 0 405 147 19 147;
#P fasten 27 0 1 0 394 147 19 147;
#P fasten 24 0 1 0 312 147 19 147;
#P fasten 10 0 1 0 178 138 19 138;
#P fasten 16 0 1 0 116 336 4 336 4 150 19 150;
#P connect 2 0 1 0;
#P fasten 26 0 1 0 384 147 19 147;
#P connect 1 0 5 0;
#P connect 5 0 8 0;
#P fasten 14 1 25 0 161 309 93 309;
#P hidden connect 39 0 40 0;
#P fasten 1 1 12 0 78 183 116 183;
#P connect 12 0 13 0;
#P connect 13 0 21 0;
#P connect 21 0 15 0;
#P fasten 13 1 14 0 198 284 116 284;
#P connect 15 0 14 0;
#P fasten 14 1 16 0 161 309 116 309;
#P fasten 12 1 22 0 207 213 228 213;
#P fasten 22 1 18 0 273 247 228 247;
#P connect 18 0 19 0;
#P fasten 17 0 19 0 309 284 228 284;
#P connect 19 0 20 0;
#P connect 25 0 11 0;
#P hidden fasten 47 0 43 0 393 627 263 627;
#P hidden connect 42 0 43 0;
#P hidden fasten 45 0 43 0 327 627 263 627;
#P hidden connect 43 0 41 0;
#P fasten 11 0 17 0 245 180 309 180;
#P connect 59 0 63 0;
#P connect 63 0 61 0;
#P fasten 64 0 62 0 455 566 364 566;
#P connect 61 0 62 0;
#P connect 12 2 53 0;
#P connect 73 0 53 0;
#P connect 53 0 68 0;
#P connect 68 0 69 0;
#P connect 69 0 66 0;
#P connect 66 0 67 0;
#P connect 68 1 69 1;
#P connect 52 0 64 0;
#P connect 68 2 69 2;
#P connect 60 0 64 1;
#P fasten 12 2 9 0 298 214 483 214;
#P connect 72 0 70 0;
#P connect 70 0 71 0;
#P connect 70 2 71 0;
#P connect 70 1 71 0;
#P connect 54 0 58 0;
#P connect 58 0 57 0;
#P connect 55 0 54 1;
#P connect 56 0 54 2;
#P pop;


June 12, 2007 | 6:50 am

No, but there is no second float. The message is "param paramname/
paramid paramvalue". So, "param 0 0.5" or "param truthiness 1.0".

jb

Am 08.06.2007 um 22:09 schrieb derrickgiscloux:

> the second float given by jit.freeframe isn’t a float ?


June 12, 2007 | 7:16 pm

Sorry but depending of which freeframe plug in is loaded you can have several parameter values (several floats) for one parameter name.

It seems we can’t unpack the second value with [unpack] object consecutively to a getparam message to jit.freeframe

Could someone confirm.


June 12, 2007 | 9:11 pm

Sorry but that’s incorrect.

http://freeframe.sourceforge.net/spec.html

The subsections beginning with the word Parameter would be of
particular relevance here.

I quote from ParameterValue():
ParameterValue

(32-bit float value OR 32-bit pointer)
Definition:

ParameterValue:
Float value from 0-1 or pointer to null terminated string. (See remarks)
Remarks:

Apart from text parameters, FreeFrame parameter values are always 32-
bit floats, and the range of values permitted is STRICTLY 0-1 (0 < =
ParameterValue < = 1). This allows faster processing and a good range
of values over a standard range, so the host can run up sliders or
similar for the plugin. The Use of any values outside this range will
result in hideous incompatibilities. The ParameterDisplayValue can be
used to display whatever actual values the plugin likes e.g. 0-255,
0-767, 1-256 or whatever. The plugin should translate the standard
0-1 float range into the values it needs for its processing.
For text parameters, this 32-bit value represents a pointer to a null
terminated string.

jb

Am 12.06.2007 um 21:17 schrieb derrickgiscloux:

> Sorry but depending of which freeframe plug in is loaded you can
> have several parameter values (several floats) for one parameter name.


June 13, 2007 | 9:02 am

A corrective note: the "getparam" message _does_ report a 2nd value,
as documented here in the Jitter reference:

getparam: Sends a list out the object’s right outlet containing the
current value of the parameter specified by the param argument
(either by name or by index into the list returned by getparamlist).
The list is formatted as ‘param "param" "param-val" "param-display"‘.
The "param" argument is the name of the parameters, the "param-val"
the value, and "param-display" is an alternate display value, for
parameters whose "real value", as understood by the parameter, lies
outside of the range 0-1.

This "param-display" value is probably what you’re talking about.
Sorry for the miscommunication. "param-display" is a symbol, not a
float, since the freeframe spec reports this information as a string,
rather than as a number.

Best
Jeremy


June 14, 2007 | 5:08 pm

Yes, this was the problem :
When you ask for a getparam to jit.freeframe, and if the plugin has 2 values for this params :
- the first is given as a float
- the second as a symbol (in float "form")

It’s right.


June 14, 2007 | 5:44 pm

Sorry, but I have to correct you here: it’s not that the plugin has 2
values for the param. It’s that there is a "real" value and a
"displayed" value. They are the same value, but the "real" value is
what the plug-in is really set to and the "display" value is what the
plug-in wants you to think it’s set to. There is only one value for
the parameter. This is important. Each parameter has only one value.

jb

Am 14.06.2007 um 19:08 schrieb derrickgiscloux:

>
> Yes, this was the problem :
> When you ask for a getparam to jit.freeframe, and if the plugin has
> 2 values for this params :
> – the first is given as a float
> – the second as a symbol (in float "form")
>
> It’s right.


Viewing 7 posts - 1 through 7 (of 7 total)