Spectral "Compensation"?

Something I’ve used in C-C-Combine (based on @a.harker’s suggestion) is loudness and pitch compensation where I compensate for the discrepancy in loudness/pitch from a matched sample/grain to what I am matching it against. For loudness and pitch this is fairly straight forward in that I can boost/cut the amplitude and play it back faster/slower to more-or-less “accurately” compensate the sample.

This works really well, particularly in terms of pitch compensation.

Now I’m wondering how viable it might be to do something similar but for spectral compensation. Since fluid.spectralshape~ and fluid.bufspectralshape~ output all the spectral moments, and combined, they describe a more comprehensive spectral shape, which could potentially be translated into a subtle/vague filter shape (with filterdesign~?).

Obviously it can’t be as absolute as loudness/pitch compensation, since there is more risk of overly/incorrectly compensating the match.

Have any of you experimented with this?
Is it viable enough to do on a per-grain basis?

convolving the sample to some degree to get it closer to a target perhaps?

Hmm, that could be another way, though that could potentially make things worse since I would want an IR of the difference between the two samples anyways? (@tremblap / @a.harker?)

Also, I don’t think it’s possible to do that in a “real-time” manner aways, since you’d have to load the IR into a buffer~/multiconvolve~, and that takes time. @tremblap has a patch for something similarish that solves the problem by the IR always being one attack late, so whenever an onset happens, it cues up an IR…which is what the next onset will use.

Potentially make things worse and also just not be the kind of sound result you want - I’m spitballing ideas here. I’m thinking of a more cross-dog implementation with a mixer/balance control to let you latch onto some aspect of the sound that you want.

Yeah totally.

My initial thought was in a concat resynthesis context, where the grains come by so fast that you don’t “hear” individual grains, and therefore and spectral massaging they get would just get washed into the overall texture. So in that context just nudging it a bit could maybe help with getting a more accurate spectral contour as well.

I’ve not tried to do this specifically, but thoughts:

  1. Spectral shape descriptors might not be what you want: they (sometimes) tell you enough to distinguish one sound from another, but because the higher moments (skew etc) are calculated with respect to the centroid, trying to interpret them as describing a spectrum would give you a funny shape.
  2. Modulating filters per grain can be done; biquads will tend to blow up if you wiggle them too fast, SVF are more stable for this sort of thing. Check out @a.harker’s examples in FrameLib
  3. Likewise, real-time, dynamic convolution can be done with FrameLib, but possibly isn’t what you’re after here, like you say.
  4. What you want, if I understand it, might be more like spectral envelope replacement (a bit) like a vocoder? Again, if I was going to try and do this per-grain in Max, I’d reach for FrameLib, and use an estimate of the spectral envelope of my target frames to stamp on the incoming ones.
1 Like

Yup, that sounds about right.

At this point it’s just a hunch or idea to test, as part of the fun of the concat stuff is the “lossy-ness” of it, but could be nice to have the nuance if desired.

I still haven’t worked my way through @jamesbradbury’s tutorials, so I’m not sure how to actually go about doing something like that in FrameLib, but increasingly the solution to most of my problems seems to be “you can do it in FrameLib”, so it might be time to do that…

I’d heartily recommend it – I’ve been loving the per-grain control fun. I might have some code knocking about where I’ve done spectral envelope estimation in FrameLib, so give me a shout when you’re at that point and I’ll dig about.

Hello - I’ve been thinking about this for a while.

I’d advise making a small IR by deconvolution of the desired envelope by the one you are using and then smoothing/simplifying the result.

The issue is how to get the envelope of the sounds involved. One option is to simplify the spectrum with irpla~ or something like that (other options are cepstral techniques or LPC). For real-time input the problem is that you don’t have the filter/sound until it is happened, so that is an issue.

I don’t advise wiggly filter things - I think what you want here is one filter per grain. Framelib would make it more viable to do this sort of thing with sample accuracy, but I’m not sure it is accurate to say that loading an IR into multiconvolve~ “takes time”, except in the sense that all calculations/operations take time. In respect to the max thread you are running in it is immediate. That is not immediate in terms of the audio thread, but that’s another matter.

1 Like

I’d be up for making a synthetic spectrum from the moments also to try and approximate the shape - that would be a fun task inline with my current interests. The problem here is that we have to decide on the level of complexity/some characteristics of the synthetic filter shape - for centroid and spread that seems fairly doable, but the higher order ones need more thought.

1 Like

Oh nice.

So one intended implementation of this idea would be to include it in C-C-Combine, where for any given analysis frame there would be an input frame (already analyzed) and it’s nearest match from the database (then using lookup to get the difference between the two)).

So in that case there would be a known frame for both.

If I understand you right, would that then entail something along the lines of using irtrimnorm~ (or fluid.bufcompose~) to get the audio from the incoming audio buffer (using a JIT approach in C-C-Combine) into its own buffer~, and then running irplapprox~ on it to get an IR which I can then apply to the playback grain?

I meant more in the sense that it may involve buffer~ operations before/after it, which I guess have the same issues as the threading/overdrive stuff from this thread.

That would be quite cool.

I tried whipping something up using biquad~ and taking the raw readings and going all wiggle-waggle on noise~ to see if it works, and I guess I could kind of hear what was happening, but obviously this is not a great way to go about it.

Unless it’s crazy complicated, I’d be curious to see it either way if it’s handy.

You can do that in FrameLib

2 Likes

OK. Here is my first patch of this thread. This is using the HIRT and is not real-time friendly - this is just a super-simple make the overall spectrum of this sound sound more like the overall spectrum of that sound patch. The key is in the cropping (which is in essence a kind of smoothing in this context), and also the actual smoothing which controls the detail of the filter.

This would not quite yet be possible in FrameLib. There isn’t any smoothing like this in FrameLib yet, and the minimum phase conversion could probably be written in FrameLib, but it’s not simple if you’re not familiar with the technique.


----------begin_max5_patcher----------
1773.3oc2ZszaaiCD9bxuBBi8Xpg3SQsmZwtW5018VQQghEchJzKPImGsXyu
8cHojicssLskrZ2BDXZQQygey6YB+90WM61xmT0yP+I5Snqt56We0U1oLSbU
6yWMKO9oEYw01kMaQYdtpnY1Mt20ndpwN++neF8XZy8nEprrRTbQBJq7QTcd
YYy8oE208CJVkWtpIS0X2tf1YSSraR4se8MLb2RqhaVX9oeQqVz3NiggAyCt
AwiXlArDaFHvbnO+59mVzs8Xyb+60Wa93FOAXtptN9N0N.TqpxhWnb36MKIy
iSWtePg2ETTQ2Rcqq44JkCQyls9nuG7J3ag2.gEujCgWxYf2B0ivIbG3lUFm
XXEnf4veDuQZz4ATdTnEggx4BZT.KfxjQv2jxaPQz9QMd7P8sqVtToeAUWjP
Q38CZxdDuGF0KAFIXs.acLXDzKKfKM3LLvBWIe7A8grceWUU1yn2+AusQoxd
rQkDmUYjcfylNSzEkEOTl8fxI9fOvnTs+1ngmoMpTrAdwD9jYiBZqcP9E+gI
+fv7npnsPkRwy4jPYfLPDEFQBi.qTYvDpvtJIsIsrveEVVOJrXmNJ2o2xIiu
B6gvw6+.ptBNG5U49CEZePQX09ng74XgPxjLrLjCeg.NVnSGv9XWXez6.3T.
Dva3Ql0W3PmoFltK7vXwTiOzGOYgWeI2fYQGFcA7oCc+ktrxaHQh5ARDrERX
HMFLFSnDvWANDii.czoD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Av4sFwQ
SIC3zuEF3A24YNcq6fgDStL2ACSPsUo8CLyZbkRZ++wEa+e9OaOZ5mak+hd9
+9KOg94XWADJq3GuziVhZleaNQsM0g1iX2E4C8JgRT0MoEqS83SqMn2XM4oI
UkoEM0c2ggn4bSNFTy.GRtu6Izm2q3w2iVjOmrfdOZABygg.Cr.RDiQkToHf
ggIYg7C7tAdrkdbrwt0LH5D5Ccv8wdnBoUjIsCa9z.OZmfN0fnC2C5PFA5v7
gNiAfn9HTo7wfRA9fIRepOcVPPnIJKjBkbvXjPlD7gQb5R69pAdpI9HwwQi.
+g3kLeLjDD5IHIFFkH9ncE1mLuSvFx1QlKh36+Uq2qRchxFVM3xCCx152qIM
dXj1Kqlwv6N1mnerwfP93rFGdI3l9SZ7XqCg8xQxXXzg8wQR3XPHe7ifCFCJ
QFbpGlKW9EI0iefrG3rIFCtPvf4BLF+BwE7wM0tdObUSDWU8fRW2tZKMfJn9
Zo0rSdi8wzB2i1NiNSqdHsa8B6LwZnjmFndmUZW21dR35Rusmp5Bn.Lm6C.c
.IsUmY5LWcU68fwVD20+60+mDXQ3q
-----------end_max5_patcher-----------
1 Like

Here’s a more complicated version that allows you to approximate the shape of each spectrum first with piecewise linear approximation. Probably not worth the extra hassle of calculation because the results are largely similar, and when you reduce the number of segments right down you’ll start to get big errors in a less controllable manner that with smoothing alone. However, presented here for reference.


----------begin_max5_patcher----------
3297.3oc4cs0iahrD94Y9UfrNOrGoIVzW.Z1mRztZk1GNur47VTjE1f8PBFP
.dtrQa9se5K.FvPSici8jbjRrGSa6tput5p95tpF+s6uaw5jWBxWX7qFex3t
69182cG+RrKbW4quawduW1D4kyeaKhCdNY8WV7fnohfWJ3WN03+380fUeHMM
K4kv8dEgIw4UuqTuhMOFFuaUVvlBQmAwNKMev.xeDfDu.tzz3ykel3C6CiiB
J38p4wKlbnn5pfxqF5yEApX8NrcUeJdeEulFH5vEq8h2sn9qmKRAYkJZold2
hsgQAOEjkSk9F8vcK7RSab46Z7QX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pGVTs7zfNZ0oBv75odvwG8zs54b8zNY9JgBRfZev
CpY0KJ7ofkbkp768Iui6RdcieB94ZcswcWuNEQEiA.2UJTPFng118dxWkpw3
d1zApjoAh0x1y28Y5aqwTuSOwHftC2+V4ZB7GF+enIaDQpLpyggjrY7jWzgf
jsmdqh9nbU0K0UUUi1hRh20y.lymWzyadOcruUsE0ns7GSxJN8apuul.J5Vp
0Tomkre1yv55NpLEOmUxTTzfDLlAosyLYOV42R21i3IYO9Qd13Lf+fXNZ+ys
43H1hnYxTrJHitMEsNGSQvOHlhjeTMEGhIh+wMrht.Nd1labpAjrb0x8oBoq
MxfbkndUlLxwWoZY9GwDMof1u0TPrXq80lBZc0SzHzXc1g7GCxYYT13cJr8C
VkQ1s.5Jsi2vxjfmltuPcTE8px.P4IJumaRVmI.bipSDUxdWomJWxLl7NvLr
wyrfZGBq26U5qDKZrwIJP1J+sJSJDtmzlPH5JokptQ.79o8oFPfAcqXrRj3z
BNrUwWJuLwpX+ztRCso1AVraiVDwSV0uZfgGUEsIHYWT+fUoiHZni.JzOPcn
QtpfblxFTsbwrgQ1MLMrIzEiQDDw1DCrXGbOz.scghMQAwFnA3wQk9AHCdPT
Z8LqbHGIZ9pKTzrTwDQCP.REL.YoidxTEUBJCsqL3rsWRWgOBRfXLzASfhRZ
t2ltPoFhlfTeY8DTkQBGY3SIH.MAmfO1DT+MU+c09.ULupArssP6i5x420JY
goCGG.UhTz9HjnKkT8tFn6gVfJNk.5XtP6yvx30M+42QpL8t4oD376I3EGrg
xoddB1.TgPRyy7242SlWLJfQHUPAAg3N+bLwDqN+7K04mcoS+4VZ3elk59yq
D+LRLzOmR2+O2++PUNqi2
-----------end_max5_patcher-----------

1 - it should be noted that the process will correct the spectrum including the overall amplitude so this should sound roughy the same level.

2 - the question now is how much like the spectrum of one sound you want to get from the other. Is the smoothing adequate control over accuracy? Probably the next stage would be to look at much more approximate parameterised models, but that gets a bit complex. Looks like the Pearson distribution would allow control over the moments of a synthetic shape, but the maths is a little complex. I can take a look.

3 - whatever method you use it is basically come down to:
A - approximate both spectra
B - divide one (the target) by the other (the match)
C - apply the filter to the match

Other methods would include AR modelingl and a IIR filter as a result, or LPC/other approximation techniques.

@weefuzzy can we get your spectral envelope stuff - I might try comparing a few methods.

Here’s a vocodery thing using the cepstrum to estimate spectral envelope with framelib. It’s doing things @rodrigo.constanzo probably doesn’t want, like whitening (by dividing the carrier by its own spectral envelope). To apply a sort of summary spectrum to a carrier, one could do a one component NMF on a target and apply the smoothed envelope of that.


----------begin_max5_patcher----------
7128.3oc6c0kjaijb9YoSAbGyCRgaQU+iByCN750wtuLSDNlYdaFGJPSBxFq
.A3B.1RZ2X6v2AeA7YwGEeRb8C.H.IAPwtQAhdZLgcqk3Gxp9pLyJqr9xr96
u8M2bWxWCxtw46c9Um27l+9aeyaTWRdg2T742byV+utLxOS8X2rLY61f37at
Ueu7fulqt9e5O8KNYg+sfLGm2A+dlyG9WbfH926vgdn2W9zY4eKJP83kWId+
1v3nfb0WNr3h67yWdeX7lOkFrLW233H7Bl3+Pracf7E.weYT4+f.K.N+mEuX
3J0Wdxc+kOfX09IR1mW9a.jW7e712J+ysF1miC9h3q7jt75nEQAwaxu+wxao
+cx+1t.cq9lapZZO8tNl6V00It.Ymlo9KBc9tNDd9tNb355QI9q1Fjk4fsZW
2EyWfnki3tnt50dVuSuOdm+xO2ZGNTpUn+mgXTGyT8VppqS75pqSOeWGMbc8
c9e94OPi5efFATcTnKdgKs8NLx5i06bVElsKx+aVU9l.KTmIJ4a2tFjYsXPq
wWePZQWsnu9laVGFE7PPZVXRbsm9M23uaWsK+lZuhDf9KIpuH2aqtTXr9R3p
KkF7PX46SptpepnSlK5g6S0XxWYjaN70jrJHMdeX0nkZn5skegk3BrPLfpvE
FQgRDdMS8hg0MQIK+bfBf.kWLYWPbX7tzfLwbT94EstpauJXs+9n7OsNINWN
YkpYHspbl6u1eYPqubr+Vcu6OjF5GU1+tYSZ3pjXYinAVKub4OmnyQ08s5cF
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YDMsYhGf3AvxFx0zeISr..604CsSS
xS3VoOT57qV+wgVNiXhHNmdI1re9sGnIsmKyV6yaB.Sc8bTjyNZ5nAPNSsVM
41xRK9jUlAsWoL9f4Y.VWafqGWJ0kFZsGi7LfyGVOCvTUA+Rd5fT04nLKz4P
Fz4TzjG9b0uLYUykDx+4s9bSbFdPlw.XxLFCvOjqkVyw4EAoBWPq1uHMONH5
jSS8om6R7AlZl.8bGd3lNs2y8WBZxhBGh4Nfl.dk86S1.jiNoSj+HGcBmbzo
axomrIseplb7IZh3W9e71+efah.pi
-----------end_max5_patcher-----------

Thanks @weefuzzy. I’m confused by the greater than / less than in the spectral envelope. It looks like you are expecting a mirrored full spectrum in, but your fat input is real only (so it doesn’t have a mirrored spectrum).

Possibly because you are doing the iFFT of a real only signal you get a mirrored result and so your cepstrum is mirrored, is that it? Can you clarify?

Yes, that’s it. The > and < are doing the liftering on the cepstrum (i.e. zeroing coefficients), and because it’s symmetrical, I need to treat it accordingly. If, in that sub-patch, you probe down the left hand side with a fl.tomax~ –> multislider you get a pretty good visual idea of what shapes the smoothing produces.

I only get super quiet results with this? What examples did you try?

I am recoding for my own edification with a slightly different logic (I create an index vector that is symmetrical and lifter based on a < operation on that.

In doing so it looks to me like you don’t correctly maintain symmetry in your code. I think when you do the length minus the threshold “bin” you end up out by one. A mirrored spectrum has a nyquist bin that appears only once (and thus the symmetry is not central in the vector), but here we expect an exact mirror with a repeated central value. If I examine the vector produced by your code I get one more “bin” of values on the left hand side compared to the right.