Sample name stored in a variable

What about using a hash?

sl = {"sample_loop_01" => :loop_amen,"sample_loop_02" => :loop_garzul}

define :play_sample do | number |
  
  sampleToPlay = "sample_loop_" + number.to_s
  x= sampleToPlay.to_s
  sample sl[x]
end

play_sample("01")

Essentially it carries out the substitution that you want.