-------------------------------------------------------------------- Allan Kozinn writes frequently about music and musicians. By ALLAN KOZINN

During the 18th century, it was not uncommon for enlightened princes with musical pretensions to commission works from their court composer and then affix their own names to the title pages. But in the recently solved riddle of the so-called Pergolesi/Ricciotti ''Concerti Armonici,'' the case seems to be just the reverse. These six works, written in the contrapuntal sdyle of the late Baroque, were long thought to be the work of Giovanni Battista Pergolesi, largely because handwritten copies of the score found in various collections attributed the set to the Italian composer.

Musicologists had doubts, however, and speculation as to the real author of the works centered around half a dozen mostly obscure names. Eventually, it was discovered that the works were originally published in Amsterdam, in 1740. The printed e dition does not bear the composer's name, but the publisher, Carlo Ricciotti, was himself a violinist and a composer and so for several years, suspicion focused on him.

Still, there were doubts. But the mystery was finally unraveled a couple of years ago when Albert Dunning, a musicologist, made an expedition to Twickel castle, in Delden, Holland. While exploring Delden's library, Dr. Dunning found the manuscript of the six works, with a curiously confessional foreword by Twickel's lord, the Dutch Count Unico Wilhelm van Wassenaer. In the foreword, Van Wassenaer - a statesman, ambassador and amateur musician - admits to having composed the six concertos between 1725 and 1740, adding that he gave Ricciotti permission to publish them on the condition that his own name did not appear on them. The Count n eed not have been so modest. These are excellently constructed w orks that have enjoyed a much popularity with chamber orchestras, a nd not merely because they were thought to be Pergolesi's. Each concerto is built in the old church sonata fashion,with four alt ernating slow and fast movements; and each movement is full of the c haracter, wit and polish that one simply doesn't expect from a part-t ime composer. Within the seven-part texture (four violins, viol a, cello and the basso continuo group), solo instrumentsand groups ar e imaginatively deployed and the musical material itself holds many points of interest.