public void Play(float freq, float dur) { if (instrument_name == "trumpet") { grand_parent.RunChuckCode(ChuckSynths.Trumpet(freq, dur)); } else if (instrument_name == "violin") { grand_parent.RunChuckCode(ChuckSynths.Violin(freq, dur)); } else if (instrument_name == "bell") { grand_parent.RunChuckCode(ChuckSynths.Bell(freq, dur)); } else if (instrument_name == "flute") { grand_parent.RunChuckCode(ChuckSynths.Flute(freq, dur)); } }
private void Play(float dur, bool hit = false) { if (!hit) { GetComponentInChildren <Instrument>().Play(note_freq, dur); Instantiate(note_spray, transform); } else if (hit) { parent.RunChuckCode(ChuckSynths.BG_Plucked_String(note_freq, dur)); } }