Skip to content

Instantly share code, notes, and snippets.

@tokiwoousaka
Last active December 23, 2015 15:19
Show Gist options
  • Save tokiwoousaka/6655082 to your computer and use it in GitHub Desktop.
Save tokiwoousaka/6655082 to your computer and use it in GitHub Desktop.
ちゅ〜りっぷ
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