Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.12 KB | None | 0 0
  1. #Sample
  2. x = sl + "SuperMario.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: 0.5
  37.  
  38.   sleep sample_duration(x, start: y, finish: z) / (r+0.1)
  39. end
  40.  
  41. with_fx :lpf, cutoff: 110 do
  42.   with_fx :reverb, room: 1 do
  43.     with_fx :reverb do
  44.       playnoise 160, 0
  45.       playnoise 200, 0
  46.       playnoise 130, 0
  47.       playnoise 10, 0
  48.       playnoise 120, 0
  49.       with_fx :echo, phase: 10, max_phase: 10 do
  50.         in_thread do
  51.           5.times do
  52.             playnoise 100, 0.5
  53.           end
  54.         end
  55.       end
  56.       playnoise 140, -0.5
  57.       playnoise 150, 0
  58.       playnoise 160, 0
  59.       playnoise 170, 0
  60.       playnoise 180, 0
  61.     end
  62.   end
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement