I was looking at NodeProxy roles documentation but the examples for \set
and \pset
throw an error.
s.boot;
a = NodeProxy(s);
a[0] = { |freq = 440, dt=0.1, rate=2| Ringz.ar(Impulse.ar(rate * [1, 1.2]), freq, dt)*0.1 };
a.play;
(
a[1] = \pset -> Pbind(
\dur, Prand([1, 0.5], inf),
\freq, Pwhite(200.0, 1000, inf).round(30),
\rate, Pdup(4, Prand([1, 3, 6, 10], inf)),
\dt, Pwhite(0.01, 0.1, inf) + 1
)
);
following is the post output when evaluating the preceding code:
-> NodeProxy.audio(localhost, 2)
ERROR: Primitive '_BasicNew' failed.
Index not an Integer
RECEIVER:
class Array (0x6237996dcfc0) {
instance variables [19]
name : Symbol 'Array'
nextclass : instance of Meta_Array2D (0x62379b78a880, size=19, set=5)
superclass : Symbol 'ArrayedCollection'
subclasses : nil
methods : instance of Array (0x62379b83fd80, size=53, set=6)
instVarNames : nil
classVarNames : nil
iprototype : nil
cprototype : nil
constNames : nil
constValues : nil
instanceFormat : Integer 1
instanceFlags : Integer 0
classIndex : Integer 1956
classFlags : Integer 3
maxSubclassIndex : Integer 1956
filenameSymbol : Symbol '/usr/share/SuperCollider/SCClassLibrary/Common/Collections/Array.sc'
charPos : Integer 0
classVarIndex : Integer 5
}
PROTECTED CALL STACK:
Meta_MethodError:new 0x62379a85cc40
arg this = PrimitiveFailedError
arg what = Index not an Integer
arg receiver = Array
Meta_PrimitiveFailedError:new 0x62379a864b00
arg this = PrimitiveFailedError
arg receiver = Array
Object:primitiveFailed 0x62379a28ac40
arg this = Array
Object:dup 0x62379a24bcc0
arg this = r
arg n = a BinaryOpFunction
var array = nil
SequenceableCollection:every 0x62379c011380
arg this = [ ]
arg bars = a Function
arg beatsPerBar = 8
a FunctionDef 0x62379abb3e00
sourceCode = "<an open Function>"
arg item = ControlName P 0 freq control 440
ArrayedCollection:do 0x62379b833840
arg this = [ ControlName P 0 freq control 440, ControlName P 1 dt control 0.1, ControlName P 2 rate control 2, ControlName P 3 gate control 1.0, ControlName P 4 fadeTime control 0.02, ControlName P 5 out scalar 0 ]
arg function = a Function
var i = 0
ArrayedCollection:do 0x62379b833840
arg this = [ 0, 1 ]
arg function = a Function
var i = 0
Order:do 0x62379b867d00
arg this = Order[ a SynthDefControl, a StreamControl ]
arg function = a Function
NodeProxy:controlNames 0x62379abb35c0
arg this = NodeProxy.audio(localhost, 2)
arg except = [ out, i_out, gate, fadeTime ]
arg addNodeMap = true
var all = [ ]
a FunctionDef 0x62379bf33d40
sourceCode = "<an open Function>"
a FunctionDef 0x62379b962b00
sourceCode = "<an open Function>"
Function:prTry 0x62379ab32e40
arg this = a Function
var result = nil
var thread = a Routine
var next = a Function
var wasInProtectedFunc = true
Function:protect 0x62379ab323c0
arg this = a Function
arg handler = a Function
var result = nil
Environment:use 0x62379b962680
arg this = ( 'out': 4, 'group': a Function, 'finish': a Function, 'dur': 0.5,
'dt': 1.0795785617828, 'play': a Function, 'proxy': NodeProxy.audio(localhost, 2), 'server': localhost, 'rate': 1,
'freq': 960.0 )
arg function = a Function
var result = nil
var saveEnvir = Environment[ ]
Event:play 0x62379b989cc0
arg this = ( 'out': 4, 'group': a Function, 'finish': a Function, 'dur': 0.5,
'dt': 1.0795785617828, 'play': a Function, 'proxy': NodeProxy.audio(localhost, 2), 'server': localhost, 'rate': 1,
'freq': 960.0 )
Event:playAndDelta 0x62379b98ae00
arg this = ( 'out': 4, 'group': a Function, 'finish': a Function, 'dur': 0.5,
'dt': 1.0795785617828, 'play': a Function, 'proxy': NodeProxy.audio(localhost, 2), 'server': localhost, 'rate': 1,
'freq': 960.0 )
arg cleanup = an EventStreamCleanup
arg mute = false
EventStreamPlayer:prNext 0x62379b2fcb80
arg this = an EventStreamPlayer
arg inTime = 402.069131612
var nextTime = nil
var outEvent = ( 'out': 4, 'group': a Function, 'finish': a Function, 'dur': 0.5,
'dt': 1.0795785617828, 'play': a Function, 'proxy': NodeProxy.audio(localhost, 2), 'server': localhost, 'rate': 1,
'freq': 960.0 )
var roundedBeat = nil
var deltaFromRounded = nil
a FunctionDef 0x62379b2fa9c0
sourceCode = "<an open Function>"
Function:prTry 0x62379ab32e40
arg this = a Function
var result = nil
var thread = a Routine
var next = nil
var wasInProtectedFunc = false
CALL STACK:
MethodError:reportError
arg this = <instance of PrimitiveFailedError>
Nil:handleError
arg this = nil
arg error = <instance of PrimitiveFailedError>
Thread:handleError
arg this = <instance of Thread>
arg error = <instance of PrimitiveFailedError>
Thread:handleError
arg this = <instance of Routine>
arg error = <instance of PrimitiveFailedError>
Object:throw
arg this = <instance of PrimitiveFailedError>
Function:protect
arg this = <instance of Function>
arg handler = <instance of Function>
var result = <instance of PrimitiveFailedError>
Routine:prStart
arg this = <instance of Routine>
arg inval = 402.069131612
^^ The preceding error dump is for ERROR: Primitive '_BasicNew' failed.
Index not an Integer
RECEIVER: Array
ERROR: Message 'def' not understood.
Perhaps you misspelled 'ref', or meant to call 'def' on another receiver?
RECEIVER:
Instance of Pbind { (0x62379d65ff88, gc=60, fmt=00, flg=00, set=02)
instance variables [1]
patternpairs : instance of Array (0x62379c4f7e08, size=8, set=3)
}
ARGS:
PROTECTED CALL STACK:
Meta_MethodError:new 0x62379a85cc40
arg this = DoesNotUnderstandError
arg what = nil
arg receiver = a Pbind
Meta_DoesNotUnderstandError:new 0x62379a85ef80
arg this = DoesNotUnderstandError
arg receiver = a Pbind
arg selector = def
arg args = [ ]
Object:doesNotUnderstand 0x62379a28b6c0
arg this = a Pbind
arg selector = def
arg args = nil
SynthDef:addControlsFromArgsOfFunc 0x62379bdbfc40
arg this = SynthDef:temp__01743152121_1008
arg func = a Pbind
arg rates = nil
arg skipArgs = 1
var def = nil
var names = nil
var values = nil
var argNames = nil
var specs = nil
SynthDef:buildUgenGraph 0x62379bdbf6c0
arg this = SynthDef:temp__01743152121_1008
arg func = a Pbind
arg rates = nil
arg prependArgs = [ [ an OutputProxy, an OutputProxy ] ]
var result = nil
var saveControlNames = [ ControlName P 0 out control 0.0, ControlName P 1 wet1 control 1.0, ControlName P 2 gate control 1.0, ControlName P 3 fadeTime control 0.02 ]
a FunctionDef 0x62379bf31c80
sourceCode = "<an open Function>"
arg out = an OutputProxy
var env = a BinaryOpUGen
var ctl = an OutputProxy
SynthDef:buildUgenGraph 0x62379bdbf6c0
arg this = SynthDef:temp__01743152121_1008
arg func = a Function
arg rates = nil
arg prependArgs = [ ]
var result = nil
var saveControlNames = nil
a FunctionDef 0x62379bdaad80
sourceCode = "<an open Function>"
var out = nil
var outCtl = nil
SynthDef:buildUgenGraph 0x62379bdbf6c0
arg this = SynthDef:temp__01743152121_1008
arg func = a Function
arg rates = nil
arg prependArgs = [ ]
var result = nil
var saveControlNames = nil
a FunctionDef 0x62379bdbdc40
sourceCode = "<an open Function>"
Function:prTry 0x62379ab32e40
arg this = a Function
var result = nil
var thread = a Thread
var next = nil
var wasInProtectedFunc = false
CALL STACK:
DoesNotUnderstandError:reportError
arg this = <instance of DoesNotUnderstandError>
Nil:handleError
arg this = nil
arg error = <instance of DoesNotUnderstandError>
Thread:handleError
arg this = <instance of Thread>
arg error = <instance of DoesNotUnderstandError>
Object:throw
arg this = <instance of DoesNotUnderstandError>
Function:protect
arg this = <instance of Function>
arg handler = <instance of Function>
var result = <instance of DoesNotUnderstandError>
SynthDef:build
arg this = <instance of ProxySynthDef>
arg ugenGraphFunc = <instance of Function>
arg rates = nil
arg prependArgs = nil
Meta_ProxySynthDef:new
arg this = <instance of Meta_ProxySynthDef>
arg name = "temp__01743152121_1008"
arg func = <instance of Function>
arg rates = nil
arg prependArgs = nil
arg makeFadeEnv = true
arg channelOffset = 0
arg chanConstraint = 2
arg rateConstraint = 'audio'
var def = nil
var rate = nil
var numChannels = nil
var output = nil
var isScalar = nil
var envgen = nil
var canFree = nil
var hasOwnGate = nil
var hasGateArg = false
var hasOutArg = false
var outerBuildSynthDef = nil
SynthDefControl:build
arg this = <instance of SynthDefControl>
arg proxy = <instance of NodeProxy>
arg orderIndex = 1
var ok = nil
var rate = nil
var numChannels = nil
var outerDefControl = nil
var outerBuildProxy = <instance of NodeProxy>
var controlNames = nil
NodeProxy:put
arg this = <instance of NodeProxy>
arg index = 1
arg obj = <instance of Association>
arg channelOffset = 0
arg extraArgs = nil
arg now = true
var container = <instance of SynthDefControl>
var bundle = <instance of MixedBundle>
var oldBus = <instance of Bus>
Interpreter:interpretPrintCmdLine
arg this = <instance of Interpreter>
var res = nil
var func = <instance of Function>
var code = "(
a[1] = \filter -> Pbind(
..."
var doc = <instance of ScelDocument>
var ideClass = nil
Process:interpretPrintCmdLine
arg this = <instance of Main>
^^ ERROR: Message 'def' not understood.
Perhaps you misspelled 'ref', or meant to call 'def' on another receiver?
RECEIVER: a Pbind
Is this a bug or is the help file obsolete? Any pointers will be very much appreciated.
I’m using SC 3.13.0 on Arch Linux
EDIT: I tried with PbindProxy
as source of the NodeProxy
and it works:
s.boot;
p = ProxySpace.push(s);
~snd = PbindProxy.new;
~snd.play;
~snd[1] = \set -> Pbind(\instrument, \pulse, \degree, Prand((..7), inf), \dur, 1/4);