starlingcode / Via-for-Rack

MIT License
24 stars 8 forks source link

GateSeq crashes when added to the Rack Pro VST within Bitwig #29

Closed RichieHindle closed 2 years ago

RichieHindle commented 2 years ago

When you add GateSeq to the Rack Pro VST within Bitwig, it crashes.

The code makes the assumption that Gateseq::process() is called before PatternIQuantity::translateParameter().

Gateseq::process() calls ViaGateseq::slowConversionCallback() which calls DualEuclidean::parseControls() which sets up currentAPattern and currentBPattern for the first time.

PatternIQuantity::translateParameter() then reads currentAPattern and currentBPattern.

In standalone Rack, Gateseq::process() always happens before PatternIQuantity::translateParameter(), but that's not necessarily true in the VST because Bitwig can ask for the state of the parameters before process() has been called. The timing isn't predictable - sometimes it will crash, sometimes it won't, depending on which thread gets there first.

I haven't tested this with other DAWs, but I expect it goes wrong there too.

This problem was first reported on the Rack Forum here: https://community.vcvrack.com/t/starling-via/15181/26

liquidcitymotors commented 2 years ago

Thanks for chasing down the specific problem; much appreciated.

I need to reassess the tool tip implementation across all the modules and I’ll make sure this gets fixed in the process.

liquidcitymotors commented 2 years ago

I was able to reproduce in Mac with Ableton without too much trouble; surprised I missed it before.

Seriously thanks again @RichieHindle for identifying exactly what was going wrong here. Things are pretty tangled up in that module in particular

Its not perfect, but now the virtualModule constructor/initialization assigns those pattern pointers to a dummy value in 8e74770

Fixed it for me, but I'll take another look if it persists for other people.