Alex Diehl, 27, said he wrote the pacifist jingle "Ein kleines Lied" ("A little song") after last night's attacks and posted the YouTube clip of it on Facebook.
"Fear turns to hate, hate turns to war, until humanity hits the floor, until everything explodes and everyone loses their minds," he sings in German, warning that anger must not turn to hatred against refugees coming to Europe.
"Have you learnt nothing?" he asks the perpetrators in the guitar song, recorded on his smartphone camera in his apartment on a couch in front of the iconic Vietnam war era "Why?" poster of a soldier being shot.
"I stopped breathing when I heard the bang," he wrote on Facebook. "I think pretty much everyone felt under their skin that it was not a firecracker or some kind of joke."
He said his song was a signal that people "won't be intimidated" and would "stand firm, with decency, peacefully".