Dear users,
Sometimes, sclang returns errors while evaluating the code attached below the error message. I am perplexed because sclang sometimes does not return the errors after evaluating the same code block. It seems to be related to data processing speed due to the TempoClock and the method defer, but I have never seen that error message if I correctly remember. Has anyone seen the following error? It would be greatly appreciated if someone could explain the reason for the errors.
ERROR: Message ‘top’ not understood.
RECEIVER:
nil
ARGS:
PATH: /Users/prko/Dropbox/prko/Lecture/KWU/2022-1/0411.scdPROTECTED CALL STACK:
Meta_MethodError:new 0x7fb3fb31f9c0
arg this = DoesNotUnderstandError
arg what = nil
arg receiver = nil
Meta_DoesNotUnderstandError:new 0x7fb3fb321d00
arg this = DoesNotUnderstandError
arg receiver = nil
arg selector = top
arg args = [ ]
Object:doesNotUnderstand 0x7fb3f8083840
arg this = nil
arg selector = top
arg args = nil
Meta_Window:flipY 0x7fb3fb3bd840
arg this = Window
arg aRect = nil
var flippedTop = nil
a FunctionDef 0x7fb3ea3ddcc8
sourceCode = “”
a FunctionDef 0x7fb3fb603940
sourceCode = “”
a FunctionDef 0x7fb3f868d700
sourceCode = “”
Function:prTry 0x7fb3fb606d40
arg this = a Function
var result = nil
var thread = a Thread
var next = nil
var wasInProtectedFunc = falseCALL STACK:
DoesNotUnderstandError:reportError
arg this =
< closed FunctionDef >
arg error =
Integer:forBy
arg this = 0
arg endval = 0
arg stepval = 2
arg function =
var i = 0
var j = 0
SequenceableCollection:pairsDo
arg this = [*2]
arg function =
Scheduler:seconds_
arg this =
arg newSeconds = 104130.61858946
Meta_AppClock:tick
arg this =
var saveClock =
Process:tick
arg this =
^^ ERROR: Message ‘top’ not understood.
RECEIVER: nil
The code I evaluated is as follows:
(
Window.closeAll;
s.waitForBoot{
fork{
var win, bus, posX, posY, height, width, sig;
# posX, posY = [{ 20.rand2 }, { 30.rand2 }];
# height, width = [{ 10.rand2 }, { 20.rand2 }];
bus = Bus.audio(s, 2);
{
win = Window(border: false);
win.onClose_{ s.queryAllNodes; fork{ 1.wait; s.quit } }
.front;
s.plotTree;
FreqScope.new(400, 200, 0, server: s);
s.meter;
s.scope
}.defer;
{
var sig2dac;
sig2dac = In.ar(bus, 2);
FreeSelf.kr(DetectSilence.ar(sig2dac.abs.sum / 2.sqrt));
sig2dac;
}.play.onFree{ s.queryAllNodes; { win.close }.defer };
10.do{ |i|
sig = { |freq=4000, ampMod=7|
var pan, lev, env;
pan = posX.() / 20;
lev = width.().linlin(-10, 10, -48.dbamp, -24.dbamp);
env = Env.sine.kr(doneAction: Done.freeSelf);
sig = SinOsc.ar(freq.lag(0.05)) * env * SinOsc.kr(ampMod);
Pan2.ar(sig, pan, lev);
}.play(s, bus, addAction: \addToHead);
s.sync;
s.queryAllNodes;
(20-i).do{ |j|
var colour, posXthis, posYthis, widthThis, heightThis, transparency;
# posXthis, posYthis = [posX.(), posY.()];
# widthThis, heightThis = [width.(), height.()];
colour = Color(
rrand(0, 0.2),
rrand(0.5, 1),
rrand(0.5, 0.7),
0.5.rand
);
transparency = sin(i*0.1+j*0.1pi)*0.5+0.5;
0.05.yield;
sig.set(\freq, posYthis + 4000,
\ampMod, heightThis.linlin(-10, 10, 3, 10));
{
win.background = colour;
win.bounds = win.bounds
.moveBy(posXthis, posYthis)
.resizeBy(widthThis, heightThis);
win.alpha = transparency;
}.defer;
}
};
s.queryAllNodes;
}
}
)
best regards,