import math import os import sys import sounddevice as sd import yue # Number of times to sample each second bitrate = 44100 note = [] for i in range(0, 24): note.append([yue.tone(yue.freq(3, i), j / bitrate) / 4 for j in range(0, 3 * bitrate)]) sd.default.samplerate = bitrate print("READY") while True: os.system("stty raw -echo") c = sys.stdin.read(1) os.system("stty -raw echo") x = "`1234567890-~!@#$%^&*()_".index(c) print(x) sd.play(note[x])