I believe you need to add an fputs() line to your script...
After opening the file, and before closing it, add this:
fputs($file, $newstring);
That should write the contents of $newstring to the file $file.
I'm not sure if this makes a difference of not, but in the line that reads:
$newstring = "$artist - $title\n";
You may want to change it to:
$newstring = "$artist" . " - " . "$title";
Not sure on that last part though...just off the top of my head.
-- Jason