Exemplo n.º 1
0
    public static void FlushLED(bool skipUI)
    {
        for (int x = 1; x <= 8; x++)
        {
            for (int y = 1; y <= 8; y++)
            {
                LaunchpadHandler.PadSendNote(x, y, 0, Color.gray, skipUI);
            }
        }

        for (int i = 1; i <= 33; i++)
        {
            LaunchpadHandler.mcSendNote(i, 0, Color.gray, skipUI);
        }
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        List <LEDStructure> LEDThreadQueue_RL   = new List <LEDStructure>();
        List <LEDStructure> LEDMCThreadQueue_RL = new List <LEDStructure>();

        //LED Thread Worker
        for (int i = 0; i < LEDThreadQueue.Count; i++)
        {
            LEDStructure item = LEDThreadQueue[i];
            if (Mathf.RoundToInt(Time.time * 1000) >= item.delay)
            {
                switch (item.feat)
                {
                case 0:     //On
                    LaunchpadHandler.PadSendNote(item.x, item.y, item.velocity, item.color, false);
                    break;

                case 1:     //Off
                    LaunchpadHandler.PadSendNote(item.x, item.y, item.velocity, Color.gray, false);
                    break;

                case 3:     //LED Wormhole
                    break;
                }

                LEDThreadQueue_RL.Add(item);
            }
        }

        for (int i = 0; i < LEDThreadQueue_RL.Count; i++)
        {
            LEDThreadQueue.Remove(LEDThreadQueue_RL[i]);
        }
        LEDThreadQueue_RL.Clear();



        //MC LED Thread Worker
        for (int i = 0; i < LEDMCThreadQueue.Count; i++)
        {
            LEDStructure item = LEDMCThreadQueue[i];
            if (Mathf.RoundToInt(Time.time * 1000) >= item.delay)
            {
                switch (item.feat)
                {
                case 0:     //On
                    LaunchpadHandler.mcSendNote(item.y, item.velocity, item.color, false);
                    break;

                case 1:     //Off
                    LaunchpadHandler.mcSendNote(item.y, 0, Color.gray, false);
                    break;
                }

                LEDMCThreadQueue_RL.Add(item);
            }
        }

        for (int i = 0; i < LEDMCThreadQueue_RL.Count; i++)
        {
            LEDMCThreadQueue.Remove(LEDMCThreadQueue_RL[i]);
        }
        LEDMCThreadQueue_RL.Clear();

        if (LaunchpadHandler.midiinput_avail == true && PadInfoRequestQueue.Count > 0)   //LAUNCHPAD HANDLER (MAIN THREAD)
        {
            PadInfoStructure item = PadInfoRequestQueue.Dequeue();
            Pad_VTouch(item.chain, item.x, item.y, item.touchMode);
        }
    }