(bind-func cerberus_reset_lfos
(lambda (lfos:|4,|8,[SAMPLE,i64,i64]*||* idx:i64 frequency:SAMPLE onecycleinhz:SAMPLE phases:|4,SAMPLE|* mod_options:|4,i32|*)
(let ((obj (aref-ptr lfos idx))
(sine (cref (cast (aref obj 0) [void]*) osc [void]*))
(saw (cref (cast (aref obj 1) [void]*) osc [void]*))
(pulse (cref (cast (aref obj 2) [void]*) osc [void]*))
(tri (cref (cast (aref obj 3) [void]*) osc [void]*))
(opts (aref mod_options idx))
(notedur_value (if (> (& opts LFO_OPT_NOTEDUR) 0) onecycleinhz 1.0))
(amod_value (if (> (& opts LFO_OPT_FRQ_TO_AMP) 0) frequency 1.0))
(fmod_value (if (> (& opts LFO_OPT_FRQ_TO_FRQ) 0) frequency 1.0)))
;; only the above need a phases
(sine.phase (aref phases idx))
(saw.mod (aref phases idx))
(saw.pulse (aref phases idx))
(saw.tri (aref phases idx))
;; also set amod + fmod
(cset! (cast (aref obj 0) [void]*) amod amod_value float)
(cset! (cast (aref obj 0) [void]*) fmod fmod_value float)
(cset! (cast (aref obj 1) [void]*) amod amod_value float)
(cset! (cast (aref obj 1) [void]*) fmod fmod_value float)
(cset! (cast (aref obj 2) [void]*) amod amod_value float)
(cset! (cast (aref obj 2) [void]*) fmod fmod_value float)
(cset! (cast (aref obj 3) [void]*) amod amod_value float)
(cset! (cast (aref obj 3) [void]*) fmod fmod_value float)