BETTENDORF, Iowa — When Jim Foster opened his piano store 30 years ago, he had 10 competitors selling just pianos.

When he closed Foster Family Music in late December, not one was still selling pianos in the Quad-Cities area of Iowa and Illinois.

“We did try hard to find a buyer,” Foster said. There were no takers.

Stores dedicated to selling pianos like Foster’s are dwindling across the country as fewer people take up the instrument and those who do often opt for a less expensive electronic keyboard or a used piano. Some blame computers and others note the high cost of new pianos, but what’s clear is that a long-term decline in sales has accelerated.

The best year for new piano sales in the U.S. was 1909, when more than 364,500 were sold. But after gently falling over the years, piano sales have plunged more recently to between 30,000 and 40,000 annually.

Larry Fine, a Boston-based piano technician, consultant and author, said it is an indication of a changing society.

“Computer technology has just changed everything about what kids are interested in,” said Fine, who also publishes a website offering consumer information on new and used pianos. “People are interested in things that don’t take much effort, so the idea of sitting and playing an hour a day to learn piano is not what kids want to do.”

Youth sports demands also compete with music studies.

“Children these days are being recruited for so many other activities, whether it’s soccer, gymnastics, or swimming,” said Robin Walenta, CEO of West Music, a music retailer with a chain of stores in Iowa and Illinois.

To succeed now, Walenta said retailers must engage families in music education. Her company offers an early childhood music program that starts with 3-month-old babies. A keyboard exploration program is available for youngsters until they’re ready to begin individual lessons at age 7 or 8.

Foster Family Music survived because it took a similar approach, offering digital pianos and acoustic pianos with built-in electronics for student lessons and hosting thousands of students in large performance events, Foster said, sitting at a Wi-Fi and fiber optic-equipped Yamaha Disklavier grand piano.

Walenta said those types of features on pianos help ensure the instrument continues to be a mainstay for children learning music.

“On a digital piano they can practice with a harpsichord sound or a trumpet sound. It makes it more fun,” she said. “Kids these days need that kind of interaction to be interested.”

When Dennis Saphir recently closed his piano store in the Chicago suburb of Wilmette, it was the end of a business his family started six generations ago in Vienna. He took it over from his father who brought the business to the U.S. during World War II.

Saphir said new piano sales are challenged by fewer parents requiring youngsters to take lessons as part of their upbringing and a glut of instruments already in homes.

“We actually found ourselves competing with our own pianos that came back on the market and, frankly, nothing was wrong with those pianos,” he said. “We had serviced them and made sure customers took care of those pianos. There were lots of really excellent pianos on the market for a fraction of what the new piano would cost.”