Guest User

Untitled

a guest
Jan 24th, 2025
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.59 KB | None | 0 0
  1. x = "C:/Users/Pc/Desktop/samples/phonk/1.wav"
  2. num_chunks = 30
  3. y = 0
  4. z = 0.98
  5. t = sample_duration(x, start: y, finish: z)
  6.  
  7. ##| Method that samples the song
  8. define :sampleSong do
  9.   sample x, start: y, finish: z, amp: 1
  10.   sleep t
  11. end
  12.  
  13. define :controlVolume do |a,b|
  14.   tick
  15.   sample x, start: y, stop: z, slice: look, num_slices: num_chunks, amp: (line a, b, steps: num_chunks).look
  16.   sleep t / num_chunks
  17. end
  18.  
  19. with_fx :reverb, room: 0.6 do
  20.   num_chunks.times do
  21.     controlVolume 0.1,1
  22.   end
  23.   2.times do
  24.     sampleSong
  25.   end
  26.   num_chunks.times do
  27.     controlVolume 1,0.1
  28.   end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment