Mr. Sakamoto, whose work with Yellow Magic Orchestra influenced electronic music, composed scores for “The Last Emperor” and “The Revenant.”Ryuichi Sakamoto, one of Japan’s most prominent composers, who scored the films “The Last Emperor,” “The Sheltering Sky” and “The Revenant” and was a founder of the influential Yellow Magic Orchestra techno-pop band, died on Tuesday. He was 71.His Instagram page announced the date of his death, but it did not provide further details. Mr. Sakamoto said in 2021 that he had received a diagnosis of rectal cancer and was undergoing treatment.Equally comfortable in futuristic techno, orchestral works, video game tracks and intimate piano solos, Mr. Sakamoto created music that was catchy, emotive and deeply attuned to the sounds around him. Along with issuing numerous solo albums, he collaborated with a wide range of musicians across genres, and received an Oscar, a BAFTA, a Grammy and two Golden Globes.His Yellow Magic Orchestra, which swept the charts in the late 1970s and early ’80s, produced catchy hits like “Computer Game” on synthesizers and sequencers, while also satirizing Western ideas of Japanese music.“The big theme of him is curiosity,” the musician Carsten Nicolai, a longtime collaborator, said in a phone interview in 2021. “Ryuichi understood, very early, that not necessarily one specific genre will be the future of music — that the conversation between different styles, and unusual styles, may be the future.”Mr. Sakamoto was beginning to achieve wide recognition in the early 1980s when the director Nagisa Oshima asked him to co-star, alongside David Bowie, in “Merry Christmas, Mr. Lawrence,” a 1983 film about a Japanese P.O.W. camp. Mr. Sakamoto, having no background in acting, agreed under the condition that he could also score the film.The movie’s synth-heavy title track remained one of Mr. Sakamoto’s most famous compositions. He often adapted it, including for “Forbidden Colors,” a vocal version with the singer David Sylvian, as well as piano renditions and sweeping orchestral arrangements.Mr. Sakamoto in 1988. He won an Oscar for his work on “The Last Emperor.”Kyodo News, via Associated PressThen came music for films by the director Bernardo Bertolucci, including “The Last Emperor” (1987) “The Sheltering Sky” (1990) and “Little Buddha (1993). Mr. Bertolucci was demanding — he would shout “More emotional, more emotional!” at the composer, and made him rewrite music on the fly during recording sessions with a 40-person orchestra — but “The Last Emperor” won Mr. Sakamoto an Oscar in 1988. Mr. Sakamoto returned to his classical roots in the late 1990s with the album “BTTB,” or “Back to the Basics,” a collection of sentimental, delicate piano arrangements that evoked Claude Debussy, alongside more experimental wanderings into the innards of the piano in the spirit of John Cage.That release included “Energy Flow,” originally written for a commercial for a vitamin drink and released as a single after television viewers called in en masse to ask how they could find of the music. Amid Japan’s Lost Decade — a term for the economic stagnation that followed years of technology-driven growth — the tender piano ballad seemed to offer solace.“Perhaps it’s because people are looking for healing, for some answer to the stress of their country’s recession,” Mr. Sakamoto speculated, when “Energy Flow” became the first instrumental track to reach No. 1, in 1999, on Japan’s Oricon charts.After the nuclear disaster at the Fukushima Daiichi Nuclear Power Station in 2011, Mr. Sakamoto became an activist in Japan’s antinuclear movement, organizing a No Nukes concert in 2012 at which a reunited Yellow Magic Orchestra, and the band Kraftwerk, one of Yellow Magic’s major influences, performed.The day before the concert, he spoke at a protest outside the residence of Japan’s prime minister. “I come here as a citizen,” he said. “It’s important that we all do what we can and raise our voices.”Mr. Sakamoto learned he had throat cancer in 2014. During treatment, he halted work but made an exception when the director Alejandro G. Iñárritu asked him to write music for his film “The Revenant.” With Mr. Nicolai, who performs under the name Alva Noto, Mr. Sakamoto produced a score of luminous dread that was widely acclaimed.He conceived a new project in homage to Andrei Tarkovsky, one of his abiding influences, which became the 2017 “async,” his first solo album in eight years and a summation of his career, with haunting chorales, ethereally synthesized soundscapes, and a recording of the writer Paul Bowles reciting a passage on mortality from “The Sheltering Sky.”Mr. Sakamoto, second from left, had a role in the film “Merry Christmas, Mr. Lawrence” and also wrote the music. With him, from left, are Jack Thomas, the film’s. producer; David Bowie, who starred, and Nagisa Oshima, the director.Jacques Langevin/Associated PressIn later years, Mr. Sakamoto’s music became increasingly spacious and ambient, attuned to the flow of time. In an interview with The Creative Independent website, he described why he played his older music so much slower than he used to. “I wanted to hear the resonance,” he said. “I want to have less notes and more spaces. Spaces, not silence. Space is resonant, is still ringing. I want to enjoy that resonance, to hear it growing.”Ryuichi Sakamoto was born on Jan. 17, 1952, in Tokyo. His father, Kazuki Sakamoto, was a well-known literary editor, and his mother, Keiko (Shimomura) Sakamoto, designed women’s hats.He began piano lessons at age 6, and started to compose soon after. Early influences included Bach and Debussy — whom he once called “the door to all 20th century music” — and he discovered modern jazz as he fell in with a crowd of hipster rebels as a teenager. (At the height of the student protest movement, he and his classmates shut down their high school for several weeks.)Mr. Sakamoto was drawn to modern art and especially the avant-garde work of Cage. He studied composition and ethnomusicology at Tokyo University of the Arts and began playing around with synthesizers and performing in the local pop scene.In 1978, Mr. Sakamoto released his debut solo album, “Thousand Knives,” a trippy amalgam that opens with the musician reciting a poem by Mao through a vocoder, followed by a reggae beat and a procession of Herbie Hancock-inspired improvisations. That year, the bassist Haruomi Hosono invited him and the drummer Yukihiro Takahashi to form a trio that became Yellow Magic Orchestra. (Mr. Takahashi died in January.)The band’s self-titled 1978 album was a huge hit, and influenced numerous electronic music genres, from synth pop to techno. The group broke up in 1984, in part because Mr. Sakamoto wanted to pursue solo work. (They have periodically reunited since the 1990s.) Mr. Sakamoto continued tinkering with outré, high-tech approaches in his 1980 album “B-2 Unit,” which included the otherworldly electro single “Riot in Lagos.”Mr. Sakamoto performing in Rome in 2009.Domenico Stinellis/Associated PressAfter the Bertolucci films, Mr. Sakamoto was seemingly everywhere — appearing in a Madonna music video, modeling for Gap, and writing music for the 1992 Barcelona Olympics. His collaborators for the eclectic albums “Neo Geo” (1987) and “Beauty” (1989) included Iggy Pop, Youssou N’Dour, and Brian Wilson, and he toured with a world-fusion band from five continents. By the mid-1990s, Mr. Sakamoto had refashioned himself as a classical composer, touring arrangements of his earlier music in a piano trio. His work simultaneously became grandiose in scale and themes: he wrote a symphony, “Discord,” exploring grief and salvation (with spoken word contributions by David Byrne and Patti Smith), and an opera, “LIFE,” a meditation on 20th century history that received mixed reviews.Along with writing music for video games and designing ringtones for the Nokia 8800 phone, Mr. Sakamoto oversaw live streams of his concerts that featured a “remote clap” function, in which online viewers could press their keyboard’s F key to applaud. The strokes would be registered on a screen in the auditorium.In the 21st century, he began to focus again on more experimental work, inspired by a new generation of collaborators including the producer Fennesz and Mr. Nicolai, who layered glitchy electronics over Mr. Sakamoto’s piano.“He taught me that I should not be afraid of melody,” Mr. Nicolai said, “that melody has the possibility of experimentation as well.”Mr. Sakamoto became outspoken as an environmentalist, recording the sounds of a melting glacier for his 2009 record “Out of Noise.” For portions of “async,” he performed on an out-of-tune piano that had been partly submerged in the 2011 Tohoku tsunami. He recorded what became his final album, “12,” as a kind of diary of sketches, following a lengthy hospitalization, through 2021 and 2022. “I just wanted to be showered in sound,” he said of the record. “I had a feeling that it’d have a small healing effect on my damaged body and soul.”In December, he gave a career-spanning, livestreamed solo piano concert at Tokyo’s 509 Studio.Mr. Sakamoto married Natsuko Sakamoto in 1972, and they divorced 10 years later. His second marriage, to the musician Akiko Yano in 1982, ended in divorce in 2006. His partner was Norika Sora, who served as his manager. Information about his survivors was not immediately available.Mr. Sakamoto greets fans after a performance in New York in 2010.Hiroko Masuike for The New York TimesMr. Sakamoto’s attention to sound suffused his daily life. After many years of eating at the Manhattan restaurant Kajitsu, he recalled in a 2018 interview with The New York Times, he wrote an email to the chef saying, “I love your food, I respect you and I love this restaurant, but I hate the music.” Then, without fanfare or pay, he designed subtle, tasteful playlists for the restaurant.He simply wanted better sounds to accompany his meals. More