Fwd: [sc-users] ATK Help Example -- confused

[email protected] Tue, 08 May 2018 18:05:55 +0000
Newsgroups gmane.comp.audio.supercollider.devel
Message-ID <CAAZLhTcvpqdng0sU6=221FtdtUiTHvV=s1_0v3y94y7XrBgvDg@mail.gmail.com>
Hello no c++

---------- Forwarded message ---------
From: <[email protected]>
Date: Tue, 8 May 2018 at 14:00
Subject: [sc-users] ATK Help Example -- confused
To: <[email protected]>


Here is the Post window output when I try a (slightly modified) version
of the ATK help example illustrating Transformation via Pink noise --
the source code follows below.

There is a similar example in the FoaDecode help examples that uses
global variables and no Synth that works without error.

This error message has shown up previously, back in 2012 but the poster
was developing a class and using Ndef for testing; here's the link:
http://sc-users.bham.ac.narkive.com/Xyi9zkrt/atk-problems-with-binaural-foadecoderkernel

I suspect it may be some sort of variable scope issue but I don't
understand why the variable initialized with FoaDecoderMatrix works
while it doesn't when initialized with FoaDecoderKernel. And why the
code decoderkernel version works when using global variables. (Although
there was a response having to do with which version of the server was
needed.)

Thanks for your help.        ...edN

//** Post Window output

Convolution2 arg: 'framesize' has bad input: nil
  ARGS:
    in: an OutputProxy OutputProxy
    kernel: 6 Integer
    trigger: 0 Integer
    framesize: nil Nil
Convolution2 arg: 'framesize' has bad input: nil
  ARGS:
    in: an OutputProxy OutputProxy
    kernel: 7 Integer
    trigger: 0 Integer
    framesize: nil Nil
Convolution2 arg: 'framesize' has bad input: nil
  ARGS:
    in: an OutputProxy OutputProxy
    kernel: 8 Integer
    trigger: 0 Integer
    framesize: nil Nil
Convolution2 arg: 'framesize' has bad input: nil
  ARGS:
    in: an OutputProxy OutputProxy
    kernel: 9 Integer
    trigger: 0 Integer
    framesize: nil Nil
Convolution2 arg: 'framesize' has bad input: nil
  ARGS:
    in: an OutputProxy OutputProxy
    kernel: 10 Integer
    trigger: 0 Integer
    framesize: nil Nil
Convolution2 arg: 'framesize' has bad input: nil
  ARGS:
    in: an OutputProxy OutputProxy
    kernel: 11 Integer
    trigger: 0 Integer
    framesize: nil Nil
SynthDef foaEncode2 build failed
ERROR: Convolution2 arg: 'framesize' has bad input: nil

PROTECTED CALL STACK:
        SynthDef:checkInputs    0x11a07f9c0
                arg this = a SynthDef
                var firstErr = Convolution2 arg: 'framesize' has bad input:
nil
        SynthDef:finishBuild    0x11a0797c0
                arg this = a SynthDef
        a FunctionDef   0x11a06c600
                sourceCode = "<an open Function>"
        Function:prTry  0x117b73380
                arg this = a Function
                var result = nil
                var thread = a Thread
                var next = nil
                var wasInProtectedFunc = false

CALL STACK:
        Exception:reportError
                arg this = <instance of Error>
        Nil:handleError
                arg this = nil
                arg error = <instance of Error>
        Thread:handleError
                arg this = <instance of Thread>
                arg error = <instance of Error>
        Object:throw
                arg this = <instance of Error>
        Function:protect
                arg this = <instance of Function>
                arg handler = <instance of Function>
                var result = <instance of Error>
        SynthDef:build
                arg this = <instance of SynthDef>
                arg ugenGraphFunc = <instance of Function>
                arg rates = nil
                arg prependArgs = nil
        < closed FunctionDef >
                var decoder = <instance of FoaDecoderKernel>
                var encoder = <instance of FoaEncoderMatrix>
        Interpreter:interpretPrintCmdLine
                arg this = <instance of Interpreter>
                var res = nil
                var func = <instance of Function>
                var code = "(
var decoder, encoder;
// F..."
                var doc = nil
                var ideClass = <instance of Meta_ScIDE>
        Process:interpretPrintCmdLine
                arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Convolution2 arg: 'framesize'
has bad input: nil
Kernel UHJ_W.wav, channel 0 loaded.
Kernel UHJ_W.wav, channel 1 loaded.
Kernel UHJ_X.wav, channel 0 loaded.
Kernel UHJ_X.wav, channel 1 loaded.
Kernel UHJ_Y.wav, channel 0 loaded.
Kernel UHJ_Y.wav, channel 1 loaded.

*******//

//** Source code -- moded to substitute UHJ decoder kernel for decoder
matrix newStereo

(
var decoder, encoder;
// First we will define our decoder and encoder
// stereo decoder
// decoder = FoaDecoderMatrix.newStereo((131/2).degrad, 0.5);
decoder = FoaDecoderKernel.newUHJ;                         // UHJ (kernel)

// a matrix for an omni image
encoder = FoaEncoderMatrix.newOmni;

// define a synth using FoaEncode and FoaDecode
SynthDef(\foaEncode2, {
     var src, angle, azim, foa, out;

     // our source:  Pink Noise (could be any mono signal)
     src = PinkNoise.ar(-6.dbamp);


     // for the 'push' transform later
     // see FoaPush help for details
     // angle ---> top           = push to plane wave
     //            bottom        = omni-directional
     angle = MouseY.kr(pi/2, 0);


     // for 'rotate' transform
     // azimuth -> hard left     = back
     //            centre        = centre
     //            hard right    = back
     azim = MouseX.kr(pi, -pi);


     // Encode into our foa signal
     foa = FoaEncode.ar(src, encoder);


     // push transform using angle
     foa = FoaTransform.ar(foa, 'pushX', angle);

     // rotate transform using azim
     foa = FoaTransform.ar(foa, 'rotate', azim);


     // decode our signal
     out = FoaDecode.ar(foa, decoder);


      Out.ar(0, out);
}).add;

)

// play the synth
a = Synth(\foaEncode2);

// free the synth
a.free;

*******//

_______________________________________________
sc-users mailing list

info (subscription, etc.):
http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/