import numpy as np
from scipy.io.wavfile import write
sr = 44100
duration = 10
t = np.linspace(0, duration, int(sr*duration), endpoint=False)
bass = 0.3*np.sin(2*np.pi*55*t)
kick = 0.6*(np.sin(2*np.pi*60*t)*(t%0.5<0.05))
hat = 0.2*(np.random.randn(len(t))*(t%0.25<0.01))
mel = 0.15*np.sin(2*np.pi*440*(1+0.2*np.sin(2*np.pi*2*t))*t)
audio = bass + kick + hat + mel
audio = np.clip(audio, -1, 1)
path = "/mnt/data/phonk_beat.wav"
write(path, sr, (audio*32767).astype(np.int16))
path