The syntax is as follows:
<MAPNAME> <number> <MUSICLUMP> <number> <MUSICLUMP> ... <MAPNAME> <number> <MUSICLUMP> <number> <MUSICLUMP> ... etc.
MAP01 1 D_ROMERO 2 D_STALKS MAP02 1 D_RUNNIN 7 D_MESSAG
The value 0 is reserved for the map's default music. Maps in Doom format are limited to numbers in the 1-64 range; which is probably already more than needed in most cases. Other map formats have a higher limit or no restriction, and ACS allows to use more complex functions to change music through SetMusic and LocalSetMusic.