Advertisement
Guest User

Untitled

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