# Are the samples in the repo?

**URL:** https://in-thread.sonic-pi.net/t/are-the-samples-in-the-repo/8320
**Category:** Support, Help & Resources
**Created:** [November 2, 2023, 12:34pm UTC](https://in-thread.sonic-pi.net/t/are-the-samples-in-the-repo/8320 "2023-11-02T12:34:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jonny](https://in-thread.sonic-pi.net/u/jonny)
#### Post date: [November 2, 2023, 12:34pm UTC](https://in-thread.sonic-pi.net/t/are-the-samples-in-the-repo/8320/1 "2023-11-02T12:34:21Z")

</div>

I’m just playing with apps to detect bpm and have one (chordai, on android) that detects BPM/chords for files, YouTube vids, and url content

I wondered where the samples are stored, and whether these are accessible via urls

Any clues most welcome! Thanks 👍

---

<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: [November 2, 2023, 4:19pm UTC](https://in-thread.sonic-pi.net/t/are-the-samples-in-the-repo/8320/2 "2023-11-02T16:19:20Z")

</div>

They are in the repo here: [https://github.com/sonic-pi-net/sonic-pi/tree/dev/etc/samples](https://github.com/sonic-pi-net/sonic-pi/tree/dev/etc/samples)  
If you click on one, on the right of the page you should see a button labelled “Raw”, if you click on it, that will link to the file - or if you right click it and “Copy link address” that will copy the url of the sample.

---

<div class="post-metadata">

### Author: ![Davids-Music-Lab](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/davids-music-lab/32/512_2.png) [@Davids-Music-Lab](https://in-thread.sonic-pi.net/u/Davids-Music-Lab)
#### Post date: [November 2, 2023, 8:06pm UTC](https://in-thread.sonic-pi.net/t/are-the-samples-in-the-repo/8320/3 "2023-11-02T20:06:53Z")

</div>

You can get the PBM with this line of code:

```ruby
print 60/((sample_duration :loop_amen) / 4.0)

```

Assuming the sample is four beats long.

---

<div class="post-metadata">

### Author: ![jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jonny](https://in-thread.sonic-pi.net/u/jonny)
#### Post date: [November 4, 2023, 5:37pm UTC](https://in-thread.sonic-pi.net/t/are-the-samples-in-the-repo/8320/4 "2023-11-04T17:37:22Z")

</div>

Thanks! I’m gonna review the loop samples, and note which are more/less/equal 4beats, but noticed whilst testing recently that whilst rate or density will affect the playback rate, increasing the bpm won’t make samples play faster… Perhaps it’s that they’re triggered more frequently.

I’m starting to wonder if sonicpi doesn’t really care much about BPM!

Previously i assumed it’s best to half and double stuff, instead of more complex calculations, but maybe the magic of the timing system makes ‘original’ or ‘intended’ bpm a little academic/unimportant, providing the figures add up (eg the relative amounts, for syncing multiple loops of differing length, for example…

Starting to run low on drawing boards

---

<div class="post-metadata">

### Author: ![Davids-Music-Lab](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/davids-music-lab/32/512_2.png) [@Davids-Music-Lab](https://in-thread.sonic-pi.net/u/Davids-Music-Lab)
#### Post date: [November 5, 2023, 4:30pm UTC](https://in-thread.sonic-pi.net/t/are-the-samples-in-the-repo/8320/5 "2023-11-05T16:30:39Z")

</div>

The sample command simply starts playing at the time it is called, regardless of the sample BPM.  
You can make the samples loop precisely with the beat\_stretch parameter.

```ruby
loop do
  sample :loop_amen, beat_stretch: 4
  sleep 4
end

```
