Rudimentary Issue

Hi,
I’m trying these Granular examples from Eli Fieldsteel’s book.
When I replace Platform.resourceDir ++"/sounds/a11wlk01.wav" with my own little stereo sample everything works except I cannot hear anything with my sample. No error.
Is this just a matter of the wrong type of source material? It seems as if it should work because the sample starts immediately and is not quiet or very large. I tried a couple of different samples and changing the number of channels which should all be stereo anyway. Thanks.

thisProcess.recompile;
s.boot;

b = Buffer.read(s, Platform.resourceDir ++"/sounds/a11wlk01.wav");

(
{
	 GrainBuf.ar(
		numChannels: 2,
		trigger: Impulse.kr(4),
		dur:0.05,
		sndbuf: b,
		rate: 5.midiratio,
		pos: Line.kr(0, 1, BufDur.ir(b))
	);
}.play;
)

(
var env = Env.new([0, 1, 0], [0.01, 1], [0 -4]);
~grainenv = Buffer.loadCollection(s, env.discretize(8192));
)

(
{
	 GrainBuf.ar(
		 numChannels: 2,
		 trigger: Impulse.kr(8),
		 dur: 0.05,
		 sndbuf: b,
		 rate: 7.midiratio,
		 pos: Line.kr(0, 1, BufDur.ir(b)),
		 interp: 2,
		 pan: LFNoise1.kr(10),
		 envbufnum: ~grainenv
	);
}.play;
)

a11wlk01.wav is actually a mono file, perhaps that’s the issue?

b = Buffer.read(s, Platform.resourceDir ++"/sounds/a11wlk01.wav");
b.numChannels; // posts 1

Best,
Paul

Thanks. I did try to switch numChannels so that doesn’t seem to be why I’m having the issue.
Is it possibly a SC for Windows issue?
When I run these examples with the default sample the post window shows this:

-> Synth('temp__0' : 1000)
-> Buffer(1, nil, nil, nil, C:\Users\me\AppData\Local\SuperCollider\-1233695953)
-> Synth('temp__1' : 1001)

This works fine.

When I modify the patch like this:

b = Buffer.read(s, "C:/Users/me/Desktop/Dsk/Samples/Nueva carpeta/Track54.wav");

The post window shows this weirdness with the slashes and no sound outputs:

-> Buffer(0, nil, nil, nil, C:/Users/me/Desktop/Dsk/Samples/Nueva carpeta/Track54.wav)
-> Synth('temp__0' : 1000)
-> Buffer(1, nil, nil, nil, C:\Users\me\AppData\Local\SuperCollider\1792638017)
-> Synth('temp__1' : 1001)

I’m just dragging the sample over so I’m not typing the slashes.

Did you try it using a mono sample instead?

I’ve just found the issue: GrainBuf expects the sample file to be mono - see the help file.
Best,
Paul

Edit: The numChannels argument for GrainBuf only sets how many channels will be output - it is not referring to the number of channels in the sample buffer.

Okay. thanks a lot!
I should have read more carefully above that example. It says to paraphrase: that numChannels refers to the output rather than the input channels which must always be one.

I was certain it was the backslashes:)