void Update() { var pressure = MidiMaster.GetChannelAfterTouch(); transform.localScale = new Vector3(0.1f + pressure, 0.1f + pressure * 8.0f, 0.1f + pressure); var color = new Color(pressure, 0.0f, 0.0f, 1.0f); GetComponent <Renderer>().material.color = color; }
// get channel after touch. this API can't indicate what pad is pressed public static float GetAfterTouchPressure() { // TODO: support PolyAfterTouch return(MidiMaster.GetChannelAfterTouch()); }