What???Using ESP directly, this is very easy to do, using the esp8266.h and AppleMidi.h libraries....
...I have to use the arduino connected to ESP
What does "directly" mean? The esp8266 doesn't work
without the Arduino, does it? Are you saying it works under software control, but you can't interface the hardware (analog & digital inputs)?
Do you have an Arduino on the transmitting-end and another on the receiving-end?
because I need a lot of analog and digital inputs.
Does it with regular wired MIDI? ...It doesn't seem like your problem/question is related to the wireless connection.
..Are you having trouble converting your hardware inputs into MIDI messages?
Is this a MIDI instrument, or something like a control surface? An instrument
might be tricky because a few too-many milliseconds of latency over the Wi-Fi connection will mess-up the musical timing.