SuperBufRd Errors

Hi all -

Having a little trouble with SuperBufRd after a recent compilation.

I’m not entirely sure if this is the sort of thing that is OK to post about on the message board or if this is something specifically for @Eric_Sluyter - so I apologize in advance.

I am also, curious, though, why this isn’t part of the standard SC package at this point? Is there any reason why users wouldn’t explicitly want accuracy for long buffers?

Anyway, SuperBufPlay’s example works fine, but the example for SuperBufRd is producing the following error… any suggestions would be greatly appreciated:

-> Buffer(1, nil, nil, nil, /Applications/SuperCollider.app/Contents/Resources/sounds/a11wlk01.wav)
ERROR: Message 'at' not understood.
Perhaps you misspelled 'as', or meant to call 'at' on another receiver?
RECEIVER:
Instance of SuperPair {    (0x178374648, gc=88, fmt=00, flg=00, set=02)
  instance variables [2]
    msd : instance of OutputProxy (0x1787b1c18, size=11, set=4)
    lsd : instance of OutputProxy (0x1315254e8, size=11, set=4)
}
ARGS:
   Integer 0

PROTECTED CALL STACK:
	Meta_MethodError:new	0x12060a200
		arg this = DoesNotUnderstandError
		arg what = nil
		arg receiver = SuperPair(an OutputProxy, an OutputProxy)
	Meta_DoesNotUnderstandError:new	0x12060c540
		arg this = DoesNotUnderstandError
		arg receiver = SuperPair(an OutputProxy, an OutputProxy)
		arg selector = at
		arg args = [ 0 ]
	Object:doesNotUnderstand	0x1481c1c40
		arg this = SuperPair(an OutputProxy, an OutputProxy)
		arg selector = at
		arg args = nil
	a FunctionDef	0x17819fc18
		sourceCode = "{
  var phaseInt, phaseDec;
  # phaseInt, phaseDec = SuperPhasor.ar(0, BufRateScale.kr(b), 0, 0, Float.from32Bits(b.numFrames), 0);
  SuperBufRd.ar(1, b, phaseInt, phaseDec);
}"
		var phaseInt = nil
		var phaseDec = nil
	SynthDef:buildUgenGraph	0x12263a680
		arg this = SynthDef:temp__20
		arg func = a Function
		arg rates = nil
		arg prependArgs = [  ]
		var result = nil
		var saveControlNames = [ ControlName  P 0 i_out scalar 0 ]
	a FunctionDef	0x1218aa480
		sourceCode = "<an open Function>"
		arg i_out = an OutputProxy
		var result = nil
		var rate = nil
		var env = nil
	SynthDef:buildUgenGraph	0x12263a680
		arg this = SynthDef:temp__20
		arg func = a Function
		arg rates = nil
		arg prependArgs = [  ]
		var result = nil
		var saveControlNames = nil
	a FunctionDef	0x122638c00
		sourceCode = "<an open Function>"
	Function:prTry	0x120a3ae80
		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 SynthDef>
		arg ugenGraphFunc = <instance of Function>
		arg rates = nil
		arg prependArgs = nil
	Function:play
		arg this = <instance of Function>
		arg target = <instance of Group>
		arg outbus = 0
		arg fadeTime = 0.02
		arg addAction = 'addToHead'
		arg args = nil
		var def = nil
		var synth = nil
		var server = <instance of Server>
		var bytes = nil
		var synthMsg = nil
	Interpreter:interpretPrintCmdLine
		arg this = <instance of Interpreter>
		var res = nil
		var func = <instance of Function>
		var code = "(
{
  var phaseInt, phaseDec..."
		var doc = nil
		var ideClass = <instance of Meta_ScIDE>
	Process:interpretPrintCmdLine
		arg this = <instance of Main>
^^ ERROR: Message 'at' not understood.
Perhaps you misspelled 'as', or meant to call 'at' on another receiver?
RECEIVER: SuperPair(an OutputProxy, an OutputProxy)

Well, this seems to just be a documentation error… apparently SuperBufRd no longer takes two arguments from a SuperPair? It is easy enough to fix as:

b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
(
{
  var  phaseDec;
	phaseDec = SuperPhasor.ar(0, BufRateScale.kr(b), 0, b.numFrames);
  SuperBufRd.ar(1, b, phaseDec);
}.play;
)

Still, I seem to be throwing an error elsewhere (edited code example forthcoming in separate post)…

ERROR: NotYetImplementedError
RECEIVER:
Instance of Method {    (0x1296e57c0, gc=01, fmt=00, flg=11, set=04)
  instance variables [15]
    raw1 : Float 0.000000   00000000 00800000
    raw2 : Float 0.000000   00000300 03020003
    code : instance of Int8Array (0x1296e5b80, size=30, set=2)
    selectors : instance of Array (0x1296e5ac0, size=3, set=2)
    constants : nil
    prototypeFrame : instance of Array (0x1296e5a00, size=3, set=2)
    context : nil
    argNames : instance of SymbolArray (0x1296e5940, size=3, set=2)
    varNames : nil
    sourceCode : nil
    ownerClass : instance of Meta_SuperPair (0x1296dfd40, size=19, set=5)
    name : Symbol 'composeNAryOp'
    primitiveName : nil
    filenameSymbol : Symbol '/Users/oka/Library/Application Support/SuperCollider/Extensions/super-bufrd/SuperPair.sc'
    charPos : Integer 3058
}

Could you include more of the stack trace? The top level frame is just an error reporting method, by itself not useful for troubleshooting.

hjh

Yes, my apologies. I am still trying to find a simpler way to throw this error as an example…but here is the full trace:

ERROR: NotYetImplementedError
RECEIVER:
Instance of Method {    (0x10907d7c0, gc=01, fmt=00, flg=11, set=04)
  instance variables [15]
    raw1 : Float 0.000000   00000000 00800000
    raw2 : Float 0.000000   00000300 03020003
    code : instance of Int8Array (0x10907db80, size=30, set=2)
    selectors : instance of Array (0x10907dac0, size=3, set=2)
    constants : nil
    prototypeFrame : instance of Array (0x10907da00, size=3, set=2)
    context : nil
    argNames : instance of SymbolArray (0x10907d940, size=3, set=2)
    varNames : nil
    sourceCode : nil
    ownerClass : instance of Meta_SuperPair (0x109077d40, size=19, set=5)
    name : Symbol 'composeNAryOp'
    primitiveName : nil
    filenameSymbol : Symbol '/Users/oka/Library/Application Support/SuperCollider/Extensions/super-bufrd/SuperPair.sc'
    charPos : Integer 3058
}

PROTECTED CALL STACK:
	Meta_MethodError:new	0x10892a200
		arg this = NotYetImplementedError
		arg what = nil
		arg receiver = SuperPair:composeNAryOp
	Object:notYetImplemented	0x12854b5c0
		arg this = SuperPair:composeNAryOp
	a FunctionDef	0x10c92c0b8
		sourceCode = "<an open Function>"
		arg lo = an OutputProxy
		arg hi = an OutputProxy
		arg freq = an OutputProxy
		arg vol = an OutputProxy
		arg wag = an OutputProxy
		arg out = an OutputProxy
		arg env = an OutputProxy
		arg lorange = an OutputProxy
		arg hirange = an OutputProxy
		arg lfscroll = an OutputProxy
		arg lfspeed = an OutputProxy
		arg lospeed = an OutputProxy
		arg hispeed = an OutputProxy
		arg seeker = an OutputProxy
		arg imprate = an OutputProxy
		arg skipBuf = an OutputProxy
		arg skipCount = an OutputProxy
		arg theOut = an OutputProxy
		var phasor = SuperPair(an OutputProxy, an OutputProxy)
		var warper = nil
		var phasor2 = nil
		var loBall = a Select
		var hiBall = a Select
		var frefre = a Select
		var scaled = SuperPair(an OutputProxy, an OutputProxy)
		var trig = an Impulse
		var demandor = a Dbufrd
		var polls = nil
	SynthDef:buildUgenGraph	0x10a95a680
		arg this = SynthDef:temp__21
		arg func = a Function
		arg rates = nil
		arg prependArgs = [  ]
		var result = nil
		var saveControlNames = [ ControlName  P 0 i_out scalar 0 ]
	a FunctionDef	0x109bca480
		sourceCode = "<an open Function>"
		arg i_out = an OutputProxy
		var result = nil
		var rate = nil
		var env = nil
	SynthDef:buildUgenGraph	0x10a95a680
		arg this = SynthDef:temp__21
		arg func = a Function
		arg rates = nil
		arg prependArgs = [  ]
		var result = nil
		var saveControlNames = nil
	a FunctionDef	0x10a958c00
		sourceCode = "<an open Function>"
	Function:prTry	0x108d5ae80
		arg this = a Function
		var result = nil
		var thread = a Thread
		var next = nil
		var wasInProtectedFunc = false
	
CALL STACK:
	MethodError:reportError
		arg this = <instance of NotYetImplementedError>
	Nil:handleError
		arg this = nil
		arg error = <instance of NotYetImplementedError>
	Thread:handleError
		arg this = <instance of Thread>
		arg error = <instance of NotYetImplementedError>
	Object:throw
		arg this = <instance of NotYetImplementedError>
	Function:protect
		arg this = <instance of Function>
		arg handler = <instance of Function>
		var result = <instance of NotYetImplementedError>
	SynthDef:build
		arg this = <instance of SynthDef>
		arg ugenGraphFunc = <instance of Function>
		arg rates = nil
		arg prependArgs = nil
	Function:play
		arg this = <instance of Function>
		arg target = <instance of Group>
		arg outbus = 0
		arg fadeTime = 0.02
		arg addAction = 'addToHead'
		arg args = [*4]
		var def = nil
		var synth = nil
		var server = <instance of Server>
		var bytes = nil
		var synthMsg = nil
	< FunctionDef in closed FunctionDef >
		arg view = <instance of SoundFileView>
		arg char = 510
		arg modifiers = 45
		arg unicode = 0
		arg keycode = 0
		arg key = nil
		var posData = [*2]
		var posLo = nil
		var posHi = nil
	View:mouseUpEvent
		arg this = <instance of SoundFileView>
		arg x = 510
		arg y = 45
		arg modifiers = 0
		arg buttonNumber = 0
^^ The preceding error dump is for ERROR: NotYetImplementedError
RECEIVER: SuperPair:composeNAryOp

I’ve managed to isolate the error - but I’m not exactly sure what’s going on here - maybe there’s a way to reformulate this equation?

(
{
var ao, phasor;

phasor = SuperPhasor.ar(1, 1, 0, 4000, 1, 1);
ao = phasor/SuperBufFrames.kr(~b);
ao = ao.linlin(0, 1000, -1.0, 1.0);
}.play
)

There is also a small question about how to attach a SuperPhasor to an Output bus:

	{Out.ar(0, SuperPhasor.ar(1, 1, 0, 3000))}.play;

It looks like math operators haven’t been defined for SuperPair. I’m not familiar with their internals so it will be up to either the original author or an interested third party.

Similar for out buses, I guess (no access to github temporarily, so I can’t take a look at the moment).

hjh

1 Like

Sorry for jumping in late. SuperPair does not (yet) support NAryOps as a unit generator – @elgiano put in some amazing effort and implemented all the binary ops (see super-bufrd/SuperBinaryOpUGen.cpp at superpair · esluyter/super-bufrd · GitHub) but concluded that the Nary ops were too much effort for too little reward.

(This is why I think this kind of solution is not a good candidate for standard SC – the better way would be to upgrade scsynth to support 64 bit floating point numbers. But that is way above my skills…)

Meanwhile, you can replace the linlin with binary operations or math operators, i.e.

ao = ao * 2 / 1000 - 1;

and it should work okay.

And about output buses… a SuperPair is two numbers, that should basically only be used to talk to another SuperWhatever ugen. Those two numbers are each 32-bit floats, and when you add them together (which is what the Super etc ugens do internally) you get 64 bit precision. (The only practical use for this that I can think of is to access long sound buffers at subsample precision…)

If you do want to play it to an output bus, you can use .asFloat to collapse it down to a single value which is what you would want to listen to (but at that point, there’s not much reason to use the Super variants), or .components to access the array of [msb, lsb] which is what you would need in order to send the high resolution value from one synth to another.

Thanks for pointing me to the bad documentation, I will fix it!

1 Like
  1. single sample blocks
  2. oversampling blocks

Those are the 3 things the server needs. The last two are almost the same problem/solution.

Sam

1 Like