Is there free software that automatically composes music and does not place restrictions on the generated output? I need to be able to use the generated music commercially.
Couldn't Garageband's 'Magic' feature do this for you? (Assuming you have access to a Mac)
There's a guide to Automatic Composition with Magic Garageband here.
There was also (back in the deep recesses of time) a program available for the Amiga, called
Super Jam, which produced MIDI compositions.
-EDIT- There appears to be a free, Windows version of Super Jam here. It's probably extremely dated but it used to work well enough for me.