home/ atoms/ external-sample-loading

Sonic Pi plays external audio files by passing a file path string to sample

Any WAV, AIFF, or FLAC file can be triggered with sample “/path/to/file.wav”. All standard opts (rate:, amp:, start:, finish:, envelope opts) work identically to built-in samples. Using external samples breaks code portability — the file must be present on the playback machine — unlike code that only uses built-in samples, which can be emailed and run anywhere.

Examples

sample “/Users/sam/Desktop/kick.wav”, rate: 0.5, amp: 0.8

Assessment

Explain why a track using external samples cannot be shared as code alone. Propose a workaround.

“you start using your own pre-recorded samples, you lose this portability”
corpus · sonic-pi-built-in-tutorial · chunk 8