Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.Char
- import Data.List
- import System.IO
- sv :: Float -> Float -> String
- sv velocity time = intercalate "," [show time, show (-100 / velocity), "4", "2", "0", "5", "0"]
- tp :: Float -> Float -> String
- tp bpm time = intercalate "," [show time, show (60000/bpm), "4", "2", "0", "5", "1", "0"]
- red_lines :: [Float] -> Float -> String
- red_lines times bpm = intercalate "\n" (map (tp bpm) times)
- chart xs = intercalate "\n" xs
- --this isnt quite right
- grad_func start end x = end * x + (start - end) * 0.5 * x * x
- smooth_times nps1 nps2 length start = map make_sample [0..samples]
- where mean_nps = (nps1 + nps2) * 0.5
- samples = mean_nps * length / 1000
- make_sample x = lerp (grad_func (nps1 / mean_nps) (nps2 / mean_nps) (x / samples))
- lerp x = start + length * x
- stream :: Float -> Float -> Float -> Float -> Float -> String
- stream bpm snap1 snap2 start length = red_lines (smooth_times (bpm * snap1 / 60) (bpm * snap2 / 60) length start) bpm
- snap_transform original target bpm time = chart [tp (bpm * target / original) time, sv (original / target) time ]
- trumpet_1 time = stream 125 8 12 time 1200
- trumpet_2 time = stream 125 12 8 time 480
- crash_1 time = stream 125 10 8 time 960
- crash_2 time = stream 125 12 6 time 480
- buildup_bridge time intensity = snap_transform 8 intensity 125 time
- buildup_prechorus time = stream 125 8 12 time 1920
- buildup_chorus time = stream 125 8 14 time 1920
- boop = chart [
- tp 125 46897, --initial timing (not slow intro)
- trumpet_2 47377,
- trumpet_2 49297,
- trumpet_2 51217,
- buildup_bridge 52657 9,
- buildup_bridge 53137 10,
- buildup_bridge 53617 11,
- buildup_bridge 54097 8,
- -- first verse here (no fancy stuff)
- -- just how long has it been
- buildup_bridge 68017 9, -- right
- buildup_bridge 68497 10, -- in
- buildup_bridge 68977 11, -- front of
- buildup_bridge 69457 8, -- mee
- trumpet_1 70657, --we've been together... section
- trumpet_1 72577,
- trumpet_1 74497,
- trumpet_1 76417,
- trumpet_1 78337,
- trumpet_2 80257, -- i can't believe it
- buildup_bridge 81457 9, -- this...
- buildup_bridge 82417 10, -- is...
- buildup_bridge 83377 11, -- happ-...
- buildup_bridge 84337 8,
- stream 125 12 8 84337 960, -- -en-...
- stream 125 8 12 85297 1920, -- -niiiiiiing
- -- i think oh well what am i to doooo
- stream 125 8 12 92017 960, -- oooo
- trumpet_2 99697, --oh
- trumpet_2 100177, --ill just
- stream 125 14 8 100657 960, -- bide my
- trumpet_2 101617, --time
- trumpet_2 102097, --and when i
- stream 125 8 14 102577 1920, -- wanna say i love you i say
- stream 125 12 14 116017 1920, -- booooo
- stream 125 13 15 117937 1440, -- oooooooop
- --every chatelaine... section
- crash_1 119857,
- crash_1 121777,
- crash_1 123697,
- crash_2 125617,
- crash_2 126097,
- crash_2 126577,
- crash_2 127057,
- crash_1 127537,
- crash_1 129457,
- crash_1 131377,
- trumpet_2 133297,
- trumpet_2 134257,
- trumpet_1 135937, -- and when i think about you... section
- trumpet_1 137857,
- trumpet_1 139777,
- trumpet_1 141697,
- trumpet_1 143617,
- stream 125 8 10.5 145537 800, -- extra trumpet cut short (if your feelings are the same)
- buildup_bridge 146737 9, -- maybe i should slow it down
- buildup_bridge 147697 10, -- try to show restraint
- buildup_bridge 148657 11, -- hold magn-
- buildup_bridge 149617 8, -- -hild i
- buildup_bridge 150577 10, -- think im gonna
- buildup_bridge 152497 8, -- faint
- buildup_chorus 183217]
- main = do
- --handle <- openFile "output.txt" WriteMode
- writeFile "output.txt" boop
- return ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement