For my work together with Mark d'Inverno I coded a few tools. One of the things that came up was a need for a neutral but nice sounding way to test aspects of our musical agents systems. So we got hold of a grand-piano sample library and i wrote a 'giga sampler' like class for SuperCollider. This allowed us to use this massive sample library (2.5Gb) and let the agents play high quality samples instead of cheap MIDI or boring synthesised sounds. So for testing melodies, harmonies and such this was a good thing.
The trick with the giga sampler is that it preloads a bit from each soundfile into RAM memory and then streams the rest from disk when needed. Or at least this is how I understands it. So using this technique, one can get quick access to a lot more samples than normally would fit in the memory of a sampler. A massive library like ours with full 88keys range, sampled in many different velocities, would occupy ~5Gb of RAM (SuperCollider uses 32bit internally), nor could it be streamed from disk (the harddrive would be too slow to access and load the headers to play fast chords progressions without staggering etc).
I spent some time to make my class all round useful and it can be downloaded here or simply install by typing
Quarks.install("redSampler") in SuperCollider. The class of interest in that package is called
And here is some testcode for it...
d= (); /*for mapping midinote to filename*/
r= RedDiskInSamplerGiga(s); /*sampler*/
var folder= "/Users/asdf/Documents/soundfiles/bosen44100/"; //edit to match your samplebank
var velocities= #[40, 96]; /*velocities to load*/
var octavesToLoad= #[2, 3]; /*how many octaves to load*/
var scale= #['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B'];
/*so number of samples to load is octavesToLoad.size*12*velocities.size*/
/*lowest note C2= midi 36*/
var tempDict= ();
var midinote, pathname, key;
tempDict.put(midinote, key); /*like (45 : A2_96)*/
("loading key"+key+"from file"+pathname).postln;
r.play(\C2_96, 0, 3, 1)
r.play(\D2_40, 0, 3, 1)
r.play(a.choose, 0, 0.45, 0.1);
r.play(x, 0, 0.35, 0.1);
r.play(x, 0, 0.25, 0.08, amp: 0.6);