All musical instruments generate sound through vibrations, but the mechanism varies by family:
Plucking, bowing, or striking a string causes it to vibrate, moving the surrounding air. Pitch depends on string tension, length, and thickness.
Blowing air across an opening creates turbulent airflow, vibrating the air column inside the tube. Pitch depends on tube length and opening size/shape.
Striking or scraping an object makes it vibrate, producing sound waves. Pitch depends on the object’s size, shape, and material.
Electronic circuits generate sound waves directly, capable of mimicking acoustic instruments or creating entirely new timbres.