c_cpp Midi程序变更示例

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp Midi程序变更示例相关的知识,希望对你有一定的参考价值。

/* Send a Program Change message
   \param inProgramNumber The Program to select (0 to 127).
   \param inChannel       The channel on which the message will be sent (1 to 16).
 */
// The first number is the program change number, and the second is the channel
// Example: MIDI.sendProgramChange (2, 12); // sends PC 2 on channel 12

// ------------------------------------Example--------------------------------------

void setup()
{
    pinMode(LED, OUTPUT);
    MIDI.begin();           // Launch MIDI, by default listening to channel 1.
}

void loop()
{
    if (MIDI.read())                // Is there a MIDI message incoming ?
    {
        switch(MIDI.getType())      // Get the type of the message we caught
        {
            case midi::ProgramChange:       // If it is a Program Change,
                BlinkLed(MIDI.getData1());  // blink the LED a number of times
                                            // correponding to the program number
                                            // (0 to 127, it can last a while..)
                break;
            // See the online reference for other message types
            default:
                break;
        }
    }
}

以上是关于c_cpp Midi程序变更示例的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp 发送midi程序更改并根据按下的脚踏板控制更改消息

c_cpp MIDI控制器由jardous

c_cpp LCD MIDI Monitor v2.0

c_cpp ofApp.cpp用于MIDI时间码

c_cpp ofApp.h用于MIDI TIMECODE

c_cpp MIDI监视器(LCD)v1.0