Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The problem of MIDI library running on NodeMCU board based on ESP8266 #199

Open
Renlong2020 opened this issue Feb 5, 2021 · 11 comments
Open

Comments

@Renlong2020
Copy link

Hello, I am using this MIDI library, this is a very good library.
But now there is a problem
For example, simply send note on in a loop. If running on arduino uno, the serial port baud rate is set to 31250, the serial port debugging software can receive the correct midi signal, but the same code, running on the NodeMCU board based on ESP8266, does not The correct MIDI, is it a problem with my settings or the board?

Additional context
Add any other context or screenshots about the feature request here.

@franky47
Copy link
Member

franky47 commented Feb 5, 2021

Can you show me your NodeMCU code please ?

@Renlong2020
Copy link
Author

Renlong2020 commented Feb 5, 2021

#include <MIDI.h>
//-----------------------------------Midi setting------------------------------------------------------------
struct MySettings : public midi::DefaultSettings
{
    static const unsigned SysExMaxSize = 1024; // Accept SysEx messages up to 1024 bytes long.
    //static const bool UseRunningStatus = true; // My devices seem to be ok with it.
};
//MIDI_CREATE_INSTANCE(HardwareSerial, Serial2, MIDI);
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial,Serial,MIDI,MySettings);
//-----------------------------------Midi setting------------------------------------------------------------
void
setup()
{
  MIDI.begin(MIDI_CHANNEL_OMNI); //midi
  MIDI.turnThruOff(); //Thru
  }

void loop()
{

MIDI.sendNoteOn(1,127,1);
MIDI.sendNoteOn(2,127,1);
MIDI.sendNoteOn(3,127,1);
delay(1000);
}

NodeMcu :
image
arduino:
image

@franky47
Copy link
Member

franky47 commented Feb 5, 2021

I see nothing in your code or the ESP8266 Serial documentation that would indicate incompatibility. Are you using pin GPIO1 for MIDI output ?

@Renlong2020
Copy link
Author

我在您的代码或ESP8266串行文档中看不到任何表明不兼容的信息。您是否将GPIO1引脚用于MIDI输出?

Yes, I use the default serial output, GPIO1 and GPIO3

@Renlong2020
Copy link
Author

I see nothing in your code or the ESP8266 Serial documentation that would indicate incompatibility. Are you using pin GPIO1 for MIDI output ?

At least the hardware connection is okay. The PC can receive MIDI signals, but the MIDI signals are incorrect. I think the problem may occur in the software, but I don’t know where it is...
Hope to get your help

@franky47
Copy link
Member

franky47 commented Feb 5, 2021

What I don't understand is your Arduino screenshot: the serial output does not correspond to the code that sends 3 NoteOn messages (the serial output indicates NoteOn and NoteOff).

@Renlong2020
Copy link
Author

Renlong2020 commented Feb 5, 2021 via email

@Renlong2020
Copy link
Author

Hello, is there any progress on the problem of running simple noteOn on 8266 and not receiving correctly? I studied for a day, but found nothing, I don't know where the problem is.

@franky47
Copy link
Member

franky47 commented Feb 6, 2021

I don't have a lot of time to look into this at the moment, also I don't have an ESP8266.

What happens if you send serial messages directly, like:

byte counter = 0;

void setup() 
{
  Serial.begin(31250);
}

void setup() 
{
  Serial.write(counter++);
  delay(500);
}

@underwoodblog
Copy link

underwoodblog commented Feb 28, 2021

Maby there is something wrong with the terminal program? I use Protokol with UART1 on a ESP32 to a Midi-Interface and it works. Resistors for 3V3 and Midi out had to be set to 33 Ohm for 3V3 pullup and 10 Ohm for TX out.

#define UART1_TXD GPIO10 // UART_DEV(1) TxD
#define UART1_RXD GPIO9 // UART_DEV(1) RxD
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial1, MIDI, MidiSettings);

@Renlong2020
Copy link
Author

Finally, the test came out, but the root cause is still unclear. After all, I'm not a hardware major.
The solution is to use IO analog serial port to input and output MIDI signal on esp8266. It can run normally at the baud rate of 31250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants