Beatles legend Paul McCartney has voiced concerns about artificial intelligence (AI) being used to "rip off" artists.