HOA Tutorial Exercise 12:
Filter:
Tutorials (extension) | Libraries > HOA

HOA Tutorial Exercise 12
ExtensionExtension

NRT synthesis, working with SynthDefs.

Previous: HOA Tutorial Exercise 11

Next: HOA Tutorial Exercise 13

The code below is a non-real-time (NRT) script showing how to work with SynthDefs and the Score class for complex algorithmic compositions. The examples are adapted from the NRT example of the ATK toolkit.

First things first: let's start the sound server, which we configure first to get more audio buses and to have 36 output channels.

Start the oscilloscope showing all the channels for the selected order of the b-format.

We will first make a SynthDef with a very simple sine grain distributed in th HOA scene. There is one caveat, since the HOAEncPan is a pseudo Ugen you cannot set the HOA order as a parameter in a SynthDef. There are two possible workarounds to keep your code flexible: you can change the order and recompile, or in the case of NRT you can render in the maximum order (5 for now in this library) and later extract only the channels from the rendered file for the order you actually need.

Now you can play the Synth, but you won't hear a properly decoded sound but only the W and the Y channel in the stereo panorama:

So let's make decoder, that is playing the decoded signal on the first 2 channels (0,1) and is listening on channel (2,3,4,5) for a b-format:

And in order to properly decode the Synth, we need to play it before the ~decoderSynth:

Then we make a Score and we add to the Score OSC messages invoking the SynthDef we have made earlier.

Now we can start the NRT synthesis. We will configure the ServerOptions for the NRT server first. We render the file as float and normalize it once it is written to disk.

Now let's listen to the recorded sound file by opening it first:

Now let's make a node that plays back the mukltichannel soundfile as a HOA signal

If the ~decoder from above is still there, let's connect (<>>) both:

Finally, we can delete the files:

Previous: HOA Tutorial Exercise 11

Next: HOA Tutorial Exercise 13