Forums > Dev

DSP off message

December 22, 2009 | 3:49 pm

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


December 22, 2009 | 4:37 pm

Look at Christopher’s repsonse:

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

The dev forum is for developing C externals.


December 23, 2009 | 12:10 am

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.


December 23, 2009 | 9:23 am

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


December 23, 2009 | 6:13 pm

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.


December 23, 2009 | 6:17 pm

Oops, ‘dspstate’ does work!

I changed the addmess call to:

class_addmethod(c, (method) foo_dspstate, "dspstate", A_LONG, 0);

Very cool. Thanks.


December 23, 2009 | 11:03 pm

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


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