void Awake() { /* Check if any instances of the * pitch tracker have been initialized; * quit if this is the case */ if(_instance == null){ _instance = this; } else{ Debug.LogError("Only one instance of CTGPitchTracker may be active in the scene!"); enabled = false; return; } }
void Start() { /* Grab the instance of * the pitch tracker. */ tracker = CTGPitchTracker.Tracker; /* Add a listener here * to be notified when a * new note is detected. */ tracker.NoteDetected += onNoteDetected; }