diff --git a/synth/voice_allocator.h b/synth/voice_allocator.h index ecd0b26..0d9dd66 100644 --- a/synth/voice_allocator.h +++ b/synth/voice_allocator.h @@ -22,7 +22,11 @@ public: { if (voice_count > voicePtrs.size()) { for (int i = voicePtrs.size(); i < voice_count; ++i) { - voicePtrs.emplace_back(std::make_shared()); + if (voicePtrs.size() > 0) { + voicePtrs.emplace_back(std::make_shared(*voicePtrs.at(0))); + } else { + voicePtrs.emplace_back(std::make_shared()); + } } } else if (voice_count < voicePtrs.size()) { voicePtrs.resize(voice_count);