Do you mean something like this?
#using sample :ambi_choir to accompany a tune
define :plAmbiChoir do |n,nt,sr|
#use :rpitch to calculate pitch for required note frequency
#Natural note is 75.2 found by experiment comparing
#play 75.2 and sample :ambi_choir sounds
sample :ambi_choir,rpitch: note(n)-75.2,sustain: nt*sr,release: nt*(1-sr),amp: 2
live_loop :test do
#test live loops plays notes from scale accompanied by pitched sample :ambi_choir
#nTime adjusts time between notes
#srRatio adjusts % sustain and release times: eg 1 gives all sustain 0 release
#0.5 gives equal sustain and release times
#note you are restricted by duration of sample :ambi_choir (about 1.57s)
#this duration will reduce when pitch is raised
play n,sustain: nTime*srRatio,release: nTime*(1-srRatio),amp: 0.5
The sample this technique works best with is :ambi_glass_rub (which normally sounds as :Fs5) I first used it back in 2014 with a much earlier version of Sonic Pi before the :rpitch parameter was added to produce some Mozart.
I have edited the file to use :rpitch now and you can try it from here
(Copy and paste into Sonic Pi).