To a Western ear, the music floating from the white van confronting the barricade at the prime minister's office building sounded mournful and resigned, something to evoke melancholy sighs about crushed flower petals perhaps. But the agitated glances and grimaces of the security guards behind the heavy gate indicated that for Japanese listeners, the music carried a heavier, more sinister message.

The recorded music was the national theme song for Japan's militarists, several of whom were sitting inside the van and telling passersby that Japan should alter the constitution the United States imposed on the country at the end of Worth War II and begin building a war-fighting capability. Although the movement is a small one nationally, the guards were concerned because some protests by militarists have turned violent. Later, an official explained why the demonstration also worried him.

"We are not free from the legacy of the war, whatever it may look like to a visitor who sees the rebuilt cities and who looks at the trade balances," he said. "A strong fear of militarism remains among people who think we were led into terrible destruction by our military. Many are not convinced that democracy is as firmly rooted here as outsiders may assume."

In his view, the public argument here over whether Japan can afford to build a real military force now masks the more fundamental point that "we do not have a national consensus on this politically, and that it remains an explosive issue for us and for any American administration that pushes us on it."

For the ear untrained not only in Asian music but also in Asia's political realities, this too sounds strangely out of sync. It is hard to adjust to the idea of a mystical militarism waiting to clutch the Japanese national throat some dark night and begin undoing the three decades of official pacifism that, along with industrial dynamism and efficiency, has been Japan's international trademark. It is precisely the elusiveness of such a concept for a westerner that bedevils U.S. and Japanese officials here as they seek to reinforce what both insist is America's most important bilateral relationship in the world.

Throughout a five-week trip touching down in Japan, China, Thailand, India and the Philippines, a newcomer to Asia whose experience and thinking have been weighted almost entirely toward the Atlantic and the Sahara is constantly confronted by a new set of realities, a new set of melodies that require intense listening and decoding.

A concentrated period of listening to policy discussion suggests that defining its military relationship with China is the most urgent problem the incoming Reagan administration faces in Asia. But defining and managing the much more complex security relationship with an increasingly independent-minded Japan will probably prove to be the most difficult task on the four-year planning agenda for Reagan's new Asia hands. Opportunities for miscalculations in managing what ha become a strategic triangle linking Washington, Peking and Tokyo abound.

"The 'free ride' -- that's what we will be hit over the head with as soon as Reagan gets into office and his people look at the trade figures and the defense spending figures," a senior official said in Tokyo." 'No more free ride for Japan,' that's what we'll be told. But pushing too hard could lead to a real push by some Japanese for moves that will destabilize our system and the relationship, I fear."

As president, Reagan will need to move quickly to reassure Peking that his campaign "two-China" gafes were nothing more than that, and that he does not intend to reverse Washington's calculated, decade-long movement toward a strong partnership with China.

Moreover, the impact of Reagan's handling of the triangular security relationship will spin out across the entire region, officials in Tokyo, Manila, Hong Kong and Bangkok asserted. They fear most any steps that would push China back into a dangerous, embittered isolation leading to increased regional tension and conflict. Paradoxically, their second strongest fear is that a significantly strengthened China will dominate Southeast Asia. This doubled-edged perception of China as a necessary but dangerously unpredictable ally will present its own problems for the new regime in Washington.

The Asia that Reagan inherits five years after the fall of Saigon to the Communists and a decade after the proclamation of the Nixon Doctrine's restraints on the American presence in the region is a surprisingly assertive and confident one. Led by Japan's dynamic and disciplined work force, many of the region's national economies show strengths that are envied by other parts of a recession-plagued world. Now known as the NICs, or Newly Industrialized Countries, the nations that were dominoes due to topple with Vietnam are alive and for the most part economically well.

Bangkok's busy and prosperous streets appear as if they could not take another car. The fabulously lavish restaurants, cafes and department stores of Tokyo's Ginza district make the Champs Elysees of Paris appear to be a pale relection of an urban playground, and Japan's capital city has a larger population and a greater industrial output than some European nations, including the Netherlands.The elegantly tailored businessmen from Singapore deplaning at every airport along the way testify to the business vitality in that state.

Even in China, the desire to join the era of Asian prosperity is palpable, despite the continuing cutback in the overly ambitious industrial projects outlined for foreign investors a few years ago. The Gang of Four trial is being carried out as a mass educational exercise, justified in part on the basis that the eradication of the "radicals" will help ensure a rise in the standard of living, as will the opening of the country to outside influences that were banned for three decades. Last month, a thousand American businessmen were crammed into the creaking Peking Hotel, many sleeping four to a small room, for an industrial fair, and commercial billboards have begun to sprout on Peking's broad avenues.

What is new strategically is that China and Japan are beginning to shape the triangular relationship with Washington in a far more active fashion as a part of this new assertiveness. Their perceptions of the roles the super-powers are playing in the region -- one of continual expansion by the Soviet Union and benign neglect by an America badly burned in Vietnam and riveted now on the Persian Gulf -- are bringing new choices for China and Japan, particularly in Southeast Asia, where their rising influence is creating a new situation for the former dominoes as well.

What are the driving forces in the region as the 1980s begin?

For Japan, foreign policy is economic policy. Tokyo's need to ensure access to resource and maarkets abroad was one of two underlying reasons for the "omnidirectional" foreign policy of the 1970s that was designed to keep Japan friendly with everybody. The other was a desire not to provoke the Russians. Now, a continuing Soviet buildup in the region and the local threats to oil shipments in the Persian Gulf have caused the Japanese to shelve the friends-with-all stance and begin the torturously slow process of building a new national consensus on foreign, defense and trade policies.

For China, foreign policy is confronting the Russians and getting others, particularly Japan and the United States, to do the same. The invasion of Afghanistan appears to have convinced Chinese planners that a Russian strike into China has turned from a theoretical to a real threat requiring emergency transfusions of sophisticated military hardware from abroad.Realistically, that means trying to get the United States to give -- for free -- such help to China.

"They have been shouting for years that they loved encirclement by the Russians because it would bring the global conflict to a head quicker," a U.S. diplomat said. "Now that they have concluded that the encirclement is really happening and that their popular war strategy would be devastatingly expensive for them, the Chinese are trying to figure out how to equip themselves fast to fight a modern war."

"In Europe, you can count the tanks, the jets, the missiles and get an idea of what the balance is," a Japanese defense official added. "In Asia, it is much more difficult to calculate a balance of force. Do you count China if Russia attacks American bases in Japan? How do you count North Korea?"

Counting China will be a problem in any event. After an initial burst of inquiry into the potential of China to develop into a reliable military partner, the United States and its principal European allies now take a rather skeptical view. "It would take five years and billions of dollars just to fill China's needs for antitank weapons," says a Carter administration official. "They have enough money to buy maybe two F15s for their air force. The question is not whether we help China arm, but first can we pay for arming them?"

"After months of discussions, we have all found that the Chinese are interested in buying one of these and two of those, not the arsenals that were envisioned," says a European diplomat. "What they want is the technology involved, so they can copy it and adapt it to their needs, and that is not the way we do business."

"In developing a strategic equation for Asia, the Reagan administration should count on China to do nothing more militarily over the next four years than it is doing now, which is the enormously important job of forcing the Russians to keep about 35 percent of their ground troops on the Chinese border," said a U.S. official in Hong Kong.

"Our entire relationship with China has to be worked out in a global context, not in a purely bilateral one," U.S. Ambassador Leonard Woodcock said in Peking, underlining that new military moves would rebound not only in Moscow but also in Tokyo and in Europe. "I sense concern among allies that we could move incrementally toward a military relationship here without consulting them at each step. That would be unwise."

Although they have been careful to say nothing publicly, there are signs that the Japanese were concerned when Secretary of Defense Harold Brown, without warning Tokyo, agreed during a visit to Peking immediately after the Soviet invasion of Afghanistan to provide "nonlethal" military equipment to the Chinese.

Oddly enough, Peking strongly echoes the view that the Japanese-American relationship is the most important one in the region. Apparently recognizing the great importance of Japan's industrial base in any long-term effort to contain Russian influence throughout Asia and fearing that Japan could be neutralized by Russian power if the Washington-Tokyo connection were to turn sour, Chinese officials caution that Washington should exercise great caution in its moves along the strategic triangle.

"Japan has to depend on United States support for defense, and has developed close relationships in all fields with the United States," Vice Foreign Minister Zhang Wenjin said. "If Japan should have bad relations with the United States, it will feel less secure and its relationship with China cannot possibly replace its relationship with the United States."

"One small group of officials can manage the government-to-government relationship we have with China," a U.S. official said. "Our relationship with Japan is like a giant coaxial cable, with thousands of strands running through it. Nobody has got hold of them all."

In separate conversations, Japanese officials and business leaders defined what is essentially a three-tiered set of problems that they are seeking to devise strategies to meet in the 1980s. For each, the most likely answers are ones that could bring their country into increasing conflict with the United States.

The first is botaining enough oil supplies to keep their industries running. This has already produced a resource-based approach to their Middle East policy, which one Foreign Ministry official said was "90 percent in agreement with West Europe's views" on the Palestinian problem.

"We would have moved in that direction even sooner except for the United States," one official conceded. "We now have a common front of industrial democracies that should enable us to resist American pressure." That pressure should become even more intense under a Reagan administration that appears, initially at least, more committed to supporting Israel's political policies than was the Carter administration.

Secondly, Japan is determined to continue its domination of foreign markets with exports in the face of the twin pressures of competition and market resistance to yet more Japanese trade surpluses. The ability of Hong Kong, South Korea, Thailand and other NICs to compete in markets previously dominated by Japan is pushing the Japanese to move into new higher-technology exports, while growing threats of tariff and quota restrictions are channeling Japanese investment abroad into developed countries that can make and purchase highly automated output. Both steps could create a new and even more bitter round of "trade friction" with the United States as Americans seek a way out of their own economic distress.

"I am disturbed at the fact that some American companies are buying Japanese-manufactured integrated circuits here because they are better and more trustworthy," U.S. Ambassador Mike Mansfield said in Tokyo. "This is a field we should be able to lead in."

"America taught us for the past three decades, but it is not using its pioneering spirit, its capacity for research and development, and it is not investing for the long term," Akio Morita, the head of Sony industries, said. "Change that, and there will be no trade friction."

One out of every three color television sets exported from Britain today is a Sony, and Morita indicated that Japanese concentration in "high quality, high reliability" industrial goods will sharpen rather than decrease competition in the future. "We have a foreign policy of investment," he said of Japanese industry. "We find more demand in developed countries, and want to be there."

The third set of problems is in Southeast Asia, where the ability of Japan and China to develop policies that work with, or against, each other will be tested most severely, and in ways that could produce new difficulties for the United States.

China, determined to pursue its conflict with Vietnam, has chosen policies that lead to polarization of the region, and those policies are producing a split among the Association of Southeast Asian Nations' five members -- Indonesia, Malaysia, the Philippines, Singapore and Thailand. Japan, predictably, has put its stress on economic matters and regional cohesiveness, becoming ASEAN's largest single aid donor, and would perfer peaceful coexistence with Vietnam as a regional policy.

In recent weeks, Japanese officials have apparently felt compelled to reassure Southeast Asian countries that Tokyo will maintain a regional policy profile quite distinct from China's.

Noting ASEAN fears that Japanese aid and investment would be diverted to Peking, Koji Watanabe, the Foreign Ministry's deputy director general for Asian affairs, pledged in a paper published this month that this would not happen. He added, "The initial excitement of 'China fever' has been replaced by a more businesslike and sober assessment of the nature and limits of cooperation" between Peking and Tokyo.

Even more importantly, Watanabe continued, Japan was aware of "the sense of ambivalence on the part of some ASEAN countries vis-a-vis China" and would never "gang up" with Peking against them. He said that Japan's refusal to provide military aid and equipment to any country applied to China as well.