DSP off message

Dec 22, 2009 at 3:49pm

DSP off message


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?


Dec 22, 2009 at 4:37pm

Look at Christopher’s repsonse:


The dev forum is for developing C externals.

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.

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

Dec 23, 2009 at 6:13pm


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.

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.

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…


- Luigi


You must be logged in to reply to this topic.