Forums > MaxMSP

Is it a trigger, counter, step rate, or number box problem?

June 2, 2006 | 8:36 pm

I’m clearly not getting a concept here. I’m trying to turn a knob
back and forth to interpolate presets with pattr (the number box at
the top is emulating ctlin), and when it goes slow, things are fine.
When I move the numbers quickly, it completely doesn’t work. The
division at the bottom (/ 501.) worked when the ramp was 10000ms. I
would like to be able to turn the knob at varying speeds, so maybe
this idea won’t work. Any help, or a redirect to a relevant post
would be great.

Thanks,
Keith

max v2;
#N vpatcher 74 128 372 638;
#P window setfont "Sans Serif" 9.;
#P flonum 101 418 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 57 65 68 196617 127 , 0 1000;
#P message 107 84 68 196617 0 , 127 1000;
#P newex 104 108 40 196617 line;
#P newex 42 371 20 196617 t b;
#P message 233 92 14 196617 0;
#P newex 42 424 40 196617 / 501.;
#P button 189 347 15 0;
#N counter;
#X flags 0 0;
#P newobj 42 393 66 196617 counter;
#P flonum 42 451 39 9 0. 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 99 139 35 9 0 127 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 42 350 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gswitch 42 289 41 32 0 0;
#P user gswitch2 70 192 39 32 0 0;
#P newex 109 262 58 196617 select 127;
#N vtable 128 20 74 230 241 16 128;
#T set 0 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113
112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94
93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71
70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48
47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25
24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0;
#P newobj 109 233 32 196617 table;
#P newex 42 262 58 196617 select 127;
#N vtable 128 20 74 230 241 16 128;
#T set 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127;
#P newobj 42 234 32 196617 table;
#P newex 42 328 81 196617 zmap 0 127 0 1;
#P comment 149 348 35 196617 reset;
#P connect 6 0 2 0;
#P connect 2 0 3 0;
#P fasten 5 0 7 0 114 285 47 285;
#P connect 3 0 7 0;
#P connect 7 0 1 0;
#P connect 1 0 8 0;
#P connect 8 0 15 0;
#P connect 15 0 11 0;
#P connect 19 0 13 0;
#P connect 13 0 10 0;
#P fasten 2 0 7 1 47 256 38 256 38 285 62 285;
#P fasten 5 0 6 0 114 285 38 285 38 186 75 186;
#P fasten 3 0 6 0 47 285 38 285 38 186 75 186;
#P fasten 4 0 7 2 114 257 104 257 104 285 77 285;
#P connect 12 0 11 3;
#P connect 16 0 9 0;
#P connect 14 0 9 0;
#P connect 9 0 6 1;
#P connect 11 0 19 0;
#P connect 18 0 16 0;
#P connect 17 0 16 0;
#P connect 6 1 4 0;
#P connect 4 0 5 0;
#P connect 12 0 14 0;
#P pop;


June 3, 2006 | 7:43 am

works for me… at basically any speed. Am I correct in my understanding that the error you are encountering is that the update of the result after the [/501.] is slow or irregular?
Are there some preferences in Max which could affect this?


June 3, 2006 | 12:33 pm

Hi,

Yes, I can confirm that problem, same here. grmpf.. Also wanted to
use that with a controller….

marlon


June 3, 2006 | 12:51 pm

You may be assuming that fast changes made on the controller / number
box still hit every value (0-127), which is certainly not true, and
seems to be an assumption of your patch. Is this what you want to do?

jb

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 102 429 27 196617 t f f;
#P newex 102 483 37 196617 abs 0.;
#P newex 102 453 27 196617 – 0.;
#P message 146 507 14 196617 0;
#P newex 102 505 29 196617 t b f;
#P newex 102 531 50 196617 accum 0.;
#P message 117 125 68 196617 127 , 0 1000;
#P message 167 144 68 196617 0 , 127 1000;
#P newex 164 168 40 196617 line;
#P message 293 152 14 196617 0;
#P button 249 407 15 0;
#P flonum 102 564 39 9 0. 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 159 199 35 9 0 127 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 102 410 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user gswitch 102 349 41 32 0 0;
#P user gswitch2 130 252 39 32 0 0;
#P newex 169 322 58 196617 select 127;
#N vtable 128 20 74 230 241 16 128;
#T set 0 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113
112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94
93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71
70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48
47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25
24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0;
#P newobj 169 293 32 196617 table;
#P newex 102 322 58 196617 select 127;
#N vtable 128 20 74 230 241 16 128;
#T set 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127;
#P newobj 102 294 32 196617 table;
#P newex 102 388 81 196617 zmap 0 127 0 1;
#P comment 209 408 35 196617 reset;
#P connect 19 0 20 0;
#P connect 21 0 19 1;
#P connect 21 1 19 0;
#P connect 8 0 21 0;
#P connect 20 0 17 0;
#P connect 11 0 18 0;
#P connect 11 0 12 0;
#P connect 16 0 10 0;
#P connect 18 0 16 0;
#P connect 17 0 16 0;
#P connect 17 1 16 1;
#P fasten 4 0 7 2 174 317 164 317 164 345 137 345;
#P connect 4 0 5 0;
#P connect 6 1 4 0;
#P connect 14 0 13 0;
#P connect 15 0 13 0;
#P connect 9 0 6 1;
#P connect 12 0 9 0;
#P connect 13 0 9 0;
#P fasten 3 0 6 0 107 345 98 345 98 246 135 246;
#P fasten 5 0 7 0 174 345 107 345;
#P fasten 5 0 6 0 174 345 98 345 98 246 135 246;
#P connect 2 0 3 0;
#P fasten 2 0 7 1 107 316 98 316 98 345 122 345;
#P connect 1 0 8 0;
#P connect 7 0 1 0;
#P connect 3 0 7 0;
#P connect 6 0 2 0;
#P window clipboard copycount 22;

Am 02.06.2006 um 22:36 schrieb keith manlove:

> I’m clearly not getting a concept here. I’m trying to turn a knob
> back and forth to interpolate presets with pattr (the number box at
> the top is emulating ctlin), and when it goes slow, things are fine.
> When I move the numbers quickly, it completely doesn’t work. The
> division at the bottom (/ 501.) worked when the ramp was 10000ms. I
> would like to be able to turn the knob at varying speeds, so maybe
> this idea won’t work. Any help, or a redirect to a relevant post
> would be great.


June 3, 2006 | 1:28 pm

Hi,

no, what I was aiming at was more sth. like this (with lists) and it
seems to work smoothly.

cheers.
m

#P window setfont "Sans Serif" 9.;
#P number 304 233 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 253 233 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 395 111 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum[3];
#P flonum 353 111 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum[2];
#P window linecount 1;
#P newex 304 188 29 196617 * 0.;
#P newex 253 188 29 196617 * 0.;
#P user multiSlider 203 458 224 83 0. 127. 1 3433 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P user multiSlider 203 370 224 83 0. 127. 1 3433 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P comment 519 89 108 196617 Meta-CTLIN;
#P window linecount 2;
#P comment 311 60 96 196617 n coefficients for each of the ctlins;
#P flonum 311 111 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum[1];
#P flonum 519 104 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname flonum;
#P window linecount 1;
#P message 519 123 69 196617 recall 1 2 $1;
#P message 519 142 78 196617 storagewindow;
#P number 453 133 35 9 0 0 64 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P objectname number;
#P message 453 163 49 196617 store $1;
#P newex 453 184 67 196617 pattrstorage;
#X client_rect 843 92 1483 332;
#X storage_rect 20 74 660 314;
#P objectname u194000009;
#P newex 311 87 53 196617 autopattr;
#X prestore flonum[1] 1 0 1.;
#X prestore flonum[2] 1 0 0.;
#X prestore flonum[3] 1 0 0.5;
#P objectname u357000010;
#P user multiSlider 203 278 224 83 0. 127. 1 3433 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P number 203 233 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 203 189 29 196617 * 0.;
#P number 203 166 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 251 86 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 203 86 15 0;
#P newex 203 136 71 196617 drunk 128 10;
#P newex 203 111 58 196617 metro 100;
#P window linecount 3;
#P comment 131 145 71 196617 this should be a list of values ->;
#P connect 26 0 20 0;
#P connect 25 0 19 0;
#P connect 5 0 6 0;
#P connect 5 0 21 0;
#P connect 5 0 22 0;
#P connect 21 0 25 0;
#P connect 22 0 26 0;
#P connect 24 0 22 1;
#P connect 23 0 21 1;
#P connect 9 0 16 0;
#P connect 9 0 23 0;
#P connect 9 0 24 0;
#P connect 16 0 6 1;
#P connect 14 0 10 0;
#P connect 13 0 10 0;
#P connect 11 0 10 0;
#P connect 12 0 11 0;
#P connect 15 0 14 0;
#P connect 7 0 8 0;
#P connect 6 0 7 0;
#P connect 2 0 5 0;
#P connect 4 0 1 1;
#P connect 1 0 2 0;
#P connect 3 0 1 0;
#P window clipboard copycount 27;


June 3, 2006 | 1:50 pm

Although this nicely demonstrates how to hook an external source to
the recall values of pattrstorage, I’m afraid don’t see what this
patch and Keith Manlove’s problem have to do with each other.

jb


June 3, 2006 | 2:09 pm

Nothing, Jeremy…

It was just a misunderstanding, i replied too quickly, assuming u
were meaning me when asking if its what i wanted to do… sorry for
that. ;-)

marlon


June 3, 2006 | 5:15 pm

> works for me… at basically any speed. Am I correct in my understanding that the error you are encountering is that the update of the result after the [/501.] is slow or irregular?
> Are there some preferences in Max which could affect this?

It never worked for me, and yes, my patch assumed (or hoped) that it
would hit every number, which it obviously doesn’t. Is there a way to
make it, or some better option? I tried different inputs, did you use
some different input?

Keith


June 3, 2006 | 5:26 pm

Jeremy-

I’m sorry to post again, but will this be the case with the ctlin as
well? The main problem of this patch is to get it to move through the
presets. It took forever to figure out a way to not just go from 0 to
1 over and over (I used sprintf, etc), and I arrived at this. I was
really surprised when it didn’t even work with the line object.

Thanks,
Keith


June 3, 2006 | 6:09 pm

Keith.

This patch will be double overkill, but it almost guarantees that a fast cc
controller gesture will pass a stream of numbers that does not skip any
values. This is just applying some principles of sampling theorem. To
improve resolution, Increase the sampling rate(make grain size smaller) and
bit depth (scale values up before interpolation so there are more values
between which to interpolate [making line do floating point operations
should already do this, but why risk it...])

Try connecting these in order.

Inlet // inlet to subpatch
* 32000. // scale thing up.
Pack f 10 // make list value,slewtime
line 0. 1 // make line interp. floats with grain of 1ms (fast!)
/32000. // scale things back down
+ 0.5 // round float up before converting to ints
Number // convert to int
Outlet // outlet to main patch

Note, If your cc inputs are skipping values greater than 10 increase the
slewtime…

-lcc


June 3, 2006 | 11:02 pm

Yes. Does my patch do what you want?

jb


June 4, 2006 | 4:58 am

Yes, it’s accounting for all of the steps, no matter the speed. It
will suddenly jump up a whole number, but I’m pretty sure I can figure
that out.

Thanks,
Keith


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