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.5gig) 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 ~5gig 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 sc. 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);