Skip to content

Instantly share code, notes, and snippets.

@findscode
Created July 10, 2019 22:03
Show Gist options
  • Save findscode/a059ecb670fa21a6433b8a966b7385fa to your computer and use it in GitHub Desktop.
Save findscode/a059ecb670fa21a6433b8a966b7385fa to your computer and use it in GitHub Desktop.
Sonic Pi: function that helps with sample BPM counting
define :getBpm do |samp, beats|
t = sample_duration samp
bps = t/beats
beatsPerMin = 60/bps
return beatsPerMin
end
puts getBpm(:loop_amen, 4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment