void PlayChord() { for (int i = 0; i < _chord.Length; i++) { int note = _key + _chord [i]; _synth.NoteOn(note, 1, Metronome.instance.GetEighthDur()); } }
void OnBeat(int beat) { if (_playThisBeat) { _synth.NoteOn(_pedalTone, 1, Metronome.instance.GetBeatDur() - 0.01f); } _playThisBeat = !_playThisBeat; }
void PlayNote() { int note = _key + _notes [Random.Range(0, _notes.Length)]; if (!_synth.IsNoteOn(note)) { _synth.NoteOn(note, 1, Metronome.instance.GetBeatDur() / 2f); } }
// Update is called once per frame void FixedUpdate() { if (text) { text.text = "" + leftThumbstickVal; } //Debug.Log(OVRInput.Get((OVRInput.Axis2D.PrimaryThumbstick))); //UpdateRangeOfMotion(); float diffY = hand.position.y - defaultPos.y; diffY = Remap(diffY, -rangeOfMovementY, rangeOfMovementY, -10, 10); float diffX = hand.position.x - defaultPos.x; source.panStereo = getPan(diffX); //synth.SetParameterAtIndex(3, Remap(diffX, -1f, 1f, 0f, 1f)); //synth.SetParameterAtIndex(4, Remap(diffY, -5f, 5f, 0f, 1f)); //Debug.Log(noteMin); int tempNote = noteMin + Mathf.RoundToInt(diffY); //Debug.Log(tempNote + "\n" + diffY); if (tempNote != currentNote) { ChordOff(currentNote); currentNote = tempNote; ChordOn(currentNote); } if (Input.GetKeyDown(KeyCode.A)) { synth.AllNotesOff(); synth.NoteOn(60, 1f); } if (vrEnabled) { VRInput(); } SetFilter(); //Debug.Log(leftThumbstickVal); }
public static void PlayChord(Chord chord, HelmController controller, float velocity) { for (int i = 0; i < chord.notes.Length; i++) { int note = chord.notes[i]; if (controller.IsNoteOn(note)) { controller.NoteOff(note); } controller.NoteOn(note, velocity); } }
public void Hit() { _synth.NoteOn(_key + _note, 1, 0.15f); _scaleAlpha = 0; }