# S there a way to turn regular one note(external samples) to synths in sonic pi

**URL:** https://in-thread.sonic-pi.net/t/s-there-a-way-to-turn-regular-one-note-external-samples-to-synths-in-sonic-pi/9091
**Category:** Support, Help & Resources
**Created:** [July 31, 2024, 8:40pm UTC](https://in-thread.sonic-pi.net/t/s-there-a-way-to-turn-regular-one-note-external-samples-to-synths-in-sonic-pi/9091 "2024-07-31T20:40:39Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Prod.Distinguish](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@Prod.Distinguish](https://in-thread.sonic-pi.net/u/Prod.Distinguish)
#### Post date: [July 31, 2024, 8:40pm UTC](https://in-thread.sonic-pi.net/t/s-there-a-way-to-turn-regular-one-note-external-samples-to-synths-in-sonic-pi/9091/1 "2024-07-31T20:40:39Z")

</div>

Is there a way to turn regular one note(external samples) to synths in sonic pi, or at least, be able to change the notes and make a basic melody using this sample without having to change pitch using numerical values?i saw the bach example in the help section, is there a way to compose(or arrange) like that using an external one note sample?  
please let me know, thanks.

---

<div class="post-metadata">

### Author: ![brendanmac](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/brendanmac/32/2809_2.png) [@brendanmac](https://in-thread.sonic-pi.net/u/brendanmac)
#### Post date: [August 1, 2024, 5:46am UTC](https://in-thread.sonic-pi.net/t/s-there-a-way-to-turn-regular-one-note-external-samples-to-synths-in-sonic-pi/9091/2 "2024-08-01T05:46:00Z")

</div>

Hi  
it depends on whether you have a collection of samples across a range of pitches, or just one sample that you need to play at different rates/speed to repitch it.

You’ll find an example of a simple solution here:

> [@How to make chord progressions in Sonic-Pi with Guitar wav files](https://in-thread.sonic-pi.net/t/how-to-make-chord-progressions-in-sonic-pi-with-guitar-wav-files/9060/3):
>
> I thought I have a go myself. This is a fairly brute-force, lazy Saturday morning version. You’ll have to organise the progression and voicings yourself. But if, like me, you are lazy, the rpitch: opt for sample playback works surprisingly well on those samples; for example rpitch -5 will give you a G major chord, with an authentic (guitaristic) voicing. PD-Pi [edit] In fact, using rpitch: you can create several chords, either major or minor, from only on…

In my example, I repitch a single sample, but it seems you do not want to do that. In that case, each pitched playback will need to be a different sample, as I think you are asking for.

PD-Pi

---

<div class="post-metadata">

### Author: ![Prod.Distinguish](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@Prod.Distinguish](https://in-thread.sonic-pi.net/u/Prod.Distinguish)
#### Post date: [August 1, 2024, 3:06pm UTC](https://in-thread.sonic-pi.net/t/s-there-a-way-to-turn-regular-one-note-external-samples-to-synths-in-sonic-pi/9091/3 "2024-08-01T15:06:12Z")

</div>

thank you so much, brendanmac

---

<div class="post-metadata">

### Author: ![brendanmac](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/brendanmac/32/2809_2.png) [@brendanmac](https://in-thread.sonic-pi.net/u/brendanmac)
#### Post date: [August 1, 2024, 4:20pm UTC](https://in-thread.sonic-pi.net/t/s-there-a-way-to-turn-regular-one-note-external-samples-to-synths-in-sonic-pi/9091/4 "2024-08-01T16:20:45Z")

</div>

Just to clarify - at the risk of condescending - your 2 main simple options are (in pseudo code):

sample nameOf1stSample  
sleep n  
sample nameOf2ndSample  
sleep n  
…

or

loop:  
sample nameOfOneSample rate[1, 0.5, 0.75, 0.333].look

But your OP states that you don’t want to “change pitch using numerical values”, so option 2 is not the answer 😉 The only way to change the perceived pitch of a _single_ digital sample is to change its playback rate. Or use granular playback, or some other form of modulation synthesis, which all involve numerical values.

HTH

PD-Pi

---

<div class="post-metadata">

### Author: ![Prod.Distinguish](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@Prod.Distinguish](https://in-thread.sonic-pi.net/u/Prod.Distinguish)
#### Post date: [August 2, 2024, 10:41am UTC](https://in-thread.sonic-pi.net/t/s-there-a-way-to-turn-regular-one-note-external-samples-to-synths-in-sonic-pi/9091/5 "2024-08-02T10:41:20Z")

</div>

its not really about the number though…

the problem im having is not being able to efficiently make compositions using samples(at least i dont know how to)

one of the examples in the sonic pi app shows a bach piece composed using beeps,

i was wondering if there is a way to compose with samples using play\_pattern\_timed [note, note, note], [rest time]?

I wanted to see if i could make movie compositions on sonic pi, although vst is not supported for high quality sounds.

---

<div class="post-metadata">

### Author: ![brendanmac](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/brendanmac/32/2809_2.png) [@brendanmac](https://in-thread.sonic-pi.net/u/brendanmac)
#### Post date: [August 2, 2024, 12:04pm UTC](https://in-thread.sonic-pi.net/t/s-there-a-way-to-turn-regular-one-note-external-samples-to-synths-in-sonic-pi/9091/6 "2024-08-02T12:04:00Z")

</div>

I see. I had thought that you were hinting at some type of VST support or functionality, to compose/perform using a sampler, in the more familiar DAW model. So the answer to your central question is yes you can - kind of. But the composition and performance model is slightly different to the more common DAW model (add a midi track, drop a sampler on the track, play notes). In Sonic Pi - afaik - you can’t combine sample playback with the play\_pattern\_timed function, but you can do it yourself.

The play function is for triggering Sonic Pi’s _internal_ synths, as is play\_pattern\_timed, but they both work in essentially the same way - a list of pitches and a companion list of sleep values. Therefore, to use the sample function in Sonic Pi would just mean that you would have ‘roll your own’ version of play\_pattern\_timed; there is currently no such function as sample\_pattern\_timed 😉 .

If you prefer to use an external DAW or synth, MIDI is very well implemented and supported in Sonic Pi, you can find _lots_ of examples and tutorials on sending MIDI to another software/hardware synth in this forum, within the Sonic Pi tutorial (see 11.2), and on youtube.

I’m afraid I make almost no use of midi out functionality (currently) in Sonic Pi, so apologies if any of the foregoing contains minor errata.

Anyway, this is how I would compose a melody using a sample, solely within Sonic Pi:

```ruby
define :sampla do |trsp|
  sample :guit_harmonics, onset: 6, rpitch: trsp
end

/'roll your own' play_pattern_timed/
8.times do
  tick
  sampla [0,-12].look
  sampla [0,2,4,5,7,9,11,12].look
  sleep [0.5, 1].look
end

```

PD-Pi

---

<div class="post-metadata">

### Author: ![Prod.Distinguish](https://avatars.discourse-cdn.com/v4/letter/p/ba9def/32.png) [@Prod.Distinguish](https://in-thread.sonic-pi.net/u/Prod.Distinguish)
#### Post date: [August 2, 2024, 12:47pm UTC](https://in-thread.sonic-pi.net/t/s-there-a-way-to-turn-regular-one-note-external-samples-to-synths-in-sonic-pi/9091/7 "2024-08-02T12:47:46Z")

</div>

thank you so much, PD-Pi, This is what i was looking for.
