void PlayNote() { Debug.Log("Playing note"); if (!instrumentSound.isPlaying) { playNoteNextUpdate = false; double playTime = SongController.GetNearestPlayableNoteTimeFromTime(AudioSettings.dspTime); instrumentSound.PlayScheduled(playTime); recordingController.RecordNoteAtTime(playTime, instrumentNumber); } }