// Initialize mesh renderer public void Awake() { currentMode = Categories.Instrument.BLANK; boardRenderer = board.GetComponent <Renderer>(); boardRenderer.material.color = instrumentColor; clips = clipsObject.GetComponent <Clips>(); audio = GetComponent <AudioSource>(); ac = Microphone.Start("", true, 1, 44100); solo = false; metronome = false; vertPage = 1; beatTimer = 0; bpm = 120; bars = 2; page = 1; play = false; record = false; countIn = 0; clearPressed(); }
// Sets instrument depending on passed enum public void setInstrument(Categories.Instrument instrument) { if (currentMode == instrument) { return; } currentMode = instrument; page = 1; vertPage = 1; resetBoard(); pageText.text = "1/" + bars; if (instrument == Categories.Instrument.DRUMS) { boardRenderer.material.color = Categories.drums; instText.text = "Drums"; s1.text = "Crash"; s2.text = "Hat"; s3.text = "Snare"; s4.text = "Kick"; } else if (instrument == Categories.Instrument.GUITAR) { boardRenderer.material.color = Categories.guitar; instText.text = "Guitar"; s1.text = "C"; s2.text = "D"; s3.text = "E"; s4.text = "F"; } else if (instrument == Categories.Instrument.BASS) { boardRenderer.material.color = Categories.bass; instText.text = "Bass"; s1.text = "C"; s2.text = "D"; s3.text = "E"; s4.text = "F"; } else if (instrument == Categories.Instrument.PIANO) { boardRenderer.material.color = Categories.piano; instText.text = "Piano"; s1.text = "C"; s2.text = "D"; s3.text = "E"; s4.text = "F"; } else if (instrument == Categories.Instrument.SAMPLER) { boardRenderer.material.color = Categories.sampler; instText.text = "Sampler"; s1.text = "Sound 1"; s2.text = "Sound 2"; s3.text = "Sound 3"; s4.text = "Sound 4"; } }