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
Look at Christopher's repsonse:
The dev forum is for developing C externals.
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.
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
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.
Oops, 'dspstate' does work!
I changed the addmess call to:
class_addmethod(c, (method) foo_dspstate, "dspstate", A_LONG, 0);
Very cool. Thanks.
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