Realtime convolution of two live inputs - using multiconvolve~

hello,
inspired by experiments I did with convolution using mungo´s c1 eurorack module I would like to try something similar with max and expand on it. what the c1 in live mode basically does is, instead of loading an ir from card into a buffer, It convolves two input signals in “realtime”. from my limited understanding I assume that this is done by capturing a small chunks of audio into a buffer and use this buffer as an impulse response. the buffer than gets filled/updated continuously - hence the changing ir over time.

so far I tried hirt´s lovely multiconvolve~object (mc). it sounds great but from what I can see its not meant for this kind of applications (continuously updating ir buffer) since everytime it receives the set message (to update the buffer reference) it creates an interruption on its audio output. I might overlooked or missed something here…
is this something that can be done with multiconvolve or is it rather a case for flucoma or framlib?
also if someone already worked with convolution in this way and likes to elaborate on it, I am very curious to hear/learn about it.
thanks, johannes

Yes, this is a job for framelib. The results of doing this depend very much on the window size and hop size you use. Note that the resulting levels can be very unpredictable, so proceed with care!

Indeed framelib would do a more elegant job, but I did that with 2 multiconvolve objects, the same way one “changes” delay size without pitch shifting - you change one instance while you are convolveing with the other. at a change of kernel, you swap the player and the one being edited. It works well and is quick do code.

thanks for the help guys.
@weefuzzy I will definitely look into frame lib in more detail…

@tremblap interesting, I actually already tried this or something similar, but didn’t found it work well at faster update rates/smaller buffersizes.
how did you patch the switch-instance-mechanism? for now I route the set message to one instance at the time and switch the destination to the other instance once the ir-buffer is filled again and simply crossfade between the outputs of both instances. is it also what you did?
here is my very basic patch, looking forward to any hints…


----------begin_max5_patcher----------
2775.3oc4as0iahjE94t+UfrlGRxzwacuf8orOrZz95n8snQsvlxtIACV.tS
mLZ5e6acAvfArKaJxjn0JwtcUfOmyWctVbp+796VrJ6EQwBu+o2G8t6t+796
tSOjZf6p99cK1E9x5jvB8ksHU7krUeZwCloJEuTpGNa2KK2KB+bR7tWqmbeX
45mhS29XtXcogFT7RvCdz.f5Ce8WPnk.u+n5VROrKNMQTpoE53fYGJqGkTMZ
bjgvq9z6w0TzbYkecuvPtEEwaSCSV7P6+JItnr4Su+Pcm+082qd6gogAIYgQ
qBS2dN4mQUxLW+N0+7xOb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zPiFZCX
J1kxVxvbFBxY.LyGS3pCKtNp7.yMU9FL4EVFIXYPuCepboL3LKyAtcY1FKNv
Y0N45c8CBApOFVjTy45ThrRsYNxhDZS0CHWXZ.swKEwEIkeR.2y+TzmFkv1R
ooF0BZSNM7YQCAd05lmXTY18DHTWXQiE1LTXA7Z7hMMJM83fU3vDbPZ1yhSN
luJN9ji26IGs29Gq2wORumdbd0Om9wNFu2+W2++fwl8Qf
-----------end_max5_patcher-----------

Your patch should work with one caveat: you forgot to wait for 50 ms to change the kernel…

so the leftmost part of your [t b i i] should go into a [del 60] and then you should make sure you do not retrigger for (let’s say) 100 ms. that way you are changing the convolution kernel when it is silenced completely.

Try that and let me know if that works better?

1 Like

thanks for your reply Pierre,

I have tried it and its getting worse. it doesn’t sound like continues changing ir - specially with faster ir buffer update rates.
Actually I think that I already take care of that silence-before-switch-kernel part by first updating the kernel that we dont hear atm (via set message) and than crossfade over to that kernel in 50 ms. at least thats what I was trying to achieve :slight_smile:
my guess is that at faster ir buffer update rates the crossfade can’t mask the short kernel muting (after receiving the set message) anymore…

if you tweak the cross fade to make sure you have 2 running at the same time you will get something smooth

the order of things to do to correct your time flow

  1. crossfade to the new over 50ms with a 3db pan law (during that time both are processing)
  2. after the crossfade, change to the next kernel so you are ready for the next

that way you get ‘continuous’ - it still sounds ‘granular’ but it will always do… except if you do this more sophisticated version: you have many running (overlap of 4 or plus) and the changing procedure is crossfading the input! You can detect the output of a convolver to see if it reached the end of its convolution (outputing near silence like this.poly voice allocation) then you can change this voice’s kernel for the next time.

That last one is as continuous as you’ll get but will be more expensive because more convolvers are needed.

1 Like

thanks that improves it. (patch below) will look into the other approach later…
btw. is there a difference between the framlib convolver and multiconvolve~?


----------begin_max5_patcher----------
2985.3oc2bs0jZiiE94t+U3hZdX2L83RGc0ZeJ69195T6ao1pKCXn8DiME1z
oSlZ5e6qtX.av1H.YRxRMi6fD1R56b+ni7e93CSlV7VR4jf+QvmBd3g+7wGd
vzjtgGp+9CSVE+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D1X3BIoSWcLm7ThTEb
.tCWkFOL8CuqGbl+34pK5+ZjTLBHHl7+ArZr6.mFyubZleS6MWwhvGGecMNe
Rb0rV6QReI3oUL0GEY7IDWWGZnUt1NS9ItoQR3v.wAOLP.3vHI5FLgaZjot.
l3VI6437hP4xvniO8pbZ3sBJ3HGlZTjGfeF2gQhf8vHIcYfjiAg14QF5iNyM
4mQPMErQTz9u3a4aWH6fOj5LhtmSGFvFCpgaCMYHwNNIrYEERvRcrRlWtF3H
Cox7MeScLxJ3yIUhGZlW+lwRmdKJUxvRNUDgUQfFoKSO61SeZe9PF+bHd6cI
1a5XcQ8ByGFrNB26QJm3iQxEKVTerlHDWzGzVJssSRpObNRHAoj.TSJLQPDB
Pf4jrRH5ljxHLNhQkRl.KFLyiWzL+BEx678XyAO6ts4iybGvsNRNLPROvafc
QxB7ggaL8Bb5ra0dLJXRunxcIJRn9OglEjQ09tiqCd3z9t04sKjBenP.6Byk
Y23v8BPHrsjV35ZTWJH3HjTI5JD25bCcyDONUFJO40IghbIGfTJ8KozEO0QC
xAJLI4E.yFY18RR2mu8YvIViwvxK3hWuXev9CtnIh5kXEYtJncyiDw0QBtGw
+BCFDp8c2AX7+cOe9H3+Kb61Apmc2fxCa5aN5McgdFeza3hid6Vb5a1h9eqV
b7azBSIKz2axhG+qG+e.G319K
-----------end_max5_patcher-----------

the former is more flexible - you deal with frames and can implement, at the cost of coding time, quite much more powerful algo, including multirate processes and stuff. Not for beginners, but incredibly powerful. The 2nd is a blackbox which deals with all the partition convolution time alignement. In other words, it does one thing (r.t.convo to a fixed kernel) very optimally.

In my tunes, I use the 2nd. I will soon reembark on FL for other things than convolution…

Ah great. Thats good to know pierre.
did you also implemented what you, alex and diemo described in your paper
Rich Contacts: Corpus-Based Convolution of Contact Interaction Sound for Enhanced Musical Expression
by using multiconv/flucoma? or was it just prototyped in ftm/gabor/muliconv~ back than?
i would be curious how this basically works… and see the patch. is there one arround?

indeed just that.

The patch is in the repo of the article but might not work anymore! It was research code, after all :slight_smile:

1 Like