[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] HOA and Recording the B-format in SuperCollider



Hi Jay, thanks for your feedback, the error message is related to the DiskOut Ugen from SuperCollider and is not related to the HOA library.
I remember there were diskIO issues with SC in the past, I don't know if they have been resolved.

Florian


On Thu, Mar 14, 2019 at 3:10 PM <jay.afrisando@xxxxxxxxx> wrote:
Hi List,

I am learning the HOA library for SuperCollider (https://github.com/florian-grond/SC-HOA) and I have an issue with recording the b-format. Here is the full code from the Tutorial 08 - Recording the B-format within Proxyspace:

(
~order = 3;
~hoaNumChannels = (~order+1).pow(2);
s.scope(2); // let's use only two channels as we will monitor it with headphones
)

(
~hoaSignal = NodeProxy.new(s, \audio, ~hoaNumChannels);
~hoaSignal.source = {HOAEncoder.ar(~order, SoundIn.ar(0), // this picks up the Microphone
0,  // no azimuth movement
SinOsc.ar(0.3, 0, 90),  // changing elevation
plane_spherical:1,  // we want it to be a spherical wave
radius:SinOsc.ar(0.4, 0, 2, 2)  // and change the radius
)};

~hoaSignal.fadeTime = 1;
)

// Then we make a node that rotates this signal in the x/y plane.
// This is the node that we want to record from, that's why we use a RecNodeProxy:
// code::
(
~hoaTransformer = RecNodeProxy.new(s, \audio, ~hoaNumChannels);
~hoaTransformer.source = {
var in;
in = \in.ar(0!~hoaNumChannels);
HOATransRotateAz.ar(~order, in, SinOsc.ar(0.5, 0, pi ));
};
~hoaTransformer.fadeTime = 1;
)

HOADecLebedev26.loadHrirFilters(s);

(
~decoderOrder = 2; // let's reduce the order
~decoderNumChannels = (~decoderOrder+1).pow(2);

~decoder = NodeProxy.new(s, \audio, 2);
~decoder.source = {
var in;
in = \in.ar(0!~decoderNumChannels);
HOADecLebedev26.ar(~decoderOrder, in, hrir_Filters:1);
};
~decoder.fadeTime = 1;
~decoder.play(0, 2);

~hoaSignal <>> ~hoaTransformer <>> ~decoder;
)

~hoaTransformer.open(thisProcess.platform.userHomeDir++"/HOArecordingTest.wav", "wav", "float"); // lets record it in float
~hoaTransformer.record // start recording (paused)
~hoaTransformer.unpause // unpause
~hoaTransformer.pause // pause again
~hoaTransformer.close // close the file

~buffer2Normalize = Buffer.read(s, thisProcess.platform.userHomeDir++"/HOArecordingTest.wav");
~buffer2Normalize.normalize.write(thisProcess.platform.userHomeDir++"/HOArecordingTestN.wav", "wav", "int16"); // and safe it as "int16" to safe space

~hoaSoundFile = Buffer.read(s, thisProcess.platform.userHomeDir++"/HOArecordingTestN.wav");

(
~hoaSignal.source = { HPF.ar(PlayBuf.ar( ~hoaSoundFile.numChannels,  ~hoaSoundFile, loop:1  ), 100)   };
~hoaTransformer.source = {var in; in = \in.ar(0!~hoaNumChannels); in };
)

File.delete(thisProcess.platform.userHomeDir++"/HOArecordingTest.wav");
File.delete(thisProcess.platform.userHomeDir++"/HOArecordingTestN.wav");

When I evaluated this line below, there was an error:

~hoaTransformer.record // start recording (paused)

*** ERROR: SynthDef system_diskout_16.0 not found
FAILURE IN SERVER /s_new SynthDef not found

This error eventually does not enable me to record the b-format. How do you resolve this issue?

Thank you for your help.

Best,
Jay