Skip to content

Commit

Permalink
ATK: Update Help with Server -numOutputBusChannels advice
Browse files Browse the repository at this point in the history
s.options.numOutputBusChannels defaults to 2 in SC >= 3.7.0

Includes contributions by @dmartinp & @joslloand
  • Loading branch information
joslloand committed Jul 13, 2016
1 parent 57ce2d4 commit 72bbffd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
15 changes: 15 additions & 0 deletions source/ATK/sc/HelpSource/Classes/FoaDecode.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ Encoded as an omnidirectional soundfield, link::Classes/PinkNoise:: is used as t

The soundfield is controlled by link::Classes/MouseX:: and link::Classes/MouseY::, where link::Classes/MouseX:: specifies the incident azimuth angle (pi to -pi; left to right of display) and link::Classes/MouseY:: the link::Classes/FoaPush:: angle (0 to pi/2; bottom to top of display). With the mouse at the bottom of the display, the soundfield remains omnidirectional. Placed at the top of the display, the soundfield becomes directional, and varying left/right position will vary the incident azimuth of the resulting planewave.

Before exploring the examples below, it is suggested you confirm your
link::Classes/Server:: has enough output channels to support your chosen
decoder. You can query the server:

code::
myServer.options.numOutputBusChannels
::

An example link::Classes/Function::, code:: ~checkMyServerOutputs::, can
be found link::Guides/Intro-to-the-ATK#Choose a decoder#here::.
code:: ~checkMyServerOutputs:: throws a warning if
code::myServer.options.numOutputBusChannels < myDecoder.numOutputs::. If you
need to update your link::Classes/Server::'s number of output bus channels,
review the example found link::Classes/ServerOptions#examples#here::.


subsection:: Virtual microphone stereo decoder

Expand Down
25 changes: 22 additions & 3 deletions source/ATK/sc/HelpSource/Guides/Intro-to-the-ATK.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,32 @@ note:: If you choose a kernel decoder, link::Classes/FoaDecoderKernel::, be sure

code::
// ------------------------------------------------------------
// switch to internal server, and boot
// boot server
(
s = Server.internal;
Server.default = s;
s = Server.default;
s.boot;
)


// ------------------------------------------------------------
// define convenience function to verify number of server outputs
(
~checkMyServerOutputs = { arg server, decoder;
server.serverRunning.if({
(decoder.numOutputs > server.options.numOutputBusChannels).if({
"Number of Server output bus channels is less than number required by Decoder!".warn;
"Server Outputs: %\n".postf(server.options.numOutputBusChannels);
"Decoder Outputs: %\n\n".postf(decoder.numOutputs);
"Update number of Server outputs as illustrated here: ".post;
"http://doc.sccode.org/Classes/ServerOptions.html#examples".postln;
}, {
"Server has an adequate number of output bus channels for use with this Decoder!".postln;
})
})
}
)


// ------------------------------------------------------------
// choose a decoder

Expand Down Expand Up @@ -190,6 +208,7 @@ code::

// inspect
~decoder.kind
~checkMyServerOutputs.value(s, ~decoder)


// ------------------------------------------------------------
Expand Down

0 comments on commit 72bbffd

Please sign in to comment.