how to change signal~ into numbers ???

magellan's icon

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 Patch
Copy patch and select New From Clipboard in Max.

Martin's icon

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

czesc.list's icon
Timothy Place's icon

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

Stefan Tiedje's icon

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

magellan's icon

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)