-
-
Save ekim1394/8bc83c18842b9177f5112b4baa6412c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scikits.audiolab | |
import scipy | |
#random number generator in n x 3 matrix to generate "Computer Sheet Music" | |
num = np.random.rand(1,3) #initialize | |
sheet_music = np.vstack(num) | |
for i in range (0,8): #number of notes in sheet_music | |
notes = np.random.rand(1,3) | |
i += 1 | |
sheet_music = np.append(sheet_music, notes, axis=0) | |
f = 440 | |
fs = 11025 #22050 | |
T = 0.1 | |
x = scipy.cos((2*scipy.pi*f/fs)*scipy.arange(fs*T)) | |
for y in range(0,1000): | |
scikits.audiolab.play(x*y) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment