How musical instruments work
There are a lot of different musical instruments out there. Just about all of them share four basic components: a harmonic oscillator, a source of noise, a control surface for modulation, and a resonator.
A harmonic oscillator produces sine waves, or their mathematical cousins sawtooth and square waves. For most of technological history, our oscillators were mechanical systems of skins or reeds or metal. For the past hundred-ish years we've also been using electronic oscillators connected to speaker cones. Making a steady mechanical oscillator is expensive and challenging. Even making a reliable tuning fork or pendulum takes some crafty engineering. A side benefit of the computer revolution is that we've figured out how to mass-produce very cheap electronic oscillators out of quartz crystals and microchips, so now we're surrounded by them in our cell phones and computers. Sine wave oscillations are thermodynamically unlikely and hard to produce. Noise is everywhere and easy to produce. In mechanical systems the big challenge is to limit it. In electronic systems, pure sine waves are easy to make and sustain. Now that we've had a chance to listen to them, we've come to appreciate the musical value of noise better. Pure sine waves sound unearthly and fake. Part of what gives a cello its distinctive tone is the noise of the bow scraping against the strings. Percussion is mostly shaped noise. Once you have your blend of sine waves and noise, you want to be able to control when they start and stop, how loud they are, and what pitch they're at. Ideally you also want to be able to shape the overtones to give nuance to your tone. In mechanical instruments the control surface is the whole object. In electronic systems, the control surface and the sound generation system can be totally separate devices. Using computers it's possible to produce any recorded or synthesized sound at all from a keyboard or even video game controllers and cell phones. Finally, you probably need to boost your signal to make a loud enough sound that people can hear it. For that, you need a resonator, something that vibrates sympathetically with your signal. For electronic instruments the resonator is an electronic amplifier hooked to speakers, headphones or the business end of a recording device. Here are some widely-used music tools in terms of the basic four components. Your voice
Oscillator: vocal folds
Noise: plosives and fricatives
Modulation: shape of mouth, position of tongue, lips and teeth
Resonator: chest, sinus cavities
Beer bottle
Oscillator: air at bottle mouth
Noise: overblowing
Modulation: blowing angle and intensity, amount of water inside
Resonator: bottle interior
Clarinet
Oscillator: reed
Noise: overblowing
Modulation: keys, embouchure
Resonator: body
Piano
Oscillator: strings
Noise: none, unless you put ball bearings or something on the strings
Modulation: timing and intensity of key presses and releases, sustain pedal
Resonator: body
Acoustic guitar
Oscillator: strings
Noise: pick scraping, strings buzzing against fretboard
Modulation: fingers on fretboard, pick angle and attack
Resonator: body
Oscillator: strings, amp speaker driver
Noise: pick scraping, string buzzing, amp distortion, electrical interference
Modulation: fingers on fretboard, pick angle and attack, whammy bar, tone switches and knobs, effects units and expression pedals, amp settings...
Resonator: amp speaker cone
Snare drum
Oscillator: drum head
Noise: snares
Modulation: angle, location and intensity of whacking, makeup of striking implement (wood or rattan sticks, brushes, mallets, bare hands, etc)
Resonator: body
Oscillator: needle in the groove. The groove is shaped by the electromagnetic oscillations captured on the master tape, which follows the electrical signal from the microphones and mixing console in the original recording, and so on.
Noise: dust on the needle and in the groove, electrical interference
Modulation: speed knob, DJ scratching and crossfading
Resonator: speaker cone
Oscillator: Electromagnetic oscillators and crystal clocks
Noise: Electromagnetic noisemakers
Modulation: Buttons and knobs
Resonator: speaker cone
Oscillator: Electromagnetic oscillators and crystal clocks
Noise: Electromagnetic noisemakers
Modulation: Software on the game cartridge controlling voltages on the oscillators and noisemakers, as specified by the assembly language translation of KÅji KondÅ's score
Resonator: TV speaker cones