1
0
mirror of https://git.exozy.me/a/Never-Gonna-Give-Beep-Up synced 2024-11-25 09:17:30 +00:00
Never-Gonna-Give-Beep-Up/beepemu-sox

27 lines
507 B
Plaintext
Raw Normal View History

2022-10-03 22:12:57 +00:00
#!/usr/bin/python
import os
import sys
import time
i = 1
f = 0
l = 0
while i < len(sys.argv):
if sys.argv[i] == '-f':
i += 1
f = float(sys.argv[i])
elif sys.argv[i] == '-l':
i += 1
l = float(sys.argv[i])/1000
elif sys.argv[i] == '-D':
i += 1
time.sleep(float(sys.argv[i])/1000)
if f != 0 and l != 0:
print(f, l)
2022-10-03 22:27:21 +00:00
os.system(f'play -n synth {l*0.75} sawtooth {f} &')
2022-10-03 22:12:57 +00:00
time.sleep(l)
f = 0
l = 0
i += 1