PopMessage() public method

public PopMessage ( ) : MidiMessage,
return MidiMessage,
Exemplo n.º 1
0
    void Update()
    {
        while (!receiver.IsEmpty)
        {
            // receiverからメッセージを取得
            var message = receiver.PopMessage();

            #region 打鍵処理

            // ステータスが90(Note On)なら
            if (message.status == 0x90 && message.data2 != 0x00)
            {
                foreach (var go in targets)
                {
                    go.SendMessage("OnNoteOn", message, SendMessageOptions.DontRequireReceiver);
                }
            }

            // ステータスが80,または90&data2が00(Note Off)なら
            if (message.status == 0x80 || (message.status == 0x90 && message.data2 == 0x00))
            {
                foreach (var go in targets)
                {
                    go.SendMessage("OnNoteOff", message, SendMessageOptions.DontRequireReceiver);
                }
            }
        }

        #endregion
    }
Exemplo n.º 2
0
    protected void Update()
    {
        while (m_Receiver.IsEmpty == false)
        {
            MidiMessageReceived(m_Receiver.PopMessage());
        }

        if (m_AutoModeAfterSeconds > 0f && m_LastAgentUpdate + m_AutoModeAfterSeconds < Time.time)
        {
            m_AgentManager.StartAutoMode();
        }
    }
Exemplo n.º 3
0
 void Update()
 {
     while (!receiver.IsEmpty)
     {
         var message = receiver.PopMessage();
         if (message.status == 0xb0)
         {
             controllers [message.data1] = 1.0f / 127 * message.data2;
             if (toLearn)
             {
                 learnt  = message.data1;
                 toLearn = false;
             }
         }
     }
 }
Exemplo n.º 4
0
 void Update()
 {
     while (!receiver.IsEmpty)
     {
         var message = receiver.PopMessage();
         if (message.status == 0x90)
         {
             foreach (var go in targets)
             {
                 go.SendMessage("OnNoteOn", message);
             }
         }
         else if (message.status == 0x80)
         {
             foreach (var go in targets)
             {
                 go.SendMessage("OnNoteOff", message);
             }
         }
     }
 }
Exemplo n.º 5
0
    void Update()
    {
        if (receiver.IsEmpty)
        {
            receiving = false;
        }
        else
        {
            receiving = true;
        }

        while (!receiver.IsEmpty)
        {
            var message = receiver.PopMessage();
            if (message.status == 0xb0)
            {
                controllers [message.data1] = 1.0f / 127 * message.data2; // MPK non-relative 1-8
                latestKnob  = ConvertToArturiaKnobs(message.data1);       // Arturia
                latestValue = -0.01f * (64 - message.data2);              // Arturia
                if (message.data1 > 8)
                {
                    if (message.data2 > 0)
                    {
                        pads [ConvertToMPKPads(message.data1)] = 1;
                    }
                    if (message.data2 == 0)
                    {
                        pads [ConvertToMPKPads(message.data1)] = 0;
                    }
                }
                if (message.status == 0xe0)
                {
                    controllers [0] = 1.0f / 127 * message.data2; // MPK non-relative 0
                }
            }
        }
    }