NUX - MG-300 Midi implementation guide

Started by sixeight, September 06, 2020, 08:53:54 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sixeight

Here the results of reading the MIDI traffic between the MG-300 and the Quicktone editor using MIDI monitor.

I hope to make a video of the MG-300 and the VC-mini / VController soon.

(join Vguitarforums.com to access)

admin


Scaase

#2
Hey there,

Thanks for the implementation guide - I've made a start on my own MG300 auto patch changer and library manager from the information provided, and would like to offer the following additions:

NOTE: I'm not 100% certain these are fully correct, but, so far seem to be.

byte 18 Cab selection
byte 19 Mic selection
bytes 21-26 Compressor values (first two bytes, 0-99 dec - remaining bytes unused?)
bytes 28-33 EFX - number of bytes used depend on the EFX unit selected.
bytes 35-40 AMP - number of bytes used depend on AMP selected
bytes 42-47 EQ
bytes 49-54 NR (only first two bytes used)
bytes 56-59 Modulation
byte 60 modulation pre (0) or post (1)
bytes 61-64 Delay
byte 68 delay pre (0) or post (1)
bytes 70 - 75 Reverb
byte 76 mic position


Cheers,
- S


edit: just realised I forgot to note: these bytes are in response to a numbered or current patch info request, per the midi implementation guide.

s.velichko

 Hello respecteds, please, tell me how to make automatic switching of presets in MG300 from DAW LOGIC on MACOS. Thank you in advance for yours answers.

sixeight

Quote from: s.velichko on January 04, 2021, 10:53:14 AM
Hello respecteds, please, tell me how to make automatic switching of presets in MG300 from DAW LOGIC on MACOS. Thank you in advance for yours answers.

I do not have Logic. But you need to send a midi CC message to the MG-300. Channel 1, number 60, value is patch number.

s.velichko


wo2507

Quote from: sixeight on January 04, 2021, 01:11:27 PM
I do not have Logic. But you need to send a midi CC message to the MG-300. Channel 1, number 60, value is patch number.

is it work with any midi controller that can send CC messages  ?
i made the midi to usb host, i load the firmware from bidirectional example sketch..
tried to send midi messages : CC60 , Value 10 , Chanel 1.
mg300 patch doesn't change. but when i tried to send CC74 value 65 channel 1 to my ms50g,  it's  work ( tuner mode is on )
any suggestions to fix this issues  ?
thanks in advance

sixeight

The editor uses cc#73 to change patches. Maybe that one works for you. I still need to upload the latest firmware and see if things have changed.

What firmware is your MG-300?

wo2507

Quote from: sixeight on February 19, 2021, 10:01:17 AM
The editor uses cc#73 to change patches. Maybe that one works for you. I still need to upload the latest firmware and see if things have changed.

What firmware is your MG-300?

latest version ( V.2.01.01 )

thank you,  i will try it


sixeight

That looks very familiar. But then again, the VC-mini code is freely available on the internet.

wo2507

witch #CC60 and #CC73 still not working with my midi controller  :( :(
but it work with DAW, i use cubase5  to change the patch with #CC60

sixeight

The USB midi implementation of the MG-300 is very tricky to get working. What USB host board are you using? Is it Arduino? What code?


wo2507

Quote from: sixeight on March 04, 2021, 06:09:12 AM
The USB midi implementation of the MG-300 is very tricky to get working. What USB host board are you using? Is it Arduino? What code?

Quote from: sixeight on March 04, 2021, 06:09:12 AM
The USB midi implementation of the MG-300 is very tricky to get working. What USB host board are you using? Is it Arduino? What code?

yes, i use usb host shield 2.0 for arduino.

i made 2 devidec, the first one is 5 channel pedal switcher from here :
https://www.instructables.com/arduino-programable-5-pedal-switcher/

and the other one is midi to usb host from here :

http://cyfrowogitarowo.pl/wp-content/uploads/2014/04/MIDI-USB-HOST-DIY-tutorial.pdf

so i connet the midi out from ny pedal switcher to usb host midi converter,

here is my code :

#include <EEPROM.h>
#include <Keypad.h>
const byte rows = 5;
const byte cols = 3;
char keys[rows][cols] = {
{'a','f','k'},
{'b','g','l'},
{'c','h','m'},
{'d','i','n'},
{'e','j','o'}
};
byte rowPins[rows] = {2,3,4,5,6};
byte colPins[cols] = {7,8,9};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, rows, cols);
int relayPin[5] = {10,11,12,13,14};
int ledPin[5] = {15,16,17,18,19};
byte midiChannel = 0;
#include <MIDI.h>
#include <midi_Defs.h>
#include <midi_Message.h>
#include <midi_Namespace.h>
#include <midi_Settings.h>
MIDI_CREATE_INSTANCE(HardwareSerial, Serial, midiOut); // create a MIDI object called midiOut
/******************************************************/
void setup()
{
  for(int i=0; i<5; i++) /* setup test phase */
  {
    pinMode(relayPin[i], OUTPUT);
    pinMode(ledPin[i], OUTPUT);
    digitalWrite(relayPin[i], HIGH);
    delay(300);
    digitalWrite(relayPin[i], LOW);
    digitalWrite(ledPin[i], HIGH);
    delay(300);
    digitalWrite(ledPin[i], LOW);
  }
midiOut.begin(); 
readPreset(11, 1, 0); /* active preset on startup */   
}

/*********************************************************/
void memory(int addr, int led)
{
  for(int i=0; i<5; i++)
  {
    EEPROM.write((addr) + i, digitalRead(relayPin[i]));
    digitalWrite(ledPin[i], LOW); // all leds reset
  }
  delay(100);
  digitalWrite(ledPin[led], HIGH);
  delay(100);
  digitalWrite(ledPin[led], LOW);
  delay(100);
  digitalWrite(ledPin[led], HIGH);
  delay(100);
  digitalWrite(ledPin[led], LOW);
  delay(100);
  digitalWrite(ledPin[led], HIGH);
  delay(100);
  digitalWrite(ledPin[led], LOW);
  delay(100);
  digitalWrite(ledPin[led], HIGH);
}

/*********************************************************/
void resetAllRelays()
{
  for(int i=0; i<5; i++)
  {
    digitalWrite(relayPin[i], LOW);
  }
}
/*********************************************************/
void resetAllLeds()
{
  for(int i=0; i<5; i++)
  {
    digitalWrite(ledPin[i], LOW);
  }
}
/*********************************************************/
void writeOut(int relay)
{
  resetAllLeds();
  digitalWrite(relayPin[relay], !digitalRead(relayPin[relay]));
  /*digitalWrite(ledPin[relay], !digitalRead(relayPin[relay]));
  /* thanks to  anton.efremoff.1 for this tip */
}
/*********************************************************/
void readPreset(int addr, int pcNum, int led)
{
  for(int i=0; i<5; i++)
  {
    digitalWrite(relayPin[i], EEPROM.read((addr)+i));
    digitalWrite(ledPin[i], LOW);
    digitalWrite(ledPin[led], HIGH);
  }
  midiProg(0xC0 | midiChannel , pcNum);  /* send midi change program 1 */
}
/*********************************************************/
void loop()
{
 
  char key = keypad.getKey();
  if(key)  // Check for a valid key.
  {
   switch (key)
      {
    case 'a':  // a to x
      writeOut(0); // relay state
      break;
    case 'b':
      writeOut(1);
      break;
    case 'c':
      writeOut(2);
      break;
    case 'd':
      writeOut(3);
      break;
    case 'e':
      writeOut(4);
      break; 
    /****************************** STORE PRESET MODE */       
    case 'f':
      memory(11,0);  //addr, led
      break;
    case 'g':
      memory(21,1);
      break;
    case 'h':
      memory(31,2);
      break;
    case 'i':
      memory(41,3);
      break;
    case 'j':
      memory(51,4);
      break;
    /****************************** READ PRESET MODE (Play Mode)*/     
    case 'k': 
      readPreset(11, 1, 0); // addr, pcNum, relay
      midiOut.sendControlChange(60, 0, 1);// CC - Val - Channel
      break;
    case 'l': 
      readPreset(21, 2, 1);
      midiOut.sendControlChange(60, 1, 1);
      break;   
    case 'm':
      readPreset(31, 3, 2);
      midiOut.sendControlChange(60, 2, 1);
      break;
    case 'n':
      readPreset(41, 4, 3);
      midiOut.sendControlChange(60, 3, 1);
      break;
    case 'o':
      readPreset(51, 5, 4);
      midiOut.sendControlChange(60, 4, 1);
      break;   
      }
   }
}



sixeight

So you are using two Arduinos? One for the pedal switcher and one for the host board?
Your code does not use the usb host board. Just regular midi.

In my setup I use the USB host library of the Teensy 3.6. I had to modify it to get itworking with sysex data, but patch changing did work right away.

wo2507

Quote from: sixeight on March 05, 2021, 08:07:43 AM
So you are using two Arduinos? One for the pedal switcher and one for the host board?
Your code does not use the usb host board. Just regular midi.

In my setup I use the USB host library of the Teensy 3.6. I had to modify it to get itworking with sysex data, but patch changing did work right away.

yes, i use two boards and use regular midi library,
i will try the new code with usb host library,
i saw on the Facebook grup that someone made the patch changer using arduino and usb host board,
he use 176, 60 , x ( he said, change x value to change the patch )
I'm still confused what command did he use

sixeight

Quote from: wo2507 on March 16, 2021, 08:32:12 PM
yes, i use two boards and use regular midi library,
i will try the new code with usb host library,
i saw on the Facebook grup that someone made the patch changer using arduino and usb host board,
he use 176, 60 , x ( he said, change x value to change the patch )
I'm still confused what command did he use

176, 60, X is a cc 60 midi command.

Check out part 7 here:
https://www.cs.cmu.edu/~music/cmsip/readings/MIDI%20tutorial%20for%20programmers.html

wo2507

trying to write this sketch using arduino uno and usb host shield, but still not working on mg300  ??? ???





#include <Usb.h>
#include <usbhub.h>
#include <usbh_midi.h>


USB Usb;
USBH_MIDI Midi(&Usb);
// this is my assumptions
uint8_t Patch1A = 0x00; // 0x00 is pactch 1A on nux mg300
uint8_t Patch2A = 0x01; // 0x01 is patch 2A on nux mg300

void setup()
{
  pinMode( 7, OUTPUT);  // For the sheild
  digitalWrite( 7, HIGH); // for the sheild
  if (Usb.Init() == -1)
  {   
    while(1);               // Halt
  }
  delay(200); 
}

void loop()
{
   //test to nux mg300
   SendMIDIPC(Patch1A);
   delay(1000);   
   SendMIDIPC(Patch2A);
   delay(1000);
   
   //test to zoom ms50g
   /*tunerOn();
   delay(1000);
   tunerOff();
   delay(1000);*/
       
}

// Patch Changer

void SendMIDIPC(uint8_t number)
{
  Usb.Task(); 
  if( Usb.getUsbTaskState() == USB_STATE_RUNNING )
  {       
    uint8_t buf[3];                 // Construct the midi message (3 bytes)
    buf[0]=0xB0;                    // Control change
    buf[1]=0x3C;                    // 0x3C is #CC60 for change the patch on nux mg300
    buf[2]=number;                  // number is patch number (write in hex above)
    Midi.SendData(buf);             // Send the message   
    delay(10);
  }   
}

///////////=========== this is for activated/deactivated tuner on zoom ms50g ===========////////////

/*void tunerOn()
{
  Usb.Task(); 
  if( Usb.getUsbTaskState() == USB_STATE_RUNNING )
  {       
    uint8_t buf[3];                 // Construct the midi message (3 bytes)
    buf[0]=0xB0;                 // control Change
    buf[1]=0x4A;               // CC 74
    buf[2]=0x40;            // tuner On , 40 = CC Value 64
    Midi.SendData(buf);         
    delay(10);
  }   
}

void tunerOff()
{
  Usb.Task(); 
  if( Usb.getUsbTaskState() == USB_STATE_RUNNING )
  {       
    uint8_t buf[3];                 // Construct the midi message (3 bytes)
    buf[0]=0xB0;                 //  control Change
    buf[1]=0x4A;               // CC 74
    buf[2]=0x00;            // tuner off
    Midi.SendData(buf);         
    delay(10);
  }   
}
*/



am i made a mistake or something ??

sixeight

It has been some time ago that I programmed the implementation for the MG-300. So I can't remember what worked and what didn't .

But from the VController I send the following sysex string first:
0xF0, 0x00, 0x11, 0x22, 0x66, 0x00, 0x00, 0x00, 0x00, 0xF7

This is also the first message the editor sends to the MG-300. It may trigger the unit to respond to midi.

Then I send:
0xF0, 0x00, 0x11, 0x22, 0x66, 0x00, 0x70, 0x19, 0x00, 0xF7

To which the MG-300 should respond with a sysex message containing the current patch number.

Buit I do remember having a lot of trouble getting the MG-300 to work. It took several days and I had to edit the USB host library for the Teensy 3.6. I actually gave up. Then I optimized the library for sending messages to my Zoom ms70-cdr and to my suprise the MG-300 worked as well. There is something weird in the MIDI implementation of the MG-300. For some reason it will not work through a USB hub, where all other USB midi devices do work.

I will be working on a new VController prototype using the Teensy 4.1. I am curious if the MG-300 will work with that chip. The library is pretty much the same, but the low level stuff in the actual CPU chip is different.

admin

Fwiw

The latest NUX MG-30 lacks 5 pin MIDI I/O
But it already has factory MIDI CC# Controls for most things-except the looper.

It's designed to work with generic USB HOST to 5 pin MIDI I/O Adapters and the MG-30 R&D team is not the same as the MG-300 R&D team-MG-30 with its FX Loop and metal chassis is more professional-but twice the cost of MG-30]

jaropda

#21
Hi, I'm testing how my Nux MG-300, ipad and MIDIFire app responds as a MIDI host and my Line 6 FBV Shortboard MKII midi controller.
all using a USB Power Hub.
The first thing I needed was to be able to turn each effect on and off in line of effects within a patch.
The reverb effect I can turn it on and off from my FBV controller reverb spring , the delay pan,the modulation effect harmony and the drive effect directly activates picht bender,forever the same effect appears.
How can I make it turn on and off but not select that particular effect? since the one that is active in that patch...
Another problem I have is how to pass the different patches one by one from the FBV controller, it only passes from 1A to 1B.
The master volume if I control it from the pedal of my FBV controller.
I have consulted your MIDI implementation guide for nux MG-300, but as I tell you those two things I can't make them work.
If you can give me a hand, I will appreciate it.
a greeting .

sixeight

#22
QuoteHow can I make it turn on and off but not select that particular effect? since the one that is active in that patch...
Another problem I have is how to pass the different patches one by one from the FBV controller, it only passes from 1A to 1B.

This is the issue with the MG-300. You cannot turn an effect off and then back on. Effect type zero is effect off and that's it. I have solved this with the VC-mini by storing the effect type on the VC-mini.

Your second issue I do not understand. But my guess is the FBV controller uses PC messages, which the mg-300 does not understand. So you have to do a translation between one and the other.

If you use an ipad, maybe MIDI designer pro may be helpful.

jaropda

My controller line6 Fbv send cc messages.
The App MidiFire App for iOS is One good program for midi,it have monitor event midi and I can learn  messages what MG-300 say me.Maybe some script  write in Midifire can solved.
Thank you.

barrios

Hi all,

newbe MG-300 user here. The single feature I am missing for live performance is a way to toggle jam-mode by foot-switch to control looper, drums & guitar effects while playing. I was glad to read the device apparently listens to many MIDI-CC messages over USB.

Does jam-mode listen to one?


Best,
barrios