For safety's sake, I rev my straight pipes and fire my pistol in the air. Oh, sorry, wrong threads.
I have a bell, I mean the kind you'd hang from a goat, swinging from my handlebars. I just let it ring softly the whole time. People seem to hear it gradually from the distance and move to the side. Maybe they think a goatherd is catching up to them. Less scary than a bicyclist, apparently.