Advertisement
Guest User

boop timing lines

a guest
Oct 7th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. import Data.Char
  2. import Data.List
  3. import System.IO
  4.  
  5. sv :: Float -> Float -> String
  6. sv velocity time = intercalate "," [show time, show (-100 / velocity), "4", "2", "0", "5", "0"]
  7.  
  8. tp :: Float -> Float -> String
  9. tp bpm time = intercalate "," [show time, show (60000/bpm), "4", "2", "0", "5", "1", "0"]
  10.  
  11. red_lines :: [Float] -> Float -> String
  12. red_lines times bpm = intercalate "\n" (map (tp bpm) times)
  13.  
  14. chart xs = intercalate "\n" xs
  15.  
  16. --this isnt quite right
  17. grad_func start end x = end * x + (start - end) * 0.5 * x * x
  18.  
  19. smooth_times nps1 nps2 length start = map make_sample [0..samples]
  20. where mean_nps = (nps1 + nps2) * 0.5
  21. samples = mean_nps * length / 1000
  22. make_sample x = lerp (grad_func (nps1 / mean_nps) (nps2 / mean_nps) (x / samples))
  23. lerp x = start + length * x
  24.  
  25. stream :: Float -> Float -> Float -> Float -> Float -> String
  26. stream bpm snap1 snap2 start length = red_lines (smooth_times (bpm * snap1 / 60) (bpm * snap2 / 60) length start) bpm
  27.  
  28. snap_transform original target bpm time = chart [tp (bpm * target / original) time, sv (original / target) time ]
  29.  
  30. trumpet_1 time = stream 125 8 12 time 1200
  31. trumpet_2 time = stream 125 12 8 time 480
  32. crash_1 time = stream 125 10 8 time 960
  33. crash_2 time = stream 125 12 6 time 480
  34. buildup_bridge time intensity = snap_transform 8 intensity 125 time
  35. buildup_prechorus time = stream 125 8 12 time 1920
  36. buildup_chorus time = stream 125 8 14 time 1920
  37. boop = chart [
  38. tp 125 46897, --initial timing (not slow intro)
  39.  
  40. trumpet_2 47377,
  41. trumpet_2 49297,
  42. trumpet_2 51217,
  43. buildup_bridge 52657 9,
  44. buildup_bridge 53137 10,
  45. buildup_bridge 53617 11,
  46. buildup_bridge 54097 8,
  47. -- first verse here (no fancy stuff)
  48. -- just how long has it been
  49. buildup_bridge 68017 9, -- right
  50. buildup_bridge 68497 10, -- in
  51. buildup_bridge 68977 11, -- front of
  52. buildup_bridge 69457 8, -- mee
  53.  
  54. trumpet_1 70657, --we've been together... section
  55. trumpet_1 72577,
  56. trumpet_1 74497,
  57. trumpet_1 76417,
  58. trumpet_1 78337,
  59.  
  60. trumpet_2 80257, -- i can't believe it
  61. buildup_bridge 81457 9, -- this...
  62. buildup_bridge 82417 10, -- is...
  63. buildup_bridge 83377 11, -- happ-...
  64. buildup_bridge 84337 8,
  65. stream 125 12 8 84337 960, -- -en-...
  66. stream 125 8 12 85297 1920, -- -niiiiiiing
  67.  
  68. -- i think oh well what am i to doooo
  69. stream 125 8 12 92017 960, -- oooo
  70. trumpet_2 99697, --oh
  71. trumpet_2 100177, --ill just
  72. stream 125 14 8 100657 960, -- bide my
  73. trumpet_2 101617, --time
  74. trumpet_2 102097, --and when i
  75. stream 125 8 14 102577 1920, -- wanna say i love you i say
  76.  
  77. stream 125 12 14 116017 1920, -- booooo
  78. stream 125 13 15 117937 1440, -- oooooooop
  79.  
  80. --every chatelaine... section
  81. crash_1 119857,
  82. crash_1 121777,
  83. crash_1 123697,
  84. crash_2 125617,
  85. crash_2 126097,
  86. crash_2 126577,
  87. crash_2 127057,
  88. crash_1 127537,
  89. crash_1 129457,
  90. crash_1 131377,
  91. trumpet_2 133297,
  92. trumpet_2 134257,
  93.  
  94. trumpet_1 135937, -- and when i think about you... section
  95. trumpet_1 137857,
  96. trumpet_1 139777,
  97. trumpet_1 141697,
  98. trumpet_1 143617,
  99. stream 125 8 10.5 145537 800, -- extra trumpet cut short (if your feelings are the same)
  100. buildup_bridge 146737 9, -- maybe i should slow it down
  101. buildup_bridge 147697 10, -- try to show restraint
  102. buildup_bridge 148657 11, -- hold magn-
  103. buildup_bridge 149617 8, -- -hild i
  104. buildup_bridge 150577 10, -- think im gonna
  105. buildup_bridge 152497 8, -- faint
  106.  
  107. buildup_chorus 183217]
  108.  
  109. main = do
  110. --handle <- openFile "output.txt" WriteMode
  111. writeFile "output.txt" boop
  112. return ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement