# Ticking through samples randomly from outside folder

**URL:** <https://in-thread.sonic-pi.net/t/ticking-through-samples-randomly-from-outside-folder/1553>\
**Category:** Support, Help & Resources\
**Created:** [October 9, 2018, 6:02pm UTC](https://in-thread.sonic-pi.net/t/ticking-through-samples-randomly-from-outside-folder/1553 "2018-10-09T18:02:07Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [October 9, 2018, 8:29pm UTC](https://in-thread.sonic-pi.net/t/ticking-through-samples-randomly-from-outside-folder/1553/2 "2018-10-09T20:29:06Z")

</div>

Hi there,

`tick` is never random, it’s just a basic counter: `0, 1, 2, 3, 4...`.

For example:

```ruby
live_loop :foo do
    sample path_to_sample_folder, tick
    sleep 8
end

```

This will play each successive sample (alphabetically in order) with 8 beats between sample triggers. It will always play them alphabetically as `tick` will always increase by one every time it is called (assuming there’s only one call to `tick` in the current live loop).

However, if you want it to pick a random sample, you need to use `pick`:

```ruby
live_loop :foo do
    sample path_to_sample_folder, pick
    sleep 8
end

```

The caveat here is that in Sonic Pi, there’s no real randomness, so that the same code always produces the same sounds. You can manipulate this though by using random seeds. For more information about randomness please see: [http://sonic-pi.net/tutorial.html#section-4](http://sonic-pi.net/tutorial.html#section-4)

I hope that this helps 🙂

---

_[View the full topic](https://in-thread.sonic-pi.net/t/ticking-through-samples-randomly-from-outside-folder/1553)._
