surge-synthesizer / shortcircuit-xt

Will be a sampler when its done!
GNU General Public License v3.0
244 stars 27 forks source link

engine::findZone allocates #1146

Closed baconpaul closed 2 weeks ago

baconpaul commented 3 weeks ago

allocates to populate the vector and happens on the audio thread

which is a bummer

lets have it try to not do that through restructuring

baconpaul commented 3 weeks ago

The solution here is

  1. engineVoiceResponder gets a std::array<pathToZone_t, maxVoices>
  2. findZone signature changes to return size_t and take & std::array<ptz, max>
  3. find zone re-populates the array starting at 0 and returns size
  4. voice responder does an int loop

This will also help in the future with #1060 and #381