Fidelity vs. BPM

Is there a optimum bpm / sleep for a given tempo ?
( considering getting the cleanest possible output signal )

Say bpm_60 … sleep … 0.125 ( with attendant release et. al. )
vs
bpm_120 … sleep … 0.25
vs
bpm_240 … sleep … 0.50

ETC … Sometimes I get a hint of static , and would
like to declude it as much as possible …

Hi, apologies but I’m not quite sure what the question is here.

Firstly, tempo and bpm are equivalent concepts. They can both be adjusted for Sonic Pi either by calls to use_bpm or by modifying the Link Metronome.

Changing the BPM/tempo will change the duration of sleep times as the units of sleep are beats. At a BPM/tempo of 60 beats per minute a call to sleep 1 will sleep for 1 second. At a BPM/tempo of 120 beats per. minute a call to sleep 1 will sleep for 0.5 seconds.

It is usually common to work with inverse powers of 2 for sleep times for western music: 1, 0.5, 0.25, 0.125… etc.

When you say “hint of static” what do you mean? Can you share some code that exhibits this behaviour?

As usual , when one wants a flaw , it ’ s hard to find …
Closest I come to here is a little ’ pop ’ with PLUCK ,
but the settings may be able to cure that …
( I have never tried adjustment other than release and volume )

scale=[24,27,30,32,36,40,45,48]
tempo=[15,30,60,120,240,480]
sleep=[0.125,0.25,0.50,1.00,2.00,4.00]
synth=[:beep,:pretty_bell,:fm,:pluck,:blade]

for c in 0..4
  use_synth synth[c]
  for x in 0..5
    puts synth[c],tempo[x],sleep[x]
    use_bpm tempo[x]
    for y in 0..7
      play hz_to_midi(5.5*scale[y]), release: sleep[x]
      sleep sleep[x]
end; end; end