TheTechnobear / Mi4Pd

Pure Data externals wrapping MI modules
91 stars 13 forks source link

Fix for Braids #3

Closed jnonis closed 5 years ago

jnonis commented 5 years ago

Hi and thanks for your great work. I made some fixes for braids. The max block size for Braids (and I guess all the MI modules) is 24, any block size over 24 will not work (it will crash or generate noise). Pd uses a 64 block size, that means that we have to render the 64 sample in blocks smaller than 24 samples. With this fix all the synth engines work as expected.

PD: I made an external for Plaits also, I can send you another pull request if you like.

TheTechnobear commented 5 years ago

Cool, Is this just an issue with the macro oscillators as I’ve not seen the issue with most of braids?! Out of interest, Do you know where this 24 sample limit comes in- where is it defined in the code? I’d not noticed it when wandering around the MI code, and be interested to look if it’s other modules.

jnonis commented 5 years ago

Cool, Is this just an issue with the macro oscillators as I’ve not seen the issue with most of braids?! Out of interest, Do you know where this 24 sample limit comes in- where is it defined in the code? I’d not noticed it when wandering around the MI code, and be interested to look if it’s other modules.

I got a clue looking at the implementation of Braids for VCV Rack, they always render a block of 24 samples. Then I found some buffers initialized with a size of 24 in Braids sources: https://github.com/TheTechnobear/Mi4Pd/blob/master/mi/braids/braids.cc#L57 https://github.com/TheTechnobear/Mi4Pd/blob/master/mi/braids/macro_oscillator.h#L102

Plaits has the same max block size of 24. I didn't check the other modules, maybe they don't have this limitation.

TheTechnobear commented 5 years ago

Thanks for the explanation, I guess only some of the oscillators care about this - hence why I’d not noticed it.

Yeah, I’d love a PR for plaits, and I’ll add a credit for you , same as grids.

My intention is to keep updating to have all the MI modules for Pd in one place - so will be looking at marbles. But as always need to find the time :).