Last active
December 23, 2015 15:19
-
-
Save tokiwoousaka/6655082 to your computer and use it in GitHub Desktop.
ちゅ〜りっぷ
This file contains hidden or 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
module Main where | |
import Sound.Sarasvati.Base | |
sinl :: Float -> [Float] | |
sinl x = map sin $ f 0 | |
where f v = v : f (v + (x / 4410)) | |
zips :: [a] -> [(a, a)] | |
zips x = zip x x | |
makeWave :: Float -> Int -> [(Float, Float)] | |
makeWave h l = take (l * 25000) $ zips (sinl h) | |
c = makeWave 523.25 | |
d = makeWave 587.32 | |
e = makeWave 659.25 | |
g = makeWave 783.99 | |
a = makeWave 880.00 | |
mero = concat | |
[c 1, d 1, e 2, c 1, d 1, e 2 | |
,g 1, e 1, d 1, c 1, d 1, e 1, d 2 | |
,c 1, d 1, e 2, c 1, d 1, e 2 | |
,g 1, e 1, d 1, c 1, d 1, e 1, c 2 | |
,g 1, g 1, e 1, g 1, a 1, a 1, g 2 | |
,e 1, e 1, d 1, d 1, c 4] | |
main :: IO () | |
main = do | |
sarasvatiOutput defaultConfig mero | |
return () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment