Sample "drum" "hard" - options to filter on strings ( lambda / regex ?)

I’ve been looking at the examples for sample and tried a couple of things to pick with
multiple criteria.

This may be possible with lambda, regex, and more methods (string concat?) but so far nothing I’ve tried works.

Assuming this is possible, what options are there?

Got as far as making a lambda before I saw the answer right at the top.

  1. Lists of the above - [“/foo/bar”, “baz”, /0-9.*/] - will recurse down and work through the internal filter parameters as if they were in the top level.

sample ["drum_","hard"]

cool!

This is nice. Had a play and came up with this:

live_loop :dr do
  density dice(2) do
    sample ["drum_",tick],sustain:0,release: 0.5,pan:0.2* (-1)**dice(2)
    sleep 0.5
  end
end
live_loop :ht do
  density dice(2) do
    sample ["hat_",tick],sustain:0,release: 0.25,pan:0.4*(-1)**dice(2)
    sleep 0.25
  end
end
3 Likes