# How to use samples live effectively? How's Sam Aaron doing it?

**URL:** <https://in-thread.sonic-pi.net/t/how-to-use-samples-live-effectively-hows-sam-aaron-doing-it/5475>\
**Category:** Support, Help & Resources\
**Created:** [April 28, 2021, 5:11am UTC](https://in-thread.sonic-pi.net/t/how-to-use-samples-live-effectively-hows-sam-aaron-doing-it/5475 "2021-04-28T05:11:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaltyDaddy](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@SaltyDaddy](https://in-thread.sonic-pi.net/u/SaltyDaddy)\
**Post date:** [April 28, 2021, 5:11am UTC](https://in-thread.sonic-pi.net/t/how-to-use-samples-live-effectively-hows-sam-aaron-doing-it/5475/1 "2021-04-28T05:11:54Z")

</div>

Hello all,

I’ve been watching a few of Sam Aaron’s live sessions. His use of samples is great and I’d like to be able to copy it, but there’s something undocumented about how he uses samples.

On this video at the very beginning, line 7: [https://www.youtube.com/watch?v=kxX6ZEhFlm4](https://www.youtube.com/watch?v=kxX6ZEhFlm4)

He uses a variable “ebit\_bass” which does not seem to be defined anywhere.

Same on this video at the very beginning: [https://www.youtube.com/watch?v=G1m0aX9Lpts](https://www.youtube.com/watch?v=G1m0aX9Lpts) with “bass\_atmos”

How does he do it?

Alternatively, I would be grateful for any tips and tricks regarding how to use sample effectively in a live coding session, and I would be very interested if anyone have an interesting sample starter pack to share or recommend.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![ethancrawford](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethancrawford](https://in-thread.sonic-pi.net/u/ethancrawford)\
**Post date:** [April 28, 2021, 5:57am UTC](https://in-thread.sonic-pi.net/t/how-to-use-samples-live-effectively-hows-sam-aaron-doing-it/5475/2 "2021-04-28T05:57:37Z")

</div>

Since I’m around, I’ll chime in 😄  
He is storing references to his own sample paths in code. (I think this was by using functions to return those paths - correct me otherwise @samaaron!). So in this case, `ebit_bass` and `bass_atmos` return the paths to the bass samples in the ebit pack, and atmos samples in the bass pack respectively.

I do a similar thing, as no doubt others do also. Since functions stay in memory and are persistent across buffers, it can be useful for example to run some functions that define the paths to custom samples when Sonic Pi starts up - using the init.rb file in the `.sonic-pi` config folder.

How you could construct such functions is a matter of preference really - I have a bunch of hashes that map folder paths of each sample pack’s categories to specific keys, nested inside a larger hash that maps the root folder of each pack to another key. Then I use these to make new functions pointing to each path of the sample pack categories, which I then load on Sonic Pi startup 🙂

The above is one strategy that is useful to some degree. It still requires you to know the sample pack and category keys, (or to perhaps have a further function that prints out all these keys). I’m sure there are other tricks that might be useful, that may or may not require either extra support code in your composition, or code added to Sonic Pi itself.

---

<div class="post-metadata">

**Author:** ![ethancrawford](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethancrawford](https://in-thread.sonic-pi.net/u/ethancrawford)\
**Post date:** [April 29, 2021, 7:36am UTC](https://in-thread.sonic-pi.net/t/how-to-use-samples-live-effectively-hows-sam-aaron-doing-it/5475/3 "2021-04-29T07:36:33Z")

</div>

Ah, found it! I remembered that there was a discussion about managing samples a while ago.  
(Not strictly to do with using them in a live coding situation, but it may still be of interest 🙂).  
See here:

> [@Sample/Loop Management](https://in-thread.sonic-pi.net/t/sample-loop-management/601):
>
> How do you manage your samples and loops? Ok, this might sound off-topic. But it needs not be. Sonic Pi can do a lot with samples and there’s probably an appropriate way to handle those files. Been growing increasingly interested in the problem of sample/loop management. Basically, it’s too easy to start accumulating bits and pieces of audio and it quickly becomes difficult to find the ones you need. Sounds like it’s really not a solved problem. But it’s probably not such a “wicked” problem t…

---

<div class="post-metadata">

**Author:** ![SaltyDaddy](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@SaltyDaddy](https://in-thread.sonic-pi.net/u/SaltyDaddy)\
**Post date:** [April 29, 2021, 10:04am UTC](https://in-thread.sonic-pi.net/t/how-to-use-samples-live-effectively-hows-sam-aaron-doing-it/5475/4 "2021-04-29T10:04:22Z")

</div>

Thanks for all the info Ethan!

---

<div class="post-metadata">

**Author:** ![enkerli](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/enkerli/32/54_2.png) [@enkerli](https://in-thread.sonic-pi.net/u/enkerli)\
**Post date:** [May 13, 2021, 10:58am UTC](https://in-thread.sonic-pi.net/t/how-to-use-samples-live-effectively-hows-sam-aaron-doing-it/5475/5 "2021-05-13T10:58:53Z")

</div>

Right. Was (and still am) mostly interested in how people organize their sample collections. Sounds to me like it isn’t a “solved problem”, generally. SPi can help.

And the way SPi handles sample packs affords some explanation. No wonder it’s described in the tutorial as an advanced topic (section 3.7 in version 3.3.0). Haven’t tried explaining it to the proverbial 10 year-old. Filesystem stuff tends to be cumbersome to explain. Especially with regex.
