public void typeMessage() { if (inputChecker() >= 0) { if (currentMessage.Count < lineLength) { controller.NoteOn(notes[Random.Range(0, 7)], 0.3f, 0.1f); GameObject newMoj = Instantiate(EmojiFab, EmojiCue.transform); newMoj.GetComponent <SpriteRenderer>().sprite = emoji[Random.Range(0, emoji.Count - 1)]; newMoj.transform.position = new Vector3(newMoj.transform.position.x + (0.5f * currentMessage.Count), newMoj.transform.position.y, newMoj.transform.position.z); currentMessage.Add(newMoj); } } if (Input.GetKeyDown(KeyCode.Return)) { foreach (GameObject obj in currentMessage) { obj.SetActive(false); } createMessage(); currentMessage.Clear(); Debug.Log("Turn passed to CPU"); isMyTurn = false; } }
void NoteOn(int index) { if (synth) { synth.NoteOn(GetKeyFromIndex(index)); } keys[index].SetOn(true); }
IEnumerator Start() { rb = this.GetComponent <Rigidbody>(); yield return(new WaitForSeconds(1f)); helmController.NoteOn(60, 1f); }
void Update() { if (Input.GetMouseButtonDown(0)) { controller.NoteOn(note); } if (Input.GetMouseButtonUp(0)) { controller.NoteOff(note); } }
// Update is called once per frame void Update() { if (!helmController.IsNoteOn(note)) { helmController.NoteOn(note, velocity, duration); } // helmController.SetParameterPercent(AudioHelm.Param.kFilterEnvelopeDepth, (Time.time * 0.3f)/100); // beam.spotAngle = Time.time * 0.1f; // beam.UpdateAfterManualPropertyChange(); }
void Update() { int note = Random.Range(min, max); if (Random.Range(0.0f, 1.0f) < 0.5f) { player.NoteOn(note); } else { player.NoteOff(note); } }
void OnCollisionEnter2D(Collision2D collision) { int note = GetNote(); float strength = GetCollisionStrength(collision); if (synth) { synth.NoteOn(note, strength, noteLength); } MaterialPulse pulse = GetComponent <MaterialPulse>(); if (pulse) { pulse.Pulse(strength); } }
private void OnCollisionEnter(Collision Collision) { helmController.SetParameterPercent(AudioHelm.Param.kSubVolume, subVolume); helmController.NoteOn(note, 1.0f, 0.5f); }
// Function that calls midi note on with defined note value and velocity void startNote() { // Note on with defined values helmController.NoteOn(midiNote, velocity, 1f); }