I didn't want to get into the complexities of an $index function here. So I have added a %_primaryartist% (and matching %_primaryartistsort%) variables and used %_primaryartist% in the default file naming script.