I am trying to control a Ndef with a key of the keyboard using the GUI using the “.send” “.release” methods in order to be able to use fade in and out the Ndef. However, for the conditional to use the key I am using the isPlaying method, which is always true unless the Ndef is stop. This is the code:
case
{keycode == 49} {if(Ndef(\sca).isPlaying == true,
{Ndef(\sca).release},
{Ndef(\sca).send})}
is there another method for recognizing whether the Ndef is “released”?, or is there a form to fade in the Ndef similar to the stop(10) that fade out in order to use the isPlaying?.
isPlaying is about the internal state of the proxy. You are looking for isMonitoring (check also the helpfile). Sorry, the methods are not so clearly named, different conventions crossing there.
Perhaps I am missing something. The big problem is to have a “fade in” when playing the instrument that use the fadeTime assigned. The only form that I have found is using the .send method. I can use the .stop(fadeTime: 10) to fade out, but the .play(fadeTime: xx) seems that is not possible.
I am afraid using the .isMonitoring method is always true when using .send .release methods. Perhaps there is a different method than .send to play the instrument with a fade in that I am not aware of.
The patch is working, but I am using two keys of the keyboard per instrument. I would like to use just one by checking the state of the instrument. Perhaps I can do it assigning a global variable per instrument that change of state to make the conditional, but it would be great to not overcomplicate the code.
If you want to keep the monitor playing and know what the internal object is doing, you need to drill down (the reason is that there are many different objects that can be a node proxy source).
// check if the synth is playing
a.objects.at(0).nodeID.isNil
But I need to write an interface that is simple and reliable without digging.