A new code of conduct has been drafted in response to artists dealing with sexual harassment, discrimination and violence.