Buffer.read() fails

When evaluating

~realOwl = Buffer.read(s, "/Users/_path/to/samples_/owl.wav");

I get the following error in SuperCollider 3.10:

ERROR: Message 'nextBufferNumber' not understood.
RECEIVER:
Instance of EventStreamPlayer {    (0x11e520198, gc=B4, fmt=00, flg=00, set=04)
  instance variables [11]
    stream : nil
    originalStream : instance of Routine (0x1226225a8, size=27, set=5)
    clock : instance of TempoClock (0x118bc2918, size=7, set=3)
    nextBeat : nil
    streamHasEnded : false
    isWaiting : false
    era : Integer 11
    event : instance of Event (0x11f009e18, size=5, set=3)
    muteCount : Integer 0
    cleanup : instance of EventStreamCleanup (0x122717608, size=1, set=2)
    routine : instance of Routine (0x121731718, size=27, set=5)
}
ARGS:
   Integer 1
PATH: /Users/_path_/forest.scd
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>
	Object:doesNotUnderstand
		arg this = <instance of EventStreamPlayer>
		arg selector = 'nextBufferNumber'
		arg args = [*1]
	Meta_Buffer:read
		arg this = <instance of Meta_Buffer>
		arg server = <instance of EventStreamPlayer>
		arg path = "/Users/_path_/samples/..."
		arg startFrame = 0
		arg numFrames = -1
		arg action = nil
		arg bufnum = nil
	< closed FunctionDef >  (no arguments or variables)
	Interpreter:interpretPrintCmdLine
		arg this = <instance of Interpreter>
		var res = nil
		var func = <instance of Function>
		var code = "(
~realOwl = Buffer.read(s, ..."
		var doc = nil
		var ideClass = <instance of Meta_ScIDE>
	Process:interpretPrintCmdLine
		arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Message 'nextBufferNumber' not understood.
RECEIVER: an EventStreamPlayer

The file path is correct. Am I doing anything wrong?

Are you working in Proxyspace? It looks ~realOwl is an EventStreamPlayer?

I don’t think so. When I reboot the server and evaluate that only line, I get the same error.

Looking at the error message, I suspect that there is an EventStreamPlayer in the variable ‘s’.
What is posted when you evaluate this:

s.postln;

Does it post e.g. ‘localhost’?

Does the same error occur if you run:

~realOwl = Buffer.read(Server.default, “/Users/path/to/samples/owl.wav”);

+Eirik

2 Likes

Nevermind, I was overwriting my local server variable s with a pattern. Thanks! :sweat_smile: