v7b1 / mi-UGens

some mutable instruments eurorack modules ported to SuperCollider
176 stars 20 forks source link

Memory issues, ugens not being freed #19

Closed ameertg closed 1 year ago

ameertg commented 1 year ago

Issue

Scynth server crashes after a while of using Plaits in a PmonoArtic pattern. Similarly, clouds crashes when running for a little while. Sometimes an error message pops up saying the server failed to allocate memory. Other times it simply crashes with error code 0.

Details

When the ugens are running the cpu memory usage and numUgens seems to keep increasing without ever going down. For plaits the number of ugens goes up with every trigger. My assumption is that the exciter creates a few ugens but these are never freed and I assume something similar is happening in Clouds with every grain.

OS: M1 Mac (Monterey) Plugins: Compiled locally from v0.0.4 using CMake

Example code

(
SynthDef(\mallet,  { arg out=0, amp=1.0, midinote=40, gate=1.0;
    var sig;
    sig = MiElements.ar(gate: gate, pit:midinote, strength: 0.4, strike_level: 0.5);
    Out.ar(out, sig*amp);
}).add
)

(
PmonoArtic(\mallet, \midinote, 60, \dur, 0.25).play();
)

`