Пример #1
0
 public void OnReset(InputAction.CallbackContext context)
 {
     if (context.performed)
     {
         controller.AllNotesOff();
         LoopData.Init();
     }
 }
Пример #2
0
    // 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);
    }