/ Examples / Utility / SampleMgr

Projects .. AudioIO .. Control
NoteStreams .. Instruments
Filters .. Effects .. LiCK Effects
Plot .. Utility .. Pure ChucK


SampleMgr Node

The SampleMgr utility node manages audio sample files and supports the lazy-downloading of sample files from internet-hosted sample bank repositories. The SampleMgr node is required by Tidal and SampleInst and supported by a growing list Fiddle nodes.

The basic idea is to associate a client's semantic instrument name, eg piano, with a concrete collection of sample files.

Sample files are divided into three categories according to the strategy employed for finding and managing them.

Samples are internet-hosted sample files that are defined by the combination of Banklist and TOC files. These JSON files register bank names, bank contents and URLs for every sample file available for automatic management.

URLs is used to manually associate individual internet sample files with a semantic name and base note.

Files is used to manually associate local sample files with a semantic name and base note.

The base note is used to re-pitch notes by altering the sample playback rate according to its distance from a target note. For example, apiano sample bank may contain a dozen or so representative notes across the piano's range. We use these samples to produce nearby notes by re-pitching them.

Having built up associations between semantic names, aka Refs, the SampleMgr can be relied upon by its downstream nodes to convert a ref to a filename. When not present in your local samplefile cache, SampleMgr will attempt to download sample files before your performance can begin. Once a sample file is present in the cache, it can be played instantly with no download delays.

Here is a typical download notification that might appear in the Log.

12:17 note [chuck] DbSampleMgr/0: cached https://raw.githubusercontent.com/ritchse/tidal-drum-machines/main/machines/RolandTR808/rolandtr808-sd/SD7575.WAV

Depending on your SampleMgr configuration and the state of your local cache you may see 10s or 100s of these log messages and the initial startup time of your project may require seconds or minutes to sort things out.

Default Sample Banks

Fiddle ships with a set of defaults that should get you going immediately. The factory-default files are copied automatically into your Workspace and may be auto-updated with each release. These are default settings that you can easily augment or replace. We recommend that you make alterations in a copy of these files and not to the factory files. Then make sure to update your Banklist parameter described below.

You can find the default sample banks here and a simple TOC file here. Of particular note are the large banks:

Dirt - grab-bag of live-coding sounds from the TidalCycles collection (.wav).

DrumKits - large collection of drum machines found here (.wav).

VCSL - nice collection of miscellaneous and exotic instruments found here (.wav).

midi-js-soundfonts - Three General MIDI sound fonts broken out into .mp3 files found here.

Parameters

Samples depend entirely on the banks and voices defined in your Banklist file. This is the most powerful representation because we have entire contents lists (TOC-files) for each bank and each voice can contain note-specific or indexed voice variants. At right you can see that we've registered interest in 9 of the voices of the VCSL bank. Keep in mind that by registering interest in these voices, SampleMgr will ensure that they reside in your local cache when you initiate your performance. You can load all voices of bank (tread carefully) by entering * for the voice. When doing so, there is no single reference that makes sense for a reference. Thus, you should enter * in the reference field as well. Now your references are contrained to the voice names within a sample bank. For example, you can load all the voices in of EmuSP12 from the DrumKits multi-bank.

URLs bypass the banklist and allow you to enter the URLs to internet sample files directly. Note in the screengrab below that we are required to assign a basenote to each sample to facilitate repitching. For percussion sounds you may not require re-pitching and so this value is of no consequence.

Files is the sibling of URLs but supports local filenames of your favorite samples. Like URLs, Files bypasses the banklist and requires both Ref and Note fields. You can drag-drop sample files from the Workspace panel into the filename fields.

Banklist is the name of a banklist file for resolving all the Sample references as discussed above. The default banklist, _cache/_fiddleBanks/banklist.json, is installed when you launch Fiddle and may be updated with Fiddle updates. You are free to modify it, but beware that your changes might be stomped on by newer versions. For this reason, we recommend that you make changed into your own banklist file and store it outside the _cache subdirectory. Make sure to update this in every SampleMgr node as well.

Cachedir is the name of your _cache directory into which to place auto-populated sample files. The default of _cache is Workspace-relative. If you want to use an external drive or alternate location enter its full pathname here. Make sure to update this in every SampleMgr node as well.

Examples

See SampleInst or Tidal.

home .. topics .. interface .. reference .. examples .. tipjar