Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #Sample
  2. sl = "C:/Users/Pc/Documents/Chrstimas/"
  3. x = sl + "Santa Claus Saves the Earth (full).wav"
  4. #Timing
  5. #y = start
  6. #z = end
  7. y = 0
  8. z = 1
  9. #Rate
  10. r = 1
  11. #Offset
  12. o = 0
  13.  
  14. define :randomseed do |a|
  15. use_random_seed a
  16. puts a
  17. end
  18.  
  19. define :picksample do
  20. x = sl + samples.choose
  21. end
  22.  
  23. define :picktime do |ymin,ymax,zmin,zmax|
  24. y = rrand(ymin,ymax)
  25. z = rrand(zmin,zmax)
  26. end
  27.  
  28. define :pickrate do |rmin,rmax|
  29. r = rrand(rmin,rmax)
  30. end
  31.  
  32. define :playnoise do |a, pan|
  33. randomseed a
  34. #picksample
  35. picktime 0.8, 0.1, 0.5, 0.6
  36. pickrate 0.1, 2
  37. sample x, start: y, finish: z, rate: r, amp: 6
  38.  
  39. sleep sample_duration(x, start: y, finish: z) / (r+0.1)
  40. end
  41.  
  42.  
  43. with_fx :distortion, distort: 0.1 do
  44. with_fx :reverb do
  45. in_thread do
  46. playnoise 100, 0.5
  47. end
  48. playnoise 110, -0.5
  49. playnoise 120, 0
  50. in_thread do
  51. playnoise 130, 0.5
  52. end
  53. playnoise 140, -0.5
  54. playnoise 150, 0
  55. playnoise 160, 0
  56. playnoise 170, 0
  57. playnoise 200, 0
  58. playnoise 180, 0
  59. playnoise 190, 0
  60. playnoise 180, 0
  61. end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement