Forums > MaxMSP

how to change signal~ into numbers ???

August 5, 2006 | 4:50 am

hello great guys at the forum.

I need some advice if there is an object that can change signal~ into number (max message).

So far I noticed that number~ and snapshot~ can do the task,
but they both have intervals.
number~: minimum intervals 50ms
snopshot~: minimum intervals 1ms

I want to be as fast as signal~ in my patch.
Is there a method or an object that can do this with 0 intervals, or at least in sample intervals (vector size?) ???

This is what I’m trying to do, thank you.

max v2;
#N vpatcher 411 360 1163 978;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 270 367 36 196617 here !;
#P flonum 261 384 54 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 261 315 46 196617 phasor~;
#P window linecount 2;
#P comment 320 339 149 196617 objectX~: 0 interval to chage signal into numbers;
#P window linecount 1;
#P message 261 339 50 196617 objectX~;
#P window linecount 2;
#P comment 353 168 100 196617 snapshot~: minimum interval 1;
#P window linecount 1;
#P comment 271 200 36 196617 here !;
#P toggle 261 135 15 0;
#P message 338 135 14 196617 1;
#P flonum 261 216 68 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 261 168 87 196617 snapshot~;
#P flonum 111 216 68 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user number~ 111 168 184 183 9 3 3 2 0. 0. 0 0. 50 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 261 86 14 196617 1;
#P user ezdac~ 607 134 651 167 0;
#P newex 261 66 61 196617 delay 1000;
#P newex 261 43 48 196617 loadbang;
#P newex 111 135 55 196617 phasor~ 1;
#P comment 156 200 36 196617 here !;
#P window linecount 2;
#P comment 4 168 104 196617 number~: minimum interval 50;
#P window linecount 1;
#P comment 261 428 100 196617 possible? thx.;
#P comment 261 285 141 196617 THIS IS WHAT I WANT TO DO;
#P connect 8 0 4 0;
#P connect 4 0 9 0;
#P connect 9 1 10 0;
#P connect 5 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 14 0;
#P connect 4 0 11 0;
#P connect 14 0 11 0;
#P connect 11 0 12 0;
#P connect 19 0 17 0;
#P connect 17 0 20 0;
#P connect 8 0 13 0;
#P connect 13 0 11 1;
#P connect 8 0 7 0;
#P pop;


August 5, 2006 | 5:57 am

I’m not sure but, have you tried "count~" ?


August 5, 2006 | 11:42 am


August 5, 2006 | 3:52 pm

In most cases, I think you would be best to keep everything in the
signal domain if you really need updates that fast.

That said, there is an external (tap.sift~) in Tap.Tools that will attempt to convert a signal to a float any time the value of the signal changes.

Keep in mind, however, that the data rate scheduler/queue in Max is not running as fast as the signal chain. This means that if you try to convert every sample to a float and send it you will either blow Max’s stack (because it can’t keep up) or have to drop some data. The tap.sift~ object has an internal queue so that it drops data if there are too many changes in too short a period of time. I personally wouldn’t try to push it more than 1 to 5 ms of granularity if possible.

I hope this helps,
-Tim


August 13, 2006 | 8:53 am

magellan wrote:
> I want to be as fast as signal~ in my patch.
> Is there a method or an object that can do this with 0 intervals, or at least in sample intervals (vector size?) ???
>
> This is what I’m trying to do, thank you.

Its not quite clear why you would want to do this, what for… The
scheduler interval is probably longer than 1 ms anyway. A snapshot~ with
1 ms creates more events than you possibly want to deal with (means its
very expensive cpu wise)

You could do this eventually within mxj~ and java, but I have no idea why…

In normal Max its not possible and doesn’t make sense, if you do have a
use for it, than just stay in the audio domain.

For displaying purposes 50ms is more than enough (translates to 20 Hz
flicker rate).

If you just want to grab single audio events, then use edge~ in
combination with an audiorate detection of what you want to grab…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


August 15, 2006 | 7:10 am

thx for the tips, guys.

I always thought signals were always faster than Max messages,
but I guess I was wrong.
Signal vector size applies to Max messages, too ?
hmm,

anyhow, thx to this guy in Japan who build an external to change max messages directly into signals.
It’s less than 1ms and it’s amazingly fast.

t_int *offset_perform(t_int *w)// our perform method if one signal
inlet is connected
{
t_float *in = (t_float *)(w[1]);
t_omb *x = (t_omb *)(w[2]);
int n = (int)(w[3]);

if (x->x_obj.z_disabled) goto out;
for(long i=0; ifloatoutlet , *in++ );
out:
return (w+4);
}

if you only need the last float number from the vector sized sample,
change the lines to…

for(long i=0; ifloatoutlet , *in++ ); ?
outlet_folat(x->floatoutlet , *( in+n-1 ) );

(i hope this is making any sence)


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