Closed DBraun closed 3 years ago
Yes, this could make sense. What is your use-case for "control is off" ? And please prepare a PR if you have a fix.
Cool, thanks. No particular use case. It was just the first setting I chose without thinking about it much. I'll try to prepare a PR soon.
Thanks for the PR.
I'm seeing an issue when voice control is off, but there's no issue when voice control is on. I do
m_dsp_poly = m_poly_factory->createPolyDSPInstance(8, false, true);
My code does
m_dsp_poly->keyOn
,m_dsp_poly->keyOff
a bunch of times and thenm_dsp_poly->instanceClear();
After a few cycles of this, all of the voices become used, and I get warnings about stealing voices. However, if voice control was on, there's no problem.
I think that this code is executing https://github.com/grame-cncm/faust/blob/c10910171a197066f15679631d71ed346ccb1751/architecture/faust/dsp/poly-dsp.h#L763
but
fVoiceTable
isstd::vector<dsp_voice*> fVoiceTable;
anddsp_voice
does not implementinstanceClear()
in a way to modify its internal fCurNote, fRelease etc.And those vars do get "reset" when voice control is on: https://github.com/grame-cncm/faust/blob/c10910171a197066f15679631d71ed346ccb1751/architecture/faust/dsp/poly-dsp.h#L790-L802 I think this happens naturally as more
compute()
gets called.So maybe
dsp_voice
needs a newinstanceClear()
function to resetfCurNote
andfRelease
?