-- frequencies in hertz (cycles per second) r = 2^(1/12) A4 = 440 A4sharp = 440 r B4 = 440 r^2 C5 = 440 r^3 C5sharp = 440 r^4 D5 = 440 r^5 D5sharp = 440 r^6 E5 = 440 r^7 F5 = 440 r^8 F5sharp = 440 r^9 G5 = 440 r^10 G5sharp = 440 r^11 -- chord C F G (multiply freq by 2 pi to convert to radians) f = sin(2 pi C5 t) + sin(2 pi F5 t) + sin(2 pi G5 t) f = float(f) -- convert to floating point for faster drawing xrange = (0,0.05) draw(f,t)
Run