change piano sample

This commit is contained in:
Siwat Sirichai 2022-04-09 23:20:02 +07:00
parent 5e7a923c3a
commit 3c96a3f3ad
28 changed files with 29 additions and 12 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,6 +1,8 @@
from pysine import pysine
import winsound
import threading
from playsound import playsound
import os
MODE = 'pysine'
@ -23,5 +25,17 @@ def beep(frequency: float, duration: float):
kwargs={'frequency': frequency, 'duration': duration}
)
__beeper__.start()
#TODO Tune the piano
def __piano_key_thread__(note: str):
note = format(note,'02')
soundfile = os.path.dirname(__file__)+'\\piano_sample\\key'+note+'.mp3'
print(soundfile)
playsound(soundfile)
def piano_key(note: str):
threading.Thread(target=__piano_key_thread__,
kwargs={'note': note}
).start()