THE COOLIDGE Auditorium in the Library of Congress had never before seen and heard anything quite like the music-making that went on there on two days last month. And something equally unusual was occupying Lisner Auditorium at the same time.

On the stage at the library were two grand pianos, to one of which, from time to time, were attached lengths of wire, pieces of metal, rubber wedges or other gadgets needed to play recent American music. Five judges sat out in the auditorium, and they were joined by an audience of five of six listening to about two dozen pianists playing everything from Bach to John Cage. The process went on all day long both days, June 23 and 24.

When the Kennedy Center Competition for excellence in the performance of American music reaches its finals here in September, one of those pianists could walk off with the top prize of $10,000 plus all the other rewards that usually go with such a major award. Its combined prizes will total about $30,000.

For many young musicians, competitions are what Shakespeare had in mind when he talked about "such stuff as dreams are made of."

The unusual thing in the Coolidge Auditorium was the required repertoire. While every pianist was permitted to play Bach or Beethoven, Mozart or Mussorgsky, Brahms or MacDowell, every one was also asked to play Milton Babbitt or George Crumb, Seymour Shifrin or Morton Subotnick, Samuel Barber or Dane Rudyhar, Charles Ives, Elliott Carter, or other American composers of this century. Many American pianists have rarely played any of this music. Few have played it all.

The five judges were chosen for their particular personal interest in and acquaintance with this music.

Meanwhile over at Lisner Auditorium on June 23, 24 and 25, the 20th International Bach Competition was reaching its climax, with violinists and cellists lined up to take home almost $10,000 in prizes. This competition, too, was different from its predecessors. For 19 years, the Bach contest, begun here in 1958 by Raissa Tselentis, was the exclusive territory of pianists. This year, however, the keyboard was abandoned. Instead, for three days, solo violinists and cellists sweated over those most demanding of all works in their repertoires, Bach's unaccompanied sonatas, partitas and suites.

It was no wonder that Timothy Baker, who finally won first place among the violinists, told Tselentis, just before giving the performance that won him the top award, "I'm not coming out. My fingers ache." In no concerto or any other solo repertoire do violinists and cellists face the high hurdles that plague them unceasingly in these works. With no piano or orchestra, they are naked before the world, playing on instruments unlike those for which Bach wrote, with bows he never saw. "Such stuff . . ." indeed.

Every contestants has ways of getting psyched up for the grueling sessions that are always a part of these marathons. Where the repertoire is rigidly restricted, as in the Bach competition, and where the judges never see the contestants until the whole thing is over, there is no question of coming out and wowing them right off the bat with one of the smasheroos like a Paganini Caprice or a Wieniawski Polonaise.

Nor is there any way that a sexy, clinging dress can influence an invisible judge in the direction of overlooking tiny slips here and there. In no other competition is there such a feeling of "no place to hide."

However, to return to the realm of psychology, there was, especially in the finals, the undisguisable enthusiasm of the audience for one of the competitors, an enthusiasm which, though they did not share it, the judges could not be unaware of, even though they could not see the player engendering it.

Things were different at the Library of Congress. There, each pianist was free to begin with a work of his own choice, "which should not exceed 15 minutes." To some this was a time to walk out and knock 'em dead with a Prokofiev Toccata. Another chose the Bach Chromatic Fantasy and Fugue.

But others, perhaps figuring that since the emphasis in the competition was on the playing of contemporary American music, headed straight for the "farthest out" piece on their list, opening up with Morton Subotnick's Prelude No. 4 for piano and electronic sounds, as if to get it out of the way as soon as possible.

There are several unusual aspects of the Kennedy Center competition in addition to its repertoire requirements: there is no age limit, and music does not have to be memorized. (Next year's contest will be for singers.) There were several pianists in their 40s, and one elegantly handsome woman was certainly in her 50s if not even a bit more.

Some of the contestants sounded surprised at standard things the judges told them. When one was asked for "the Beethoven Variations, please, without repeates," he repeated, sounding somewhat dismayed, "Without repeats?!" and was assured that "without" was right. He then asked, "Will I be stopped?" and was told, "Yes, you probably will be."

This is such standard procedure in competitions that every entrant should be ready for it, knowing that judges do not need to hear every note of a work to know very well how the whole thing will be played. It is far better for the judges, having had a good sampling of Pianist Q in 10 minutes of a Beethoven sonata, to ask for music in another vein.

Another time a judge asked, "May we hear No. 5 from the Crumb, please, the 'Phantom Gondolier.'" The pianist, with something rather close to a groan of resignation, said, "No. 5?" That is the piece in which the pianist, while taking care of some very unusual demands in playing, also hums, groans and hisses on cue.

It was clear both at the Library and the Lisner that, because of the special repertorie requirements in both competitions, the level of musicality among the performers was unsually high.

In both contests, the judges were doing one of the toughest jobs in music in competent, professional style. There were times when it was perfectly obvious after three minutes of playing that somehow a candidate had gotten into at least the preliminary rounds who did not belong in that particular ball park. Others, especially at the Library of Congress, showed real abilities but were simply not in the league to qualify for all that is implied with the winning of a $10,000 prize and its accompanying rewards.

These contests seem, despite all their problems and occasional inequities, useful mechanisms. The thrust of the Kennedy Center's, with its emphasis on performing American music, is especially valuable. It is likely to have a decided impact on the publishers and buyers of that music, and on the world of recitals in which that music has so long been wretchedly neglected. Its finals, to begin here on Sept. 11, are likely to be something of a world series in music. CAPTION: Picture, Three judges sit behind a screen, awaiting the next performer; Illustration, No. 8, "Phantom Gondolier" from "Makrokosmos, Vol. 1" by George Crumb; Copyright (c) 1974, C.F. Peters Corp., N.Y.; reprinted with permission