Server-side audio channel reverse

Dear users,

How do you swap audio channels on the server?
The code block below is my version to do it, but I am unsure if the algorism is good enough.
Could I get some advice?

I appreciate any help you can provide.


~test = { |buf, lev=1, rate=1, start=0, dur=1, pan=0, swap=0, loop=0|
	var env, sig;
	rate = rate *;
	start = start *;
	env =[0, 1, 1, 0], [0.02, dur - 0.04, 0.02]), doneAction: Done.freeSelf);
	sig =, buf, rate, 1, start, loop) * env;
	sig =, [sig, [sig[1], sig[0]]]);[0], sig[1], pan, lev)

b =, Platform.resourceDir +/+ "sounds/SinedPink.aif")[buf: b, swap: 0, loop:1])[buf: b, swap: 1, loop:1])

Your code looks good enough in this case.
Working mainly with quadraphonic configuration, I manage by assigning buses to global variables, thus it is easy to redirect them (but it is client-side).
See also this thread Is it possible for to output to non-contiguous outputs

1 Like