// Update is called once per frame
    void Update()
    {
        if (dataLastFrame != data)
        {
            ReleaseBuffer();
            SetupWave();
        }

        dataLastFrame = data;

        UpdateWave();
    }
 // Start is called before the first frame update
 void Start()
 {
     dataLastFrame = data;
     SetupWave();
 }