I'm trying to use the scope with some Supercollider code that triggers waves from the digital ins. When I use two scopes it shows correctly, but when I use 3, the 3rd signal seems to bleed into the first one? In the image, the green wave should be a quick blip, and shows correctly when I comment out the belaScope(2) line. Is this a bug?

Trying to fix the code snippet, seems to divide into separate boxes.
s = Server.default;
s.options.numAnalogInChannels = 8;
s.options.numAnalogOutChannels = 2;
s.options.numDigitalChannels = 16;
s.options.belaMaxScopeChannels = 3;
s.options.numMultiplexChannels = 0; // do not enable multiplexer channels
s.options.blockSize = 128;
s.waitForBoot({
var digitalPins = [ 0, 1, 2, 3, 4, 5, 6, 7];
var triggerCount = 1;
SynthDef(\trigDetector, {
arg ctlBus, deviceId;
var all = Array.fill(digitalPins.size, { |i|
DigitalIn.ar(digitalPins[i]);
});
// Convert all the bit array to a binary value
var allId = all.reverse.reduce({ arg total, bit; total * 2 + bit }, 0);
// Make sure they are set by delaying a little bit
var delay_allId = TDelay.ar(in: allId, dur: 0.001);
// Create bitmasks.
// velMask is how many bit used for velocity
// devMask used for devices, of which there are only 2
var velMask = pow(2, digitalPins.size - triggerCount) -1;
var devMask = pow(2, triggerCount) - 1;
// Use the masks to get the velocity and device that was activated
var velocity = allId.bitAnd(velMask);
var device = (allId >> (digitalPins.size - triggerCount)).bitAnd(devMask);
// scale button between 0 and 1 based on velMask
var button = velocity / velMask;
var signal = Trig.ar( Select.ar(abs(device - deviceId) < 0.1, [K2A.ar(0), delay_allId * button]), 0.05);
Out.ar(ctlBus, signal);
Out.kr(ctlBus, signal);
button.belaScope(2);
SendTrig.ar(HPZ1.ar(delay_allId), 20, allId);
// SendTrig.ar(HPZ1.ar(delay_allId), 21, deviceId);
}).send(s);
SynthDef(\playAndFree, {
arg buf = 0, rate = 1.0, vol = 1.0, wetBus=0, volmultraw = 1.0;
var sig = PlayBuf.ar(2, buf, BufRateScale.kr(buf) * rate, startPos: 0, doneAction: 2) * vol * volmultraw;
Out.ar(wetBus, sig);
}).send(s);
SynthDef("sh",{
arg buf=0, gate = 1, scale = 1.0, trigBus = -1, wetBus, vol = 0.6, loop = 0, t_reset = 0;
var main_eg = EnvGen.kr(Env.asr(0.01, 1, 0.1), gate, doneAction: 2);
var trigVal = In.ar(trigBus);
// var trigVariableToProvideAccessToTheSynthControlInput = NamedControl.tr(\trigNameOfTheSynthControlInput, 0);
// var toggle = ToggleFF.kr(trigVariableToProvideAccessToTheSynthControlInput);
var toggle = ToggleFF.kr(trigVal > 0.01);
var latch = SetResetFF.ar(trigVal, t_reset) ;
var gates = [toggle, toggle <= 0];
var egs = EnvGen.kr(Env.asr(0.01, 1, 0.01), gates);
var players = PlayBuf.ar(1, buf, BufRateScale.kr(buf),
gates,
startPos: 0 /*TRand.kr(
0,
BufFrames.kr(buf) * 0.5,
gates
)*/
,
loop: loop * latch
);
var signal = ((players * egs).sum * (main_eg * vol * ((1.0 - scale) + (trigVal*scale)) )).dup;
Out.ar(wetBus, signal);
signal.belaScope(1);
trigVal.belaScope(0);
}).send(s);
SynthDef("simpleTrig", {
arg buf;
//var trigger = Trig.ar(Impulse.ar(2), 1.6) * Trig.ar(Impulse.ar(1), 0.1);
//SendReply.ar(Impulse.ar(2), "/trg", [10, 0.8, buf]);
var snd=PlayBuf.ar(2, buf, BufRateScale.kr(buf), trigger: Impulse.ar(2));
//Out.ar(0, snd);
}).send(s);
SynthDef("autoTrig",
{
arg trigBus;
var trigger = Impulse.ar(1);
var randTrigger = Trig.ar(TRand.ar(0.3, 0.8, trigger) * trigger, 0.1);
randTrigger.belaScope(0);
Out.ar(trigBus, randTrigger);
}).send(s);
SynthDef("scope2", {
arg ctlBus;
In.ar(ctlBus).belaScope(2);
}).send(s);
s.sync;
b = Bus.audio(s, 1);
c = Bus.audio(s, 1);
Synth.new("scope2", [\ctlBus, b]);
k = Buffer.read(s, "/root/src/HarmProject/data/samples/Ride.wav");
j = Buffer.read(s, "/root/src/HarmProject/data/samples/Kick2.wav");
Synth.new("sh", [\buf: k, \trigBus: b]);
Synth.new("sh", [\buf: j, \trigBus: c]);
Synth.new("trigDetector", [\deviceId, 0.0, \ctlBus, b]);
Synth.new("trigDetector", [\deviceId, 1.0, \ctlBus, c]);
// enable this synth to test when you don't have a digital in
Synth.new("autoTrig", [\trigBus: b]);
o = OSCFunc({
arg msg, time;
[time, msg].postln;
},'/tr');
k.postln;
j.postln;
"Ready ".postln;
s.sync;
});
"Waiting for quit ".postln;
ServerQuit.add({ 0.exit }); // quit if the button is pressed