Python-based tone generator