PURPOSE: To compress an input data and to reduce the cost by adopting a tentative pattern for two on more identification codes in an identification code matrix and repeating the operation imparting a new identification code in response to the result of count of number of times of appearance of the tentative pattern.
CONSTITUTION: A music data fed to an identification code matrix generating circuit 2 is divided at every measure and a same identification code is imparted to a same data in response to the content of data at every measure. The music data with the identification code imparted thereto is fed to a tentative pattern generating circuit 4 in such a manner. The tentative pattern generating circuit 4 discriminates whether or not the generated pair data is composed of the two same identification codes. When the identification codes are consecutive, a counter 5 counts the number of times of appearance of the data and when the number of times is, e.g. twice or above, an identification code imparting circuit 6 imparts a different identification code again. Thus, the data is compressed considerably to save the recording area of a ROM cassette or the like remarkably.