Forums > MaxMSP

Inc/Dec object Float Conversion ?

February 27, 2006 | 10:06 pm

I did a search and found some previous posts regarding storing a number and returning it to a inc/dec object. Is there anyway of getting it to increase by say 0.01 and have it store in inc/dec object?


February 27, 2006 | 10:22 pm

what do u want from pressing inc ?

1.01 or 0.02 ?


February 27, 2006 | 10:28 pm

Yes – multuply the output of inc/dec by 0.01, if that is the
resolution you want.

L

Lawrence Casserley – lawrence@lcasserley.co.uk
Lawrence Electronic Operations – http://www.lcasserley.co.uk
Colourscape Music Festivals – http://www.colourscape.org.uk


February 27, 2006 | 11:17 pm

In this patch the left configuration will store the int from the inc/dec object. I can then click and drag on top number box to change the value and then when click on inc/dec again it will increase/decrease from new int in float numbox.

The right configuration is set up the same but using float but doesnt seem to work this is what I am trying to get.

max v2;
#N vpatcher 15 55 615 455;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 286 196 35 9109513 float 0;
#P newex 271 118 27 9109513 t f f;
#P flonum 76 231 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 309 239 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P user incdec 271 146 15 15 0 0;
#P flonum 271 92 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 271 168 33 9109513 * 0.01;
#P flonum 74 80 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 76 193 27 9109513 int 0;
#P newex 87 118 27 9109513 t i i;
#P user incdec 76 152 15 15 0 0;
#P fasten 2 0 3 0 81 217 58 217 58 73 79 73;
#P fasten 1 0 0 0 92 141 81 141;
#P fasten 0 0 2 0 81 176 81 176;
#P connect 2 0 8 0;
#P fasten 3 0 1 0 79 106 92 106;
#P fasten 1 1 2 1 109 141 98 141;
#P fasten 10 0 5 0 291 225 255 225 255 82 276 82;
#P connect 5 0 9 0;
#P connect 9 0 6 0;
#P connect 6 0 4 0;
#P fasten 4 0 10 0 276 191 291 191;
#P fasten 10 0 7 0 291 227 314 227;
#P fasten 9 1 10 1 293 159 316 159;
#P pop;


February 27, 2006 | 11:33 pm

Quote: Will Pickersgill wrote on Mon, 27 February 2006 15:06
—————————————————-
> I did a search and found some previous posts regarding storing >a number and returning it to a inc/dec object. Is there anyway >of getting it to increase by say 0.01 and have it store in >inc/dec object?

[110.ATC]

max v2;
#N vpatcher 268 882 642 1126;
#P user GSwitch 155 85 41 32 0 0;
#P newex 183 41 57 196617 select 0 1;
#P message 182 124 17 196617 0;
#P message 155 124 17 196617 1;
#P newex 168 147 54 196617 metro 40;
#P newex 206 67 53 196617 delay 300;
#N comlet Stepsize (default 0.01);
#P inlet 323 26 15 0;
#N comlet speed i (default 40);
#P inlet 295 26 15 0;
#N comlet predelay i (default 300);
#P inlet 269 26 15 0;
#P newex 236 189 42 196617 – 0.01;
#P newex 236 165 42 196617 f;
#N comlet substract from control;
#P inlet 155 25 15 0;
#P user GSwitch 18 85 41 32 0 0;
#P newex 46 41 57 196617 select 0 1;
#P newex 95 189 42 196617 + 0.01;
#P message 45 124 17 196617 0;
#P message 18 124 17 196617 1;
#P newex 31 147 54 196617 metro 40;
#P newex 69 67 53 196617 delay 300;
#P newex 95 165 42 196617 f;
#N comlet from control , to store value;
#P inlet 127 25 15 0;
#N comlet back to control;
#P outlet 158 207 15 0;
#N comlet add to control;
#P inlet 18 25 15 0;
#P connect 0 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 5 0;
#P connect 7 0 5 0;
#P connect 9 0 7 0;
#P connect 0 0 9 0;
#P connect 4 0 10 2;
#P connect 9 1 4 0;
#P connect 15 0 5 1;
#P lcolor 7;
#P connect 5 0 3 0;
#P connect 9 1 3 0;
#P connect 3 0 8 0;
#P connect 14 0 4 1;
#P lcolor 15;
#P connect 2 0 3 1;
#P lcolor 1;
#P connect 16 0 8 1;
#P lcolor 13;
#P connect 11 0 22 0;
#P connect 22 0 19 0;
#P connect 8 0 1 0;
#P connect 13 0 1 0;
#P connect 20 0 18 0;
#P connect 19 0 18 0;
#P connect 21 0 20 0;
#P connect 11 0 21 0;
#P connect 17 0 22 2;
#P connect 21 1 17 0;
#P connect 15 0 18 1;
#P lcolor 7;
#P connect 18 0 12 0;
#P connect 21 1 12 0;
#P connect 12 0 13 0;
#P connect 14 0 17 1;
#P lcolor 15;
#P connect 2 0 12 1;
#P lcolor 1;
#P connect 16 0 13 1;
#P lcolor 13;
#P pop;

[110.ATC.help]

max v2;
#N vpatcher 106 282 510 651;
#P hidden message 208 142 98 196617 brgb 105 130 180;
#P hidden newex 203 137 50 196617 loadbang;
#N thispatcher;
#Q end;
#P hidden newobj 218 146 108 196617 thispatcher;
#P hidden message 9 275 76 196617 brgb 105 130 180;
#P hidden newex 9 256 28 196617 loadbang;
#N thispatcher;
#Q end;
#P hidden newobj 9 292 86 196617 thispatcher;
#P comment 106 304 188 196618 inlet 6 : set step size;
#P comment 304 41 53 196617 step size;
#P message 311 58 35 196617 0.01;
#P flonum 311 79 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 265 41 42 196617 speed;
#P comment 215 41 52 196617 predelay;
#P comment 106 170 186 196626 110.AddToControl;
#P comment 106 285 188 196618 inlet 5 : set speed;
#P comment 106 266 188 196618 inlet 4 : set predelay time;
#P comment 106 247 188 196618 inlet 3 : substract from control;
#P comment 106 228 188 196618 inlet 2 : from control , to store value;
#P message 264 58 36 196617 40;
#P message 217 58 35 196617 300;
#P number 217 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 264 78 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user pictctrl 22 181 21 21 purplebutton.pict 0 0 1 0 2 0 0 0 21 21 128 0 1 1 1;
#P newex 76 104 246 196617 110.ATC;
#P user pictctrl 22 39 21 21 purplebutton.pict 0 0 1 0 2 0 0 0 21 21 128 0 1 1 1;
#P user multiSlider 23 65 19 112 0. 1. 1 2937 47;
#M frgb 142 70 228;
#M brgb 255 255 255;
#P comment 106 209 134 196618 inlet 1 : add to control;
#P user panel 14 30 37 182;
#X brgb 192 192 192;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 22 0 23 0;
#P hidden connect 23 0 21 0;
#P hidden connect 4 0 2 0;
#P hidden connect 3 0 4 0;
#P hidden connect 2 0 4 1;
#P hidden connect 5 0 4 2;
#P hidden connect 25 0 26 0;
#P connect 8 0 7 0;
#P connect 7 0 4 3;
#P hidden connect 26 0 24 0;
#P connect 9 0 6 0;
#P connect 6 0 4 4;
#P connect 18 0 17 0;
#P connect 17 0 4 5;
#P pop;

-110


February 27, 2006 | 11:38 pm

Thanks Roman,

But how do I get the patch to load properly. It cant find the object 110.ATC. Do I have to save the first patch as an abstraction ??


February 27, 2006 | 11:41 pm

> > I did a search and found some previous posts regarding storing a
> > number and returning it to a inc/dec object. Is there anyway of
> > getting it to increase by say 0.01 and have it store in inc/dec
> > object?

well, or … well that is all what inc/dec does; storing a
number, and sending (number+1) out again when you click or
bang it.
you can reproduce that youself, as seen in 110.ATC, very
easily with only two objects: [i] and [+].

-110


February 27, 2006 | 11:43 pm

But it only stores ints, is there a way of getting it to recall floats even when the numbox is dragged to a new value (as in the int example of the patch I posted) ?

Or would it just be best to reproduce it myself?


February 27, 2006 | 11:48 pm

Quote: Will Pickersgill wrote on Mon, 27 February 2006 16:38
—————————————————-
> Thanks Roman,
>
> But how do I get the patch to load properly. It cant find the object 110.ATC. Do I have to save the first patch as an abstraction ??
—————————————————-

i suppose that one has to save patches from the forum
first before opening them with MAX, yes. :)

to be able to find the helpfile from the abstraction or
the abstraction from the helpfile you have to place both
files somewhere in your search path as you might know.

otherwise sorry if it is my fault that it does not work ..
here is a binary: http://adminx.de/roman/ext/atc.toast

-110


February 27, 2006 | 11:51 pm

> But it only stores ints, is there a way of getting it to >recall floats even when the numbox is dragged to a new value >(as in the int example of the patch I posted) ?

if you replace [i] with [f] you will be able to save
and recall floats, too.

let me know if you need support with the computerkeyboard
or the coffeemachine, i?ll be here to help!

-110


February 27, 2006 | 11:55 pm

I have tried that but it doesnt seem to recall it properly.

Keyboard and coffemachine are fine thanks.

max v2;
#N vpatcher 220 81 820 481;
#P window setfont "Sans Serif" 9.;
#P flonum 226 246 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 225 86 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 226 208 35 9109513 float 0;
#P newex 248 124 27 9109513 t f f;
#P user incdec 227 154 15 15 0 0;
#P newex 212 178 33 9109513 * 0.01;
#P flonum 83 238 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 81 87 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 83 200 35 9109513 float 0;
#P newex 94 125 27 9109513 t f f;
#P user incdec 83 159 15 15 0 0;
#P fasten 2 0 3 0 88 224 65 224 65 80 86 80;
#P fasten 1 0 0 0 99 148 88 148;
#P fasten 0 0 2 0 88 183 88 183;
#P connect 2 0 4 0;
#P fasten 3 0 1 0 86 113 99 113;
#P fasten 1 1 2 1 116 148 113 148;
#P fasten 6 0 5 0 232 174 217 174;
#P fasten 8 0 9 0 231 233 202 233 202 79 230 79;
#P fasten 5 0 8 0 217 202 231 202;
#P connect 8 0 10 0;
#P fasten 7 0 6 0 253 147 232 147;
#P fasten 9 0 7 0 230 112 253 112;
#P fasten 7 1 8 1 270 147 256 147;
#P pop;


February 28, 2006 | 1:41 am

> I have tried that but it doesnt seem to recall it properly.

not sure what your patch is doing, i dont get it. :)

here is how to replace indec with custom programierski.
with this example it will be easy for you to make your
own indec stuff with any numbers you want.

i also do not like indec s limitations, would a better
version of it be useful for you?


February 28, 2006 | 11:05 am

What I am basically trying to do is use the incdec to alter the bpm, but I want to also be able to drag on the number box to increase it more rapidly but then use the incdec for minute increments. The problem is incdec doesnt accept anything other than inc so its not recalling the number (when numbox is dragged).

> here is how to replace indec with custom programierski.
> with this example it will be easy for you to make your
> own indec stuff with any numbers you want.

? Did you mean to post a patch?

> i also do not like indec s limitations, would a better
> version of it be useful for you?

Well it would be useful but what I am trying to do is not essential just think it would be good to have a (int) incdec and a (float) incdec.


February 28, 2006 | 8:35 pm

> ? Did you mean to post a patch?

yes, it came with the next mail.

> > i also do not like indec s limitations, would a better
> > version of it be useful for you?
>
> Well it would be useful but what I am trying to do is not essential just think it would be good to have a (int) incdec and a (float) incdec.

it is always essential to solve problems as it kills
some time (time = enemy)

try this:

http://adminx.de/roman/ext/110.bp.incdec.04a.toast

very alpha but works.

to feed the arguments by inlets just make the bpatcher
object bigger.


February 28, 2006 | 8:40 pm

Will Pickersgill wrote:
> I have tried that but it doesnt seem to recall it properly.

If you look at this patch, you’ll understand why Roman is proposing to
help you with the coffee ;-)

You have to feed the Inc/Dec with the same sized ints as it expects.
Unfortunatly this doesn’t work until you round the result correctly,
thats why my rounding int object from the abhaXions is included in the
patch.
This is an updated version of rint, which also rounds negative numbers
correctly.
A second solution just prevents feedback:

Stefan

#P window setfont "Sans Serif" 9.;
#P number 338 122 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P comment 306 23 61 196617 solution 2:;
#P newex 338 62 61 196617 prepend set;
#P newex 320 142 41 196617 * 0.01;
#P newex 338 101 50 196617 * 100.;
#P flonum 338 82 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user incdec 320 122 15 15 0 0;
#P newex 35 141 38 196617 * 0.01;
#P user incdec 35 120 15 15 0 0;
#P flonum 35 55 38 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 20 74 348 394;
#P inlet 155 30 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 85 157 53 196617 + 0.5;
#P newex 85 72 27 196617 t f f;
#P message 128 136 28 196617 -0.5;
#P message 102 136 23 196617 0.5;
#P newex 102 114 54 196617 sel 1 0;
#P newex 102 93 29 196617 > 0.;
#P newex 50 50 45 196617 sel bang;
#P newex 85 180 80 196617 int;
#P inlet 50 30 15 0;
#P outlet 85 202 15 0;
#P newex 155 157 53 196617 + 0.5;
#P newex 155 72 27 196617 t f f;
#P message 198 136 28 196617 -0.5;
#P message 172 136 23 196617 0.5;
#P newex 172 114 54 196617 sel 1 0;
#P newex 172 93 29 196617 > 0.;
#P connect 7 0 9 0;
#P connect 9 1 14 0;
#P connect 14 0 15 0;
#P connect 15 0 8 0;
#P fasten 9 0 8 0 55 177 90 177;
#P connect 8 0 6 0;
#P connect 14 1 10 0;
#P connect 10 0 11 0;
#P connect 11 0 12 0;
#P connect 11 1 13 0;
#P connect 13 0 15 1;
#P connect 12 0 15 1;
#P connect 16 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 8 1;
#P connect 4 1 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 1 1 3 0;
#P connect 3 0 5 1;
#P connect 2 0 5 1;
#P pop;
#P newobj 35 98 38 196617 p rint;
#P newex 35 76 38 196617 * 100.;
#P comment 80 101 165 196617 < - rounding int from the abhaXions;
#P comment 35 23 61 196617 solution 1:;
#P connect 7 0 10 0;
#P hidden connect 7 0 13 0;
#P hidden connect 13 0 7 0;
#P connect 9 0 13 0;
#P fasten 10 0 11 0 325 162 315 162 315 58 343 58;
#P connect 11 0 8 0;
#P connect 8 0 9 0;
#P connect 2 0 3 0;
#P connect 3 0 5 0;
#P fasten 6 0 4 0 40 165 28 165 28 49 40 49;
#P connect 4 0 2 0;
#P connect 5 0 6 0;
#P window clipboard copycount 14;

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-49 77 51 72


February 28, 2006 | 9:13 pm

Thanks.

Maybe I am not explaining properly what it is I want it to store. I want to be able to increment the numberbox by 0.01 per click, if the number box is altered by dragging on it I want that number to be stored and then when the incdec object is used again it just increments from the stored number.
If I put a * 0.01 after the incdec object the number doesnt store and just increments to 0.01 or 0.00.

I am confused and having a cold isnt helping. :(

Plus I still dont get the significance of the coffee..?

Will


February 28, 2006 | 9:40 pm

This is exactly what Stefan’s first solution does.

On Feb 28, 2006, at 4:13 PM, Will Pickersgill wrote:

> I want to be able to increment the numberbox by 0.01 per click…


February 28, 2006 | 9:55 pm

Maybe I have been connecting it incorrectly then..? As I have it here it doesnt work.

max v2;
#N vpatcher 88 139 754 571;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 206 130 33 9109513 * 0.01;
#P user incdec 182 96 15 15 0 0;
#P flonum 141 83 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 141 234 53 9109513 + 0.5;
#P newex 141 149 27 9109513 t f f;
#P message 184 213 28 9109513 -0.5;
#P message 158 213 23 9109513 0.5;
#P newex 158 191 54 9109513 sel 1 0;
#P newex 158 170 29 9109513 > 0.;
#P newex 83 108 45 9109513 sel bang;
#P newex 141 257 80 9109513 int;
#P inlet 83 88 15 0;
#P outlet 141 288 15 0;
#P connect 1 0 3 0;
#P fasten 12 0 10 0 211 155 262 155 262 64 146 64;
#P connect 10 0 8 0;
#P fasten 3 1 8 0 123 138 146 138;
#P connect 8 0 9 0;
#P fasten 3 0 2 0 88 254 146 254;
#P connect 9 0 2 0;
#P connect 2 0 0 0;
#P connect 8 1 4 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P fasten 2 0 11 0 146 283 253 283 253 85 187 85;
#P connect 5 1 7 0;
#P connect 6 0 9 1;
#P connect 7 0 9 1;
#P fasten 11 0 12 0 187 120 211 120;
#P pop;


February 28, 2006 | 10:27 pm

Yes – this is wrong. Go back and look at Stefan’s patch without
altering it first. You might want to take a nap first, that cold seems
to be getting the better of you.

On Feb 28, 2006, at 4:55 PM, Will Pickersgill wrote:

> Maybe I have been connecting it incorrectly then..?


February 28, 2006 | 11:53 pm

Well I have had a look at it again and still cant get it to do what I want it to do. If it is being rounded down and stored then surely it will never recall the numbers after the decimal point, it just returns it to the closest whole number.


March 1, 2006 | 12:12 am

> Maybe I am not explaining properly what it is I want it to store. I want to be able to increment the numberbox by 0.01 per click, if the number box is altered by dragging on it I want that number to be stored and then when the incdec object is used again it just increments from the stored number.

this is exactly what all three examples i gave
you are doing.

did you try them?


March 1, 2006 | 12:33 am

Yes I have tried them but they only seem to store ints and dont recall the numbers after the decimal point. Sorry for being a pain but it just isn’t working.


March 1, 2006 | 1:17 am

Quote: Will Pickersgill wrote on Tue, 28 February 2006 17:33
—————————————————-
> Yes I have tried them but they only seem to store ints and dont recall the numbers after the decimal point. Sorry for being a pain but it just isn’t working.
—————————————————-

then your CPU is kaputt mister.

when [110.bp.incdec.help] is not displaying floats
for you, then your CPU is kaputt.


March 1, 2006 | 9:24 am

On around Mar 1, 2006, at 1:33, Will Pickersgill said something like:
> Yes I have tried them but they only seem to store ints and dont recall
> the numbers after the decimal point. Sorry for being a pain but it
> just isn’t working.

Sorry, I don’t see the problem.

The following solution does what you want. Hide-on-lock those
components you don’t want users to see.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 216 113 41 196617 * 0.01;
#P user incdec 216 94 15 15 0 0;
#P flonum 176 94 41 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 176 142 110 196617 lp.scampi 100 0 round;
#P fasten 0 0 2 0 181 163 167 163 167 88 221 88;
#P connect 1 0 0 0;
#P fasten 3 0 1 0 221 135 260 135 260 80 181 80;
#P connect 2 0 3 0;
#P window clipboard copycount 4;

It uses lp.scampi for the float-to-int conversion between flonum and
incdec, but you could write a subpatch to do the same. It is
*essential* that numbers are rounded before going to incdec. If you
don’t understand why this is so, than trust us on this. If you don’t
round, the patch won’t work. Period. Going from incdec to the flonum is
easier, a simple multiplication will suffice.

– P.

————– http://www.bek.no/~pcastine/Litter/ ————–
Peter Castine | ^
| Litter Power & Litter Bundle for Jitter
pcastine@gmx.net |
pcastine@bek.no | iCE: Sequencing, Recording, and Interface Building
4-15@kagi.com | for Max/MSP
| Extremely cool
| http://www.dspaudio.com
| http://www.dspaudio.com/software/software.html


March 1, 2006 | 1:43 pm

I understand why it needs to be rounded etc, but just in all cases I have tried it didnt seem to recall the numbers after the decimal point.

Peter I cant get that patch you post to work, dont text patches need "max v2;" as a header ? I saved it as a text file but it doesnt open in max.



jln
March 1, 2006 | 1:59 pm


March 1, 2006 | 2:09 pm

Thanks for that, will have a look at the patch when i get home.


March 1, 2006 | 2:42 pm

On around Mar 1, 2006, at 14:43, Will Pickersgill said something like:
> Peter I cant get that patch you post to work, dont text patches need
> "max v2;" as a header ? I saved it as a text file but it doesnt open
> in max.

Copy&Paste since Max 4.5.5.

If you’ve got an earlier Max/MSP, you can recreate the patch from the
TIFF that was attached (not avail. on the forum, sorry, beyond my
control).

– P.

————– http://www.bek.no/~pcastine/Litter/ ————–
Peter Castine | ^
| Litter Power & Litter Bundle for Jitter
pcastine@gmx.net |
pcastine@bek.no | iCE: Sequencing, Recording, and Interface Building
4-15@kagi.com | for Max/MSP
| Extremely cool
| http://www.dspaudio.com
| http://www.dspaudio.com/software/software.html


March 1, 2006 | 3:15 pm

Not available to users of certain e-mail clients either (eg. Entourage)
because, as I think has been mentioned here before, attached .tiff’s appear
with a black background, obscuring any patch cords,
Cheers
Roger

On 1/3/06 14:42, "Peter Castine"

wrote:

> If you’ve got an earlier Max/MSP, you can recreate the patch from the
> TIFF that was attached (not avail. on the forum, sorry, beyond my
> control).


March 1, 2006 | 4:21 pm


March 2, 2006 | 5:03 am

> That’s sort of beyond my control. The certain e-mail client users will
> have to either
>
> – modify the TIFF in Graphics Editor of choice,

thanks guys for hjacking the thread.

that was the only chance it had to become useful.


March 2, 2006 | 6:59 am

Will Pickersgill wrote:
> Well I have had a look at it again and still cant get it to do what I
> want it to do. If it is being rounded down and stored then surely it
> will never recall the numbers after the decimal point, it just
> returns it to the closest whole number.

Did you see the part which multiplies by 100 again? I did not see it in
your broken version. The second solution I posted is even simpler and
works… Anyway, proper encapsulated versions for both solutions are
attached.

Stefan

#P window setfont "Sans Serif" 9.;
#P flonum 82 74 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#N vpatcher 299 235 518 545;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 24 56 38 196617 * 0.01;
#P newex 64 56 38 196617 * 100.;
#P inlet 24 35 15 0;
#P inlet 64 36 15 0;
#P outlet 118 247 15 0;
#P outlet 99 247 15 0;
#P window linecount 0;
#P newex 99 185 53 196617 + 0.5;
#P newex 99 100 27 196617 t f f;
#P message 142 164 28 196617 -0.5;
#P message 116 164 23 196617 0.5;
#P newex 116 142 62 196617 sel 1 0;
#P newex 116 121 29 196617 > 0.;
#P newex 64 78 45 196617 sel bang;
#P newex 99 208 53 196617 int;
#P connect 11 0 13 0;
#P connect 10 0 12 0;
#P connect 12 0 1 0;
#P connect 1 1 6 0;
#P connect 6 0 7 0;
#P fasten 1 0 0 0 69 205 104 205;
#P connect 7 0 0 0;
#P connect 0 0 8 0;
#P connect 6 1 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P fasten 13 0 9 0 29 234 123 234;
#P connect 3 1 5 0;
#P fasten 4 0 7 1 121 182 147 182;
#P connect 5 0 7 1;
#P pop;
#P newobj 32 44 60 196617 p float it;
#P flonum 233 74 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 234 338 478 565;
#P outlet 94 153 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 62 108 24 196617 int;
#P newex 112 130 61 196617 prepend set;
#P newex 94 108 41 196617 * 0.01;
#P newex 94 68 50 196617 * 100.;
#P inlet 94 47 15 0;
#P inlet 62 47 15 0;
#P outlet 112 153 15 0;
#P outlet 62 153 15 0;
#P connect 2 0 7 0;
#P connect 4 0 7 0;
#P connect 7 0 0 0;
#P connect 3 0 4 0;
#P connect 2 0 5 0;
#P connect 5 0 8 0;
#P fasten 3 0 8 0 99 65 89 65 89 128 99 128;
#P connect 5 0 6 0;
#P connect 6 0 1 0;
#P pop;
#P newobj 193 46 90 196617 p float it as well;
#P comment 182 23 61 196617 solution 2:;
#P flonum 288 47 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user incdec 173 47 15 15 0 0;
#P user incdec 11 45 15 15 0 0;
#P flonum 96 45 38 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 35 23 61 196617 solution 1:;
#P window linecount 4;
#P comment 274 74 100 196617 connect outlet 2 to what you want to
control an keep the other float only as UI;
#P connect 9 1 10 0;
#P hidden connect 9 1 2 0;
#P hidden connect 2 0 9 1;
#P connect 2 0 10 0;
#P hidden connect 3 0 9 0;
#P hidden connect 9 0 3 0;
#P connect 7 1 8 0;
#P hidden connect 4 0 7 0;
#P hidden connect 5 0 7 1;
#P hidden connect 7 2 5 0;
#P hidden connect 7 0 4 0;
#P window clipboard copycount 11;

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-49 77 51 72


March 2, 2006 | 7:11 am

> works… Anyway, proper encapsulated versions for both solutions are
> attached.
>
> Stefan
>
> #P window setfont "Sans Serif" 9.;
> #P flonum 82 74 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;

note that this patch will only open properly
when the font "sans serif" is installed on your system.

- patient 110


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