RAW, switching either costs an action, or requires two free object interactions (this requiring two of the same action in a row)
You are allowed one free object interaction on your turn (PHB pg 190), as a part of your action or movement (implied that the free interaction must be related to that, such as opening a door or drawing a weapon). Any more than that requires an action.
So you cannot put away your instrument and draw your blade as free actions on the same turn. That is two object interactions. (Compare this to the Dual Wielder feat, which explicitly allows you to draw or stow two weapons on the same turn)
The way to switch without taking an action is best explained with an example combat:
Combat start: shield equipped
Round 1: draw weapon as a free object interaction, and attack
Round 2: attack with weapon and stow as a free object interaction.
Round 3: draw your instrument as a free action, and cast a spell
Round 4: Cast another spell, stow your instrument as a free action
Round 5: draw your blade as a free object interaction and attack with it.
Round 6: attack with your blade, and sheath it as a free object interaction.
repeat as nessisary
So RAW, you have to effectively take at least two of the same type of action (spellcasting or weapon attack) before switching.
You could drop one of the items (weapon or instrument), and use the interaction to get to the other weapon in a single turn, but that requires going back and picking it up later when you want to be able to use it again (RAW, this will require an action, unless part of an attack or spellcast, depending on the item being picked up).
You could tie the instrument to your body (letting you drop it without consuming your free object interaction) or use a component pouch, eliminating the need for the object interaction on round 4, but not the interaction required on rounds 2 or 6. This would allow a combat to go weapon, spell, weapon, weapon, spell, weapon.
However, many DMs will find this needlessly pedantic, hard to keep track of, and generally un-fun, and will let you draw and stow (or stow and draw) on the same turn.
Remember that all of this assumes that you need a hand free for the Somatic/Material components. Bards have lots of Verbal only spells, and you may not need to drop/stow your weapon to be able to cast things like Vicious mockery, dissonant whispers, faerie fire, and blindness/deafness. You will still need to follow the draw/stow rules for spells with somatic components, however.
The War Caster feat also interacts with this, as it allows you to use your shield or weapon hand to preform the somatic requirements for a spell, meaning that if your spell does not have material components, then you do not need to pull out your focus. This unlocks many other spells, such as Cure Wounds, Silence, Dispel Magic, Greater Invisibility, Dominate Person, Eyebite, etc...