home/ atoms/ tidal-n-s-sample-selection

Separating s (sample folder) and n (index) in Tidal enables independent patterning of name and index

The sound parameter can be decomposed into s (sample folder name) and n (index within that folder). This separation allows independent patterning: d1 $ n "0 2 3" # s "arpy" plays arpy:0, arpy:2, arpy:3. Swapping the order changes which dimension provides rhythmic structure. Combining with run enables automatic traversal: d1 $ n (run 10) # s "drum arpy cp hh" maps sequential indices across four different sample folders. The samples function is an alternative: d1 $ sound $ samples "drum*4" (run 4) achieves the same. Indices wrap: if a folder has 5 samples, n=7 plays sample 2.

Examples

d1 $ n "0 2 3" # s "arpy"           // manual selection
d1 $ n (run 10) # s "drum arpy cp hh" // automatic run through 4 folders
d1 $ sound $ samples "drum*4" (run 4) // samples function equivalent

Assessment

Explain in words what d1 $ s "drum arpy cp hh" # n (run 10) produces vs d1 $ n (run 10) # s "drum arpy cp hh". Which dimension drives timing in each case?

“It's possible to break the sound parameter into two different patterns, namely s that gives the name of the sample set, and n which gives the index of the sample within that set.”
corpus · tidalcycles-userbase-tutorial-community-function-by-function · chunk 6