Var inside offadd? It worked but now it doesn't

I am having this strange problem with this code. Yeasterday it played fine but now it stops after some bars.I am not sure what is causing it. But I am guessing the var inside the offadd but then again it worked fine the other day…

p4 >> pluck(P[0,3,4,7]
    .offadd(var([2,4],[16,16]),var ([0.5,0.125],[32,32])),
    dur=1/3,
    oct=var([3,4],[16,16])
    )

Works fine for me - next time it happens could run:

print(Clock.playing)
print(p4.isplaying)

Just to see if it’s been stopped or the Clock has just somehow lost track of it…

Ok this is strange. When I run the code it works for a while but then stops. If I run print(Clock.playing) and print(p4.isplaying)
it returns true but NO sound.

When I start FoxDot from the command prompt i get this error message in SC
WARNING: Called from SynthDef:buildUgenGraph, method Meta_AudioIn:ar is deprecated and will be removed. Use Meta_SoundIn:ar instead.
But not sure if that has anything to do with it.

I didn’t have this problem the first day I played around with this sequence. It started to appear when I added this sequence:

p5 >> pluck(p4.degree + [0,2,3].layer(“reverse”).offadd(var([11,4])),oct=6,dur=1/3,amplify=0.5)

And then the problems started appearing and it wont go away even when I Ctrl + dot or close it down. But it would be strange that p5 would cause that problem permanently…

Do you have a lot of things playing at the same time and are you using a high bpm? My guess is that the Clock is losing track of p5 possibly due to a high load? Try going to the menu, selecting Help & Settings, then Clock latency, and going to “high” from the drop down. This should give your computer more time to calculate all of the values to send to SuperCollider and hopefully stop it from losing track of the player. To better test the issue, would you mind sharing the complete code that is running at when you encounter the issue?

I think I am using the standard bpm. I Changed the clock latency to high. But still problems.I think it hard to now when the problem appears because once it has appeared it doesn’t go away even if I copy the code to another document. I have to close FoxDot and SC and reboot FoxDot to get it to work again.

p3 >> play(P[“x-x-x-**-–”].stretch(4).rotate(-2),dur=1/3,sample=4,amplify=0.4,rate=linvar([1,1],[1,16]))
p4 >> pluck(P[0,3,4,7].rotate(1).offadd(var([4,2],16),var([0.5,0.25],16)),dur=1/3,oct=var([3,4],[16,16]))

p5 >> pluck(p4.degree + [0,2,3].layer(“reverse”).offadd(var([11,4])),oct=6,dur=1/3,amplify=0.5)

But maybe p5 is the problem. When I run it everything it stops. Do you get the same problem? And when I start again without the p5 the p4 quits after a few beats?

So this is weird. Using a var in the offadd schedules the event at a varying time and, so, isn’t stored as a float, but as a var. For some reason the greater than or equal to for a var that has been multiplied (or any operation for that matter) isn’t implemented correctly and returns False when it should return True. So there’s a bug when using var in offadd but only seems to occur when the scheduled event is no longer scheduled i.e. the offadd value changed in the var. Should be a simple fix but not sure I’ll be getting round to it unfortunately. If you could raise an issue on GitHub that would be useful for reminding me. Thanks.

Thanks for sorting that out, that there actually was a problem. I will not use var inside an offadd until it has been fixed. I will remind you. Thanks