monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
621 stars 144 forks source link

CLEAR script function can freeze sound from SuperCollider #1215

Closed dndrks closed 3 years ago

dndrks commented 3 years ago

steps to repro:

expected: CLEAR silences all output

tehn commented 3 years ago

fixed by 52681eace7fe74e6eb13254be283bf662935bc82

catfact commented 3 years ago

does this commit actually fix?

engine deinit method should be called anyways from within supercollider when setting a new engine. here https://github.com/monome/norns/blob/main/sc/core/Crone.sc#L100-L108

so the change seems superfluous.

i had assumed the error was with deallocation logic in PolySub

tehn commented 3 years ago

@catfact sometimes it is desirable to clear a script, which you can do by holding K1 on the home screen and kitting K3. this previously cleared the lua but script.clear() didn't ask sc to free the engine, so now it does, which will silence a drone/whatever

you're correct that engine load already did the right thing. so yeah, it makes sense to probably move the engine clear to the CLEAR action, not in script.clear... so it's not called twice on engine load

catfact commented 3 years ago

oh i see. so this only happened on explicit clear. i still want to double check that this commit doesn't attempt double-free and throw errors on SC side.