Hello, I'm new here, I recently made a midi controller using arduino midi (AKA midi.h) and I was wondering If could just connect a midi jack port to pin 1 without any extra code and forget about serial to midi bridges and virtual ports?
That depends what "MIDI jack port" means to you. If it's a 5-pin DIN MIDI OUT connector then yes. If it's something else then it depends on what you do mean.
And as I can't see any of your code I don't know if you will need any extra to make it work.
Steve
Yes, I meant a 5 pin DIN. Here's my code, sorry if it's all over the place or I made a bunch of stupid mistakes, it's my first big project like this.
#include <SevSegShift.h>
#include <ezButton.h>
#include <MIDI.h>
#include <midi_Defs.h>
#include <midi_Message.h>
#include <midi_Namespace.h>
#include <midi_Settings.h>
ezButton button1(4);
ezButton button2(5);
ezButton button3(6);
ezButton button4(7);
#define SHIFT_PIN_SHCP 10
#define SHIFT_PIN_STCP 11
#define SHIFT_PIN_DS 12
SevSegShift sevsegshift(SHIFT_PIN_DS, SHIFT_PIN_SHCP, SHIFT_PIN_STCP, 1, true);
struct MySettings : public midi::DefaultSettings
{
 static const long BaudRate = 115200;
};
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial, MIDI, MySettings);
int attack;
int newvalattack;
int oldvalattack;
int attackPin = A3;
int mod;
int newvalmod;
int oldvalmod = 0;
int modPin = A2;
int pitch;
int newvalpitch;
int oldvalpitch = 0;
int pitchPin = A1;
int note1 = 1;
int note2 = 2;
int note3 = 3;
int note4 = 4;
int velocityBig;
int velocityPin = A0;
int velocity;
const int channel = 1;
int NoteOffset;
int offsetDownPin = 2;
int offsetUpPin = 3;
int button_1;
int button_2;
int buttonLast_1;
int buttonLast_2;
void setup() {
 byte numDigits = 4;
 byte digitPins[] = {A5, A4, 9, 8};
 byte segmentPins[] = {0, 2, 4, 6, 7, 1, 3, 5};
 bool resistorsOnSegments = true;
 byte hardwareConfig = COMMON_ANODE;
 bool updateWithDelays = false;
 bool leadingZeros = false;
 bool disableDecPoint = true;
 sevsegshift.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments,
          updateWithDelays, leadingZeros, disableDecPoint);
 sevsegshift.setBrightness(90);
 pinMode(2, INPUT_PULLUP);
 pinMode(3, INPUT_PULLUP);
 pinMode(4, INPUT_PULLUP);
 pinMode(5, INPUT_PULLUP);
 pinMode(6, INPUT_PULLUP);
 pinMode(7, INPUT_PULLUP);
 NoteOffset = 60;
 NoteOffset = constrain(NoteOffset, 0, 124);
 pinMode(digitPins, OUTPUT);
 MIDI.begin();
}
void loop() {
 button1.loop();
 button2.loop();
 button3.loop();
 button4.loop();
 velocityBig = analogRead(velocityPin);
 velocity = map(velocityBig, 0, 1023, 0, 127);
 int btn1State = button1.getState();
 int btn2State = button2.getState();
 int btn3State = button3.getState();
 int btn4State = button4.getState();
 note1 = note1 + NoteOffset;
 note2 = note2 + NoteOffset;
 note3 = note3 + NoteOffset;
 note4 = note4 + NoteOffset;
 if (button1.isPressed()) {
  MIDI.sendNoteOn(note1, velocity, channel);
 }
 if (button1.isReleased()) {
  MIDI.sendNoteOff(note1, velocity, channel);
 }
 if (button2.isPressed()) {
  MIDI.sendNoteOn(note2, velocity, channel);
 }
 if (button2.isReleased()) {
  MIDI.sendNoteOff(note2, velocity, channel);
 }
 if (button3.isPressed()) {
  MIDI.sendNoteOn(note3, velocity, channel);
 }
 if (button3.isReleased()) {
  MIDI.sendNoteOff(note3, velocity, channel);
 }
 if (button4.isPressed()) {
  MIDI.sendNoteOn(note4, velocity, channel);
 }
 if (button4.isReleased()) {
  MIDI.sendNoteOff(note4, velocity, channel);
 }
 note1 = note1 - NoteOffset;
 note2 = note2 - NoteOffset;
 note3 = note3 - NoteOffset;
 note4 = note4 - NoteOffset;
 button_1 = digitalRead(offsetDownPin);
 if (button_1 && !buttonLast_1) {
  if (NoteOffset - 4 >= 0) {
   NoteOffset = NoteOffset - 4 ;
  }
  delay(200);
 }
 buttonLast_1 = button_1;
 button_2 = digitalRead(offsetUpPin);
 if (button_2 && !buttonLast_2) {
  if (NoteOffset + 4 <= 124) {
   NoteOffset = NoteOffset + 4;
  }
  delay(200);
 }
 buttonLast_2 = button_2;
 pitch = map(analogRead(pitchPin), 0, 1023, -8192, 8192);
 newvalpitch = analogRead(pitchPin);
 if (newvalpitch > oldvalpitch + 3 ||
   newvalpitch < oldvalpitch - 3)
 {
  // do something
  MIDI.sendPitchBend((int)pitch, channel);
  oldvalpitch = newvalpitch ;
 }
 mod = map(analogRead(modPin), 0, 1023, 0, 127);
 newvalmod = analogRead(modPin);
 if (newvalmod > oldvalmod + 3 ||
   newvalmod < oldvalmod - 3)
 {
  MIDI.sendControlChange(1, mod, channel);
  oldvalmod = newvalmod ;
 }
 attack = map(analogRead(attackPin), 0, 1023, 0, 127);
 newvalattack = analogRead(attackPin);
 if (newvalattack > oldvalattack + 3 ||
   newvalattack < oldvalattack - 3)
 {
  MIDI.sendControlChange(73, attack, channel);
  oldvalattack = newvalattack;
 }
 sevsegshift.setNumber(NoteOffset);
 sevsegshift.refreshDisplay();
}
So when you try it with a MIDI OUT circuit connected to pin1 does it work? I can't see much obviously wrong except the baud rate should be 31250 for MIDI but then I've never used ezButton or SevSegShift and I don't know what components you're using or how everything is connected.
There's not much point spending a lot of time looking at your code without knowing if there are any problems and if so what they are.
Steve
By circuit you mean the middle pin to arduino pin 1, voltage reference line to 5v through a 220 Ohm resistor and the ground pin / connector shield to arduino ground? also the baud rate is like that since i read somewhere it should be like that with this libary
No I mean the connections you see when you Google "MIDI out circuit". Signal is definitely NOT on the middle pin.
Steve
Sorry, seems i made a mistake, you are right, the middle pin is in fact ground
https://tttapa.github.io/Arduino/MIDI/Images/MIDI-hardware.png is this right? i heard the gates were not needed with arduinos?
If you had tried searching you would have found plenty of versions without gates. I've never bothered with them myself.
Steve