// Update is called once per frame void Update() { if (Input.GetKey(KeyCode.LeftShift)) { shiftOctave = 1; } else { shiftOctave = 0; } foreach (NoteName n in Enum.GetValues(typeof(NoteName))) { if (KeyboardInput.KeyDown(n)) { //TrackGenerator.GenerateHarmonyTable(n, TableManager.GetTable(TableType.RatioBasedTable)); PatternGenerator.CreatePattern(); } if (KeyboardInput.KeyHeld(n)) { attachedOscillator.PlayNote(KeyboardInput.NoteToStep(n), 4 + shiftOctave); return; } } attachedOscillator.PlayNote(-1, 0); }
private bool PlayNote() { if (track != null) { attachedOscillator.PlayNote(track.step, track.octave); UpdateBeatLength(); return(true); } else { active = false; //end of track reached attachedOscillator.StopNote(); return(false); } }