heavy icon indicating copy to clipboard operation
heavy copied to clipboard

Unity, struggling to send bangs

Open andypandy47 opened this issue 7 years ago • 4 comments

Hi there! I cant seem to access the SendBangToReceiver function within my Heavy Unity plugin script.

` public class PhoneDial : MonoBehaviour {

public Hv_DTMF_Tones_AudioLib dialTones;
public GameObject dial_01;
public GameObject dial_02;
public GameObject dial_03;
public GameObject dial_04;
public GameObject dial_05;
public GameObject dial_06;
public GameObject dial_07;
public GameObject dial_08;
public GameObject dial_09;

public GameObject gameController;

// Use this for initialization
void Start ()
{
    Hv_DTMF_Tones_AudioLib dialTones = GetComponent<Hv_DTMF_Tones_AudioLib>();
    
}


public void dialSound()
{
    if (gameObject.tag == "Dial")
    {
        if (gameObject == dial_01 || dial_04 || dial_07)
        {
            Debug.Log("dial_01");

            dialTones.
        }
        if (gameObject == dial_02)
        {
            
        }
    }
}

} `

Im just trying to send bang messages to the bangs that create each dial sound in my patch. Each bang is setup to receive input with "r dial_01 @hv_param" "r dial_02 @hv_param" etc. The bangs are exposed in Unity and i can access them in script, however only as floats which makes me think im not doing something right. I also cannot access some of the functions like the one i need for this to work "SendBangToReceiver" or "SendEvent". The GameObject that the Heavy AudioLib script is on is referenced correctly in the Unity UI (at least to my understanding). Any help would be much appreciated.

Thanks!

andypandy47 avatar Jul 24 '17 12:07 andypandy47

Hi @andypandy47 you should use the @hv_event description on your receiver objects to handle bangs. @hv_param is for a float only interface.

See here for more info https://enzienaudio.com/docs/index.html#06.unity#exposing-and-sending-events

diplojocus avatar Jul 24 '17 13:07 diplojocus

thanks! i still cant get audio out but theres probably a bunch of reasons why. I need to do some trouble shooting and really read over that documentation, but im sure i'll get there eventually.

andypandy47 avatar Jul 24 '17 17:07 andypandy47

Can you get audio working with a very simple patch? Might be good to start there first.

diplojocus avatar Jul 24 '17 17:07 diplojocus

Yeah that was a good call, got it all working in the end and pretty happy with the results. Ive used the DTMF tones patch from Andy Farnell's designing sound book and it is set up in a way where instead of physically connecting the bangs to send the tone for each of the dials, he uses the bangs as a send(as in send symbol: in the bang properties) and i dont think Heavy liked that too much. After physically connecting the bangs it worked fine! Thanks very much for your help!

andypandy47 avatar Jul 24 '17 22:07 andypandy47