# Get the sample name picked from "pick"?

**URL:** <https://in-thread.sonic-pi.net/t/get-the-sample-name-picked-from-pick/7134>\
**Category:** General\
**Created:** [September 26, 2022, 4:09pm UTC](https://in-thread.sonic-pi.net/t/get-the-sample-name-picked-from-pick/7134 "2022-09-26T16:09:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![philAwesomeTech](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/philawesometech/32/1152_2.png) [@philAwesomeTech](https://in-thread.sonic-pi.net/u/philAwesomeTech)\
**Post date:** [September 26, 2022, 4:09pm UTC](https://in-thread.sonic-pi.net/t/get-the-sample-name-picked-from-pick/7134/1 "2022-09-26T16:09:47Z")

</div>

how do you get the name of a randomly ‘picked’ sample  
I defined a variable that holds a “picked” sample & it plays fine, I try to get info on the sample & I get this  
samp=#\<Proc:0x0000020deafce870 C:/Program Files/Sonic Pi/app/server/ruby/lib/sonicpi/lang/core.rb:2062 (lambda)\>"

I could “hard code” a random list of letters (appended to a number for 3 different versions of a guitar riff, for a “live feel” when pulling them in). but, some samples might had “a-c” but some might have “a-f” as suffixes…

e.g. if bass\_01a.wav & bass\_01b.wav & bass\_01c.wav" are in the folder, and I use:

```ruby
bass_samp = @root+"bass/", "01", pick
sample bass_samp

```

how do I know what one was picked?

if I use

```ruby
puts bass_samp

```

I get the lambda string above…

---

<div class="post-metadata">

**Author:** ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)\
**Post date:** [September 26, 2022, 8:26pm UTC](https://in-thread.sonic-pi.net/t/get-the-sample-name-picked-from-pick/7134/2 "2022-09-26T20:26:47Z")

</div>

You could use the `sample_paths` function.  
It returns a ring of all matched samples, so you have to index it with `[0]` to get the first (and only) path:

```ruby
bass_samp = (sample_paths @root+"bass/", "01", pick)[0]
puts bass_samp
sample bass_samp

```
