If I’m hidden & have to peek out or step out to shoot do I retain advantage?

How does a bard benefit from an instrument’s proficiency bonus?