Last active
March 21, 2024 11:58
-
-
Save YuuichiAkagawa/4226da674be9fc619b67e6607b797608 to your computer and use it in GitHub Desktop.
NUX MG-300 CC test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
******************************************************************************* | |
* NUX MG-300 CC test | |
* Copyright (C) 2021 Yuuichi Akagawa | |
* | |
* This is sample program. Just sample. | |
******************************************************************************* | |
*/ | |
#include <usbh_midi.h> | |
#include <usbhub.h> | |
USB Usb; | |
//USBHub Hub(&Usb); | |
USBH_MIDI Midi(&Usb); | |
void MIDI_poll(); | |
void setup() | |
{ | |
Serial.begin(115200); | |
if (Usb.Init() == -1) { | |
while (1); //halt | |
}//if (Usb.Init() == -1... | |
delay( 200 ); | |
} | |
void loop() | |
{ | |
Usb.Task(); | |
if( Midi ) { | |
MIDI_poll(); | |
changePatch(10); | |
delay(1000); | |
changePatch(11); | |
delay(1000); | |
} | |
} | |
// Poll USB MIDI Controler | |
void MIDI_poll() | |
{ | |
uint8_t inBuf[ 3 ]; | |
while(Midi.RecvData(inBuf)) | |
; | |
} | |
void changePatch(uint8_t npatch) | |
{ | |
uint8_t buf[3]; | |
buf[0] = 0xb0; | |
buf[1] = 60; | |
buf[2] = npatch; | |
Midi.SendData(buf); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello.
I hope you can help me since I am really not sure how to approach it properly.
I purchased the NUX MG300 and a MIDI switching device called Melo Midi Commander, together with Bluetooth MID send/receive devices called MS1.
From what I see on this page, I need to send the texts written by Mr. Yuiixhi to MG300, but how do I do that?
I am not very experienced in this data-transmitting endeavor between PCs and devices, so it would be great if you could point me in the right direction.
I will be waiting for your reply.
m(..)m
Satnamtaro