# `TuningFork.Sample.Set`
[🔗](https://github.com/jaman/tuning_fork/blob/v0.1.11/tuning_fork/lib/tuning_fork/sample/set.ex#L1)

A set of named recordings described by a `strudel.json`, registered with
`TuningFork.Sample.Bank`.

    TuningFork.Sample.Set.load("github:eddyflux/crate")

# `aliases`

```elixir
@spec aliases(%{required(String.t()) =&gt; String.t()}) :: :ok
```

Give every registered `Machine_sound` a second name `alias_sound`, from a map of machine
names to aliases as Strudel's `tidal-drum-machines-alias.json` has it.

# `background`

```elixir
@spec background([{String.t() | map(), keyword()}], (-&gt; term())) :: :ok
```

Load several sets one after another in the background and return at once, calling `done`
when every one has been tried. Each is `{source, opts}` as `load/2` takes them, plus
`:alias`: the URL or path of an alias map to apply with `aliases/1` after that set. No file
is prefetched. A list already being loaded is not started again.

# `load`

```elixir
@spec load(String.t() | map(), keyword()) :: {:ok, [String.t()]} | {:error, term()}
```

Register every name in a sample set.

`source` is `"github:user/repo"` (branch `main`) or `"github:user/repo/branch"`, the URL or
local path of a `strudel.json`, or the decoded map itself. In the map, `"_base"` is put in
front of every relative file, and each other key is a name holding one file or a list of
them. Files are fetched on first use.

## Options

  * `:prefetch` — start fetching every file in the background, default `true`
  * `:only` — register only these names, default all of them

Returns `{:ok, names}` or `{:error, reason}`.

# `load_all`

```elixir
@spec load_all([{String.t() | map(), keyword()}], (-&gt; term())) :: :ok
```

Load several sets as `background/2` does, returning once every one has been tried — or,
when the same list is already loading in the background, once that has finished.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
