it depends which library you have and on which line you communicate.
If the library expects a link that is already open for its transport, then yes, you need to do Serial.begin() or Serial1.begin() or whatever port is required indeed (baud rate would need to be 31250 for MIDI)
In the library I linked previously, you don't need to open it. you call
[url=https://github.com/FortySevenEffects/arduino_midi_library/blob/da8ca5e69a63e1cbf2433e070b87e6f09a709b85/src/serialMIDI.h#L115]MIDI_CREATE_DEFAULT_INSTANCE[/url]() at the start of your sketch and that will configure Serial for you in the library that will be activated when you call begin() for the library.
see their Basic_IO.ino example