Sample mapping in TidalCycles similar to Strudel's samples({}) feature?

Hi everyone,

First of all, thanks to all contributors for the incredible work on TidalCycles and this community, it’s an inspiring tool and ecosystem to be part of.

While experimenting with Strudel, I find a very convenient feature that allows you to define a sample map (like in a sample player) and then trigger samples by note names. Here’s a minimal example in Strudel:

samples({
  'moog': {
    'g2': 'moog/004_Mighty%20Moog%20G2.wav',
    'g3': 'moog/005_Mighty%20Moog%20G3.wav',
    'g4': 'moog/006_Mighty%20Moog%20G4.wav',
  }
}, 'github:tidalcycles/dirt-samples')

note("g2!2 <bb2 c3>!2, <c4@3 [<eb4 bb3> g4 f4]>")
  .s('moog')
  .clip(1)
  .gain(.5)

In Strudel, this lets me treat a folder of samples as a multi-sample instrument, mapped to specific note names.

My questions are:

Is there any similar functionality in TidalCycles to create such a note-to-sample map?

In Strudel, is the same mapping mechanism used internally for the default sound("piano") (which I understand is based on the VSCO library), or is this mapping embedded in the code?

Has anyone experimented with using a SynthDef in SuperCollider that can load SFZ files, so that Tidal could trigger fully mapped virtual instruments this way?

Thanks for any insights or pointers!

I know you can have a folder of pitched samples (usually starting from c) and interact with that using eg n “c'min”instead of note “c'min”

The downside is your pitched samples need sequential notes from the 12 tone scale, including up to at least as many as your pitch usage requires.

I’m not aware of a similar pitch defining function for samples Ala the strudel example

Thanks, cleary! I honestly dream of a SynthDef that would automatically handle all the mapping work, including release layers, and could be fully controlled from TidalCycles, even with parameters like velocity, sustain, release, etc. Based on those, it would choose one sample or another.

It’s quite possible that with my clumsy ear I wouldn’t even notice the difference compared to just cranking up the gain and pitch-shifting a single sample across the whole keyboard, haha. But still, that’s my dream!

I’ve noted down this reference to an SFZ reader for SuperCollider GitHub - shimpe/sfz: sfz reader for supercollider — maybe one day I’ll have the courage to take a look and see if it could be used to build a SynthDef compatible with Tidal.