DSP off message

Dec 22, 2009 at 3:49pm

DSP off message

Hello,

I’m using the ‘dsp’ message to know when the audio has been turned on in dsp status.

Is there a way to know when the audio has been turned off?

Thanks

#47363
Dec 22, 2009 at 4:37pm

Look at Christopher’s repsonse:

http://cycling74.com/forums/topic.php?id=23563

The dev forum is for developing C externals.

#170460
Dec 23, 2009 at 12:10am

Sorry, I should have said I am writing an external.

I use the addmethod routine to cause me to be notified when the ‘dsp’ message is sent.

Is there another message, like ‘dspoff’ that I can use in exactly the same way?

Or is the only way to set up some kind of polling of the adstatus object?

Thanks again.

#170461
Dec 23, 2009 at 9:23am

Hi there,

JKC wrote this a while ago, however I am not sure if it still applies with the new SDK.
You might want to try it anyway:

addmess((method)foo_dspstate, “dspstate”, A_CANT, 0);

void foo_dspstate(t_foo *x, long n)
{
if (n) {
//dsp has been turned on
} else {
//dsp has been turned off
}
}

Hope this helps.

- Luigi

#170462
Dec 23, 2009 at 6:13pm

Thanks,Luigi,

Worth a try, but did not work. I’m using 4.6 btw.

I’ll have to use the [adstatus switch] external and prepend ‘dspstate’ to generate the msg to my external.

#170463
Dec 23, 2009 at 6:17pm

Oops, ‘dspstate’ does work!

I changed the addmess call to:

class_addmethod(c, (method) foo_dspstate, “dspstate”, A_LONG, 0);

Very cool. Thanks.

#170464
Dec 23, 2009 at 11:03pm

Yes, of course…. my bad.
It should be declared as A_LONG type.

Well, if it still works then that’s the way to do it…

Cheers.

- Luigi

#170465

You must be logged in to reply to this topic.