Switching wavetable files causes crash when there is a pitch modulator present.
-
This one took my a while to track down but I think I finally found the culprit.
Basically, if you have an active pitch modulator of any kind in the chain and you try to switch wavetable files (while sound is playing).... kaboom!I was hoping someone would please help me confirm it. I put together a snippet with everything you need to recreate it. You just need to provide a few of your own wavetables and use the comboBox to switch the wavetables while sound is playing. I am using an ahdsr envelope to modulate the pitch, but you can use any other modulator to try it out.
HiseSnippet 2116.3oc6asEabbUFdFaOowacyEZRaHPfQqRk1HYsZWaW6DRS8D6ccra8lXx5llpBDFOyY28fmcNCybV6rDhTk3h5KEdEjPBdrhG.jJBId.hE8ghfVohhnHwSFp.0BuDgPhW.L+myLyNy3cy5k8hy1UYevxm+y+47+8c9ubtr1qXSzPNNDaAwQWspERPbLo7UMoklujJ1TXoLLAun5FHp5ZFHGg4pZo53fzEDEG9RLMDGcDA9m6M6bpFplZn.QBBWif0PKiKioARWQ44wFFKnpiVEWNj1SorjFwbdhAoBflgkRIXopstZQzkUYpMjjf3AxpioD67TUJfEwQlinWMeIxllt5eMrCFPIqQZg7vD4JdAhgNCwLoByWBanuhOqcDDDkVIXMXX20fiIkCqiqIOXs3H7NjCFQ30CwghBugi.uzggWpPvqAPRLDjFwERGUJulM1hFzCCOOpzRlTjcAUXYOLTb0UXnyNjz7DPCSZxxpqiVvFZTaDIlNUpwkmLUpyb9XwhAq8NT4MTsk2zIs7Ej4QAIKhnb3wakHNzUbl1gTltLF90KHm0rH1DwFPsvEVOIhp97jxqQlibSlE7QFyFjxVDSnQh30zfanZsR5ffNwTTYm3i6Y0jeIB1LQ7OmY7yvzEaZ.HPtPESMJlXJyBl7FMyT1DiDZ91Yb.MFUPmI1shMJPJ1reQJ0FuVEJJASvxDH.UeNUy0WxTGcSe8Oerae9X6IvYSmmImW0vXMHNNQ8nAlrPX8xDJ5JlI3HJ1siIu6tJTng84MWFH6F1MKEytYCLgYkxqgrCudvTDh6hFLKc+ClCmqo4tzDRQh4RlX5UrPl2uLPAu0SVfuGp.Uo7v9i3E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.XTobr1xQe0O9mxv01tglVzoptANQ6NvIa2ANU6NvmtcG3zs6.mocG3Y26AxtU8EqPIkcOHlf3SE7t0BhOZ3FtAFgR8B+cbvMn2aM3N07mPKroyZFbzjstgxBULLpSGlvcoW90QaxZ+tu8I+Uamz8do1.uXxt0w9QW5O8U95yV6aHH56.uDbHNapaltPS30PcMdAUOZIdA54yqv22tKyqg6.ds8rQvalF4u1d153UlZ9q+x+5Mvoek2qWvqQ5d9qDsVbHnWT+018BdI0A75dQ7WJe6Fwq6Um+BzymWwl36c6+iwuuWvqGY.M+5fCn7ZztGu9fVjWev9AuFqs3049o+5M9ke++7c7vqWyn7xWmP7xWu8AdcnAT+0gGPyuNx.JuN5.Ju9XcOdscKxqs2O30i2A7ZJkv38UuaiNuwTJ6lWfd97529U+vY9ZkemdAuN1.Zb3w6R75KVnP7V4bub8740q+i+tybxT+idAudhN4dJ2Yuyu19NOXxudxNfWGLZ90a1H+0AqO+5Mq4u9c+rm9wetm8t8Bdcht18TZLup+dJg300E+M+7mZtdBu93sOu155aEI9xMUpNcpKNTPvmWuwSb5+93UNtROfWmrC7WmNZb362H+0oqON78q4u9a24u9L+w+8a0K7WehAz57exAz5FmZ.stwmZ.stwmtC7WIag5FIaVciuy27acpe3+rmT2X5NfWuzV686G9Ra0j2ObpmYQwYe4Q6E9qKLfVObg9MdE5OhiNgWWpqUOT3DsV8PPu8A+0hcu7qFUOrQ4WA0C+FSdg25+9j6zK30ROH40yp8Kdmh+jdRc9m6A46.j589vW+Ofe6dg+J2.ZciaLfxq0+nbbXtUxx+GtQTLqI6u5D9+QDB+OFknkAC```
-
@CyberGen confirmed, it happens here too
-
@ulrik Thank you.
-
I've tried many different ways to bypass the issue to no avail. Including:
1- Zeroing out the intensity of the pitch mod before the callback switch and recalling it after.
2.- Bypassing the entire pitch modulator before the callback switch.
3.- MidiMuting note before the switch.
4.- allNotesOff(); before the switch.
5.- Bypassing the Wavetable Synth before the switch
6.- All of the above at the same time.The crash still happens every time.
Please let me know if you think of another way to bypass this problem.
-
@CyberGen This also happens for me but only when the pitch mod is bidirectional. So if you can get away with unidirectional, I'd start there!
-
@ally good tip! I hadn't notice that. Thanks for sharing it.
I don't think I can really get away with using only unidirectional pitch mods though. This is the biggest issue I have with my current project. Switching wavetables must happen without issue for it to really work.
thank you.
-
@ally Did you try it with a unidirectional LFO? or pitch mods other than an envelope?
I can confirm that if you load a unipolar pitch envelope the crash does not happen. But it seems to be the exception. It is happening to me with other unipolar pitch mods like LFOs and even a simple constant modulator. It is also crashing sometimes when attempting to save the xml while sound is playing. -
@CyberGen Oh geez, sorry I didn't see this! But I'm working on this again now... just tried a bunch of combinations and here are my findings. There are 3 situations:
-
With a unipolar LFO, unipolar constant, bipolar constant, unipolar AHDSR, or bipolar AHDSR (or any combination of these), I can change the wavetable as many times as I want while a voice is playing and it is not crashing. BUT the sound is not actually being swapped out for the currently playing voice. Only the voices that start after the switch use the new wavetable.
-
With a bipolar LFO, I can change the wavetable once and it DOES swap out the sound for the currently playing voice. If I keep that same voice going and change the wavetable a second time, it will crash. If I let the voice end before switching wavetables again, it does not crash.
-
If I have a bipolar LFO on at the same time as any of the other pitch mods I listed in Situation #1, I get the Situation #1 behavior.
Hopefully that gives @Christoph-Hart something to go off of for fixing this... I should also note I updated HISE since my last post in this thread, so that may be why I'm getting different results now. Might update again and see if anything's changed, but gonna try it in an exported plugin next.
-
-
If you haven't already, make sure to post this in the github issues with a link to this thread so it can be tracked properly; unless Chris gets on top of this today, without being tracked the thread will get buried and the odds of this getting fixed go down.
-
Got on top of this today, the problem was that the wavetable loading happened synchronously without any voice handling logic and this created all kinds of weird issues (I guess I haven't used the wavetable synthesiser in this context in a real project).
The wavetable loading is now deferred to the sample loading thread so that it shows the exact behaviour as switching sample maps: it kills all voices, then loads the wavetable bank and then unsuspends the audio processing. This should get rid of all weird edge cases with voices playing while swapping the sound.
-
@Christoph-Hart Awesome! Thank you.
-
-