You push a button on the box next to the piano in your living room and suddenly the instrument begins to play itself. The keys and pedals move as if a ghost were playing and live piano music comes out.

Pianos that can do this much have been around for generations. They are player pianos that run from a paper tape with punched holes whose spacing tells a mechanical apparatus which keys to press in what order.

But if you listened closely to this particular player piano, and if you knew your pianists, you could tell that it was, say, Roger Williams or Chick Corea or Vladimir Horowitz playing.

This is the player piano for the digital era, offspring of a marriage of an old-fashioned idea and the latest in Japanese electronic gadgetry. And, according to music industry observers, it is one of the hottest new innovations in music technology.

The contraption was developed by Yamaha Corp., manufacturer of concert quality pianos and electronic synthesizers, and its product is called the Disklavier.

Unlike old player pianos, which could reproduce little more than the sequence of notes and the timing, its electronic descendent is said to recreate virtually every nuance of performance -- exactly the tone, touch and timing of a real performance. And, unlike even the best of compact disc recordings, the sound would be in perfect fidelity because it would be a real piano making the music.

Sensors Capture Touch, Timing

Old player pianos were simple devices that relied on a person to pump pedals, driving perforated paper off a roll and through the piano's mechanical reader. The holes in the paper allowed suction across the reader bar as the paper rolled by. The hole allowed air to trigger a valve mechanically linked to a key on the piano. The old players worked, but they could not fully recreate the subtleties of complicated music or supply the immense dynamic range and versatility of fingers on a keyboard.

Unlike the old players, the Disklavier can also record a performance, and with unerring accuracy, converting all the subtleties of an individual playing -- or all the wrong notes and lousy timing -- into digital bits of data and storing them on a standard 3 1/2-inch computer diskette.

What the computer records is information from a series of sensors that detect which key is being pressed, how hard it is being pressed and how long the key is held down. Even though the piano's hammer strikes a string only once per pressing, as long as the key is held down, a felt "damper" is held away from the string, allowing it to keep vibrating.

A sensor under each key tells the computer which key is being pressed and how long it is held down. Two more sensors are positioned near each of the 88 hammers. Each sensor consists of a light beam coming out one side and a detector on the other side that receives the beam. When a hammer moves to hit a string, it interrupts the beams in sequence. The computer calculates the time between interruptions and stores this as a number between 0 and 127.

When the recording is played back, the number tells the piano how hard to push each key and, thus, whether to tickle the ivory ever so lightly -- a 1 -- or to slam down a fist -- a 127, which can be applied to as many as 16 keys simultaneously. The ghost that plays the Disklavier is a device under the back part of each key (the part hidden inside the piano box), which is built like a see-saw. The device, called a solenoid, is an electromagnet, consisting of a coil of wire around a metal rod that jumps up when a current is sent through the coil. The more current (a 127), the harder the bar jumps. Pushing up the hidden part of the key is the same as pushing down the visible part.

During the playback, the computer instructs each solenoid to react with the force needed for each note. A chord of four notes, for instance, might all seem as if they have been struck with the same velocity. But one might be an 80 on the scale while the others are all 79. The digital computer recognizes that difference and makes sure it is reflected during playback.

Similar sensors and solenoids record and play back the actions of the pedals.

Once a button is pressed, the keys and hammers ripple and roll as the music is replayed exactly as it was played live.

Acoustic Equivalent of Live

"The sound reproduced is the piano itself, there is absolutely no noise or distortion," wrote Donn Laurence Mills, dean of the school of music at Chapman College in a recent issue of Clavier, a journal devoted to piano and other keyboard instruments. "The keys and pedals move just as if you moved them. A mere touch of a button allows you to hear what a different tempo, key or volume would sound like, and you can control the playback from across the room, via a remote control unit."

Yamaha has already released more than 100 recordings in which such figures as Horowitz and Corea, as well as George Shearing and Roger Williams play. They even recorded Liberace before his death. Many more are said to be in the works. The pianos range in price from around $7,000 for a simple upright to $26,000 for a concert grand. Despite the price, Yamaha says it has so many orders, it is a year behind in making deliveries.

Although originally aimed at professional musicians and recording studios, about half the Disklaviers are being bought by people who don't play piano but who simply want the device for entertainment. While compact disc players create the sound of an individual performance, their admittedly excellent sound quality produced by the vibrating cone of a loudspeaker still falls short of the fidelity of the sound of a real piano string vibrating.

The recordings use the same system as do completely electronic music synthesizers -- a universal system known as MIDI, for Musical Instrument Digital Interface. This is the computer language that MIDI instruments -- such as synthesizers and other electronic instruments -- use to talk to each other.

This allows electronic music to be played along with the piano through inputs on an auxiliary box, and it permits the recording from the Disklavier to be fed into a stereo system or to other synthesizers or mixers. Each note is stored in sequence on the computer diskette. Every disk holds about 90 minutes worth of music. The playback can be controlled like those of any stereo; so you can listen to the music you just recorded louder or softer, faster or slower.

Had there been a Disklavier in the 19th century, Franz Liszt or Frederic Chopin could have sat down, pushed one button and played. The machine would have recorded the performance and audiences today could enjoy the acoustic equivalent of a live performance.