In 1901, Melville Clark invented the first full 88-key player piano. It didn't yet give you Ravel at the keyboard. You prepared the piano roll by punching paper to match the sheet music. The result was pretty mechanical, but it beat silence when you craved music. My scratchy records were analog devices.
Player pianos use pure on-off digital logic to store sound.
That was true of the reproducing piano as well. Piano roll companies soon made pianos that could reproduce a pianist playing. Clark invented a good one in 1912. Marking meant that a mechanism automatically marked a live player's notes on a paper roll. Then an operator punched holes where the marks were.