TuningForkSamples

Sonic Pi's sample bank for TuningFork: 206 recordings, public domain, fetched from Sonic Pi's repository the first time each is played and kept under $XDG_CACHE_HOME/tuning_fork/samples.

{:tuning_fork, "~> 0.1"},
{:tuning_fork_samples, "~> 0.1"}

With this package started, every name in the bank plays wherever a drum name does:

s("bd_haus*4 elec_blip") # a Strudel pattern
part(bpm: 120, synth: Kit.voice("perc_bell", 1)) # a loop
sample :perc_bell, rate: 0.5 # the Sonic Pi vocabulary
TuningFork.Samples.load!(:ambi_choir) # the recording itself

Names

The names are Sonic Pi's. TuningFork.Samples.names/0 lists all 206; TuningFork.Samples.families/0 groups them by prefix:

FamilySome of them
bdbd_hausbd_808bd_fatbd_tekbd_zumbd_boom
snsn_dubsn_dolfsn_zomesn_generic
hathat_snaphat_zaphat_taphat_bduhat_metal
drumdrum_heavy_kickdrum_snare_harddrum_cymbal_closeddrum_cowbelldrum_roll
elecelec_blipelec_beepelec_pingelec_twangelec_bellelec_snare
percperc_bellperc_snapperc_swashperc_tillperc_door
ambiambi_choirambi_droneambi_pianoambi_lunar_landambi_glass_hum
bassbass_hit_cbass_hard_cbass_thick_cbass_trance_cbass_dnb_f
looploop_amenloop_amen_fullloop_breakbeatloop_industrialloop_garzul
tablatabla_ghe1tabla_natabla_tas1tabla_te1tabla_tun1
glitchglitch_bass_gglitch_perc_1glitch_robot_1
vinylvinyl_backspinvinyl_hissvinyl_rewindvinyl_scratch
guitguit_e_fifthsguit_e_slideguit_em9guit_harmonics
miscmisc_burpmisc_crowmisc_cineboom
mehackitmehackit_phone_1mehackit_robot_1
arovanearovane_beat_aarovane_beat_e
tbdtbd_pad_1tbd_perc_hattbd_highkey_c4tbd_fxbed_loop
rideride_triride_via

A pitched recording is played at its own speed unless the voice is told what note it is (Sample.load! takes a :root). A number after the name — bd_haus:2 — picks a file where a name holds several, and is the same recording where it holds one.

Loading

A recording is fetched on its first use and decoded from FLAC — TuningFork.Flac is pure Elixir — then kept in TuningFork.Sample.Bank. On a live stage a recording still on its way is silent for that hit and plays from the next; TuningFork.Samples.prefetch/0 fetches all 206 (34 MB) in the background beforehand, and a pattern or loop prefetches the names it is about to play. TuningFork.Samples.source/1 points the package at another directory of <name>.flac files, local or on the web, for a machine without access to GitHub.

Licence

Every recording is under Creative Commons Zero. priv/SOURCES.md is Sonic Pi's own list of where each came from on freesound.org, and of the sets donated by Uwe Zahn (Arovane) and The Black Dog. The collection itself is Sonic Pi's, by Sam Aaron and contributors, and this package would be nothing without it.