Forums > MaxMSP

Random count~ bangs?

February 29, 2008 | 9:54 pm

can anyone help me with my count~ problem, i want to count from 0 to 255 then stop. it is imperative that the edge~ object outputs a single bang when the count has finished as this is used to start other processes. but it seems im getting random quantities of bangs. I have the I/O and signal vectors both set to 256 this isn’t the cause is it?

#P window setfont "Sans Serif" 9.;
#P number 96 232 58 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#N counter;
#X flags 0 0;
#P newobj 82 190 66 196617 counter;
#P button 60 60 15 0;
#P newex 81 139 36 196617 edge~;
#P newex 81 114 49 196617 ==~ 255;
#P message 86 70 29 196617 stop;
#P newex 69 92 70 196617 count~ 0 256;
#P user ezdac~ 163 64 207 97 0;
#P window linecount 6;
#P comment 168 136 100 196617 getting a random amounst of bangs sometimes increments of 1 sometimes as high as 16;
#P connect 5 1 7 0;
#P fasten 5 1 3 0 112 175 141 175 141 65 91 65;
#P connect 6 0 2 0;
#P connect 3 0 2 0;
#P connect 4 0 5 0;
#P connect 7 0 8 0;
#P connect 2 0 4 0;
#P window clipboard copycount 9;


March 1, 2008 | 8:52 am

On Feb 29, 2008, at 1:54 PM, ben Gilman wrote:
> can anyone help me with my count~ problem, i want to count from 0 to
> 255 then stop. it is imperative that the edge~ object outputs a
> single bang when the count has finished as this is used to start
> other processes. but it seems im getting random quantities of bangs.
> I have the I/O and signal vectors both set to 256 this isn’t the
> cause is it?

I think that the I/O and signal vector being the same has something to
do with it. I had no problems as long as the signal vector was smaller
than the I/O vector.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 111 216 14 196617 0;
#P number 69 274 58 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter;
#X flags 0 0;
#P newobj 69 251 66 196617 counter;
#P number 143 274 58 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter;
#X flags 0 0;
#P newobj 143 250 66 196617 counter;
#P button 130 93 15 0;
#P newex 142 199 36 196617 edge~;
#P newex 142 174 49 196617 ==~ 255;
#P message 147 130 29 196617 stop;
#P newex 130 152 70 196617 count~ 0 256;
#P user ezdac~ 224 124 268 157 0;
#P window linecount 6;
#P comment 229 196 100 196617 getting a random amounst of bangs
sometimes increments of 1 sometimes as high as 16;
#P connect 11 0 9 3;
#P connect 11 0 7 3;
#P connect 6 0 9 0;
#P connect 6 0 2 0;
#P connect 5 1 7 0;
#P fasten 5 1 3 0 173 235 202 235 202 125 152 125;
#P connect 9 0 10 0;
#P connect 2 0 4 0;
#P connect 7 0 8 0;
#P connect 4 0 5 0;
#P connect 3 0 2 0;
#P window clipboard copycount 12;

Chris Muir
cbm@well.com


March 1, 2008 | 6:47 pm

I tried setting the I/O vector to 512 and i still seem to be having the same problem. Really not sure what is going on. im may have to use some other form of counting using different objects, i need it to be sample accurate though.
regards ben

> I think that the I/O and signal vector being the same has something to
> do with it. I had no problems as long as the signal vector was smaller
> than the I/O vector.


March 1, 2008 | 7:26 pm

On Mar 1, 2008, at 10:47 AM, ben Gilman wrote:

> I tried setting the I/O vector to 512 and i still seem to be having
> the same problem. Really not sure what is going on. im may have to
> use some other form of counting using different objects, i need it
> to be sample accurate though.

It worked fine for me w/ 64 & 256, fwiw.

Chris Muir
cbm@well.com


March 1, 2008 | 9:09 pm

its working now thanks for your help, i set the MAX SCHEDULER IN OVERDRIVE and SCHEDULE IN AUDIO INTERRUPT to on. but im unsure what these settings do and if they should be turned to on.

>It worked fine for me w/ 64 & 256, fwiw.


March 2, 2008 | 6:38 am

> its working now thanks for your help, i set the MAX SCHEDULER IN OVERDRIVE and SCHEDULE IN AUDIO INTERRUPT to on. but im unsure what these settings do and if they should be turned to on.

The explanation of these concepts is covered in the msp-tutorials-and-topics.

What happens in your patch is that before count~ has had the chance to evaluate the stop message, it has repeated its count to 255 a number of times. The simplest fix is to remove the upper boundary to the count~.

In these cases the use of capture~ is helpful.

_
johan


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