< Back to IRCAM Forum

Loop for interpolating between the last and first points of consecutive bpf-libs

Hi all,
I’m looking for a loop (either as a visual programmed one or as a lisp routine) that interpolates between the last points and the first points of pairs of juxtaposed bpf-libs. I attach here a simplified example of the result I’m trying to obtain. Thanks in advance for your support.
Best regards,
Francesco Vitale

Patch-16.omp (1.26 MB)

Hi Francesco.

I don’t know any ready-made method which interpolates the contained bpfs of two bpf-libs and concatenates all 3. But it shouldn’t be too hard to build your own. Check attached for something you can possibly build upon.

Fwiw, i’ve added a #'bpf-concat method in the sources, which concatenates two bpfs (or bpcs) with some choices of what happens in the range between them.

Skjermdump-fra-2019-02-22-14-19-54.png

Dear Anders,
thanks for your response and pardon me for my late reply. In the patch attached to my previous message I tried to work with two concatenated bpf-libs (and not with two concatenated bpfs, as in your example), so I couldn’t make use of your kind suggestion or adapt it in a straightforward way. But in your patch you managed to have a bpf that connects the interpolated points, while, in my patch, I still don’t know where to “flatten” the y-points data to connect the interpolated points with lines (check it). If you have any suggestion about it, please let me know. Also, if you have the time, it would be nice to implement in OM a #’bpf-lib-concat method like the one used in my patch and suggested by Maestro Haddad here: http://forumnet.ircam.fr/user-groups/openmusic/forum/topic/loop-for-juxtaposing-interpolated-bps/. Thanks for all,
Francesco

‘L’oro e i boschi verde…, prima i soldi, poi il lavoro…’ :slight_smile:

In your case you could just loop through the successive bpfs of the two bpf-libs, and collect the ‘bpf-concat’-enated bpfs for each inside a new bpf-lib, no?

it would be nice to implement in OM a #’bpf-lib-concat method
Hmmm...many 'what-if's and different use-cases involved with this, making it difficult to set up something general enough to qualify to include in OM. For instance, what to do when there are different numbers of bpfs in the two bpf-libs?

Here’s a possible start of someting (pseuducode):

(mapcar #’(lambda (a b) (bpf-concat a b …)) (bpfs lib-a) (bpfs lib-b))

Thanks Anders,
the bpf-concat solution is the best and it works. But I still don’t know how to use it in a lambda patch in order to do automatically with two consecutive or juxtaposed bpf-libs in a series of n bpf-libs what I did manually (doing multiple loops) in the patch of the screenshot here attached. Any hint is of course very appreciated.
P.S. of course in a bpf-lib concat method all the bpf-libs should have the same number of bpfs, like in the example in my screenshot. Thanks again for all.
Best,
Francesco

screenshot.pdf (216 KB)

Hi Francesco.

#'reduce takes a binary function, and combines the n elements of a given sequence. Check the docs for info and example usage, it seems a possible usage in your case could be something like:
(reduce #'bpf-concat list-of-n-bpfs)

Each list-of-n-bpfs could presumably be built by something like appending all the #'mat-trans’ed bpf-libs

#'bpf-concat’s optional parameter f2-offset can be set to a specific transition length (x) between the two functions, setting it to 0 will give you a step transition between the two f’s.

Hmm… this version always adds a transition function between the two bpfs, would it make sense to not add any in-between function?

Just a suggestion to help reduce memory usage in larger patches: in your loop you use 3 bpf-factories (perhaps this is just debugging or testing? they are superfluous here, just passing the unchanged bpf further down the graph). If you really needed one (say to get access to the x-points of a bpf passed to a sub-patch or an omloop), you can instead use the ‘slots’ version of the bpf box, accessed by Ctrl-clicking in the patch, typing bpf, and shift-clicking in the patch background. (Guess we should set up a key-event to toggle between a slots version and a factory…)

Skjermdump-fra-2019-02-24-15-53-42.png

Dear Anders,
the reduce function (which I completely ignored: my fault!) embedded in the lambda patch is bloody brilliant. Now the transitions between the bpf-libs (4 in my case) is fully automated and smooth (see the screenshot). Fancying some further features for bpd-concat, it would be very interesting being able to choose between different types of transition function between the curves, like in the good old Diphone Studio (if I remember correctly, there were Linear, Logarithmic, Exponential, Truncate, Medium, Smooth, 2Smooth and TruncMed as preset options). Thanks for your really illuminating tips.
Best,
Francesco

screenshot1.pdf (137 KB)

Please ignore (and possibly delete) this double post. There’s a serious bug in this forum that duplicates attachments and replies that’s been haunting the forum for years.