How to read in a Full Directory / Folder of Sounds

Dear Community,
I need Help:
I need to read in - in Buffers a Whole Folder of WAV Files.
So what I have is:

ff = SoundFile.collect("/home/crecothomaslahme/MySamples/*").do { |f| f.path.postln; };

And a easy Synth:

(
SynthDef(“help-synth”, {| bufnum, out = 0 |
// Out.ar(out, Mix(SinOsc.ar(freq, 0, 0.1)));
var sig = VDiskIn.ar(2, bufnum, BufRateScale.kr(bufnum));

Out.ar(out, sig);

}).add;
)

// then this a short while later
x = Synth(“help-synth”, [bufnum: ~buf[1] ]);

So the Problem is to become the Files which read from SoundFile.collect in to Buffers, so that I have the bufnum to Play this Files in my Synth.

A full Confused

CreCo

Have you tried the very useful but undocumented method?

SoundFile.collectIntoBuffers(path: "sounds/*", server)

It should give you an array of Buffers that you can play with.

Ok, thanks it look like I needed

But now I have:

// Boot Server to get a clean System
s.boot

// Load a Full Directory to the Array at f[number]
// And PostLn the Pfads of the Sound Files
~buf = Array.new(9)

~ff = SoundFile.collectIntoBuffers("/home/crecothomaslahme/MySamples/*", s).do { |f| f.path.postln; };

(
SynthDef(“help-synth”, {| bufnum, out = 0 |
// Out.ar(out, Mix(SinOsc.ar(freq, 0, 0.1)));
var sig = VDiskIn.ar(2, bufnum, BufRateScale.kr(bufnum));

Out.ar(out, sig);

}).add;
)

// then this a short while later
x = Synth(“help-synth”, [bufnum: ~ff[1].bufnum ]);

And I here no Sound

Ok, a little bit to think.
It’s running by me with this:

// Boot Server to get a clean System
s.boot

// Load a Full Directory to the Array at f[number]
// And PostLn the Pfads of the Sound Files
~buf = Array.new(9)

~ff = SoundFile.collectIntoBuffers("/home/crecothomaslahme/MySamples/*", s).do { |f| f.path.postln; };

(
SynthDef(“help-synth”, {| bufnum, out = 0 |
// Out.ar(out, Mix(SinOsc.ar(freq, 0, 0.1)));
var sig = PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum));

Out.ar(out, sig);

}).add;
)

// then this a short while later
x = Synth(“help-synth”, [bufnum: ~ff[2].bufnum ]);

THANK YOU FOR THE HELP

A wonderful happy

CreCo