Fluid.bufnmf~ how does the process decide channel order after decomposition?

Hi All,

I expect this is a simple question - I’m still getting a grasp on how the process works and the language around it…

When I run a sound through fluid.bufnmf~ how are the channels ordered in the resultant multichannel buffer~ I’m assuming it may be that the first channel contributes most to the sound, then the others are descending order?

And is a stereo file treated as two separate mono processes?

Thanks in advance.

The order is arbitrary and if you rerun the process with the same settings you’ll notice the outputs Re similar but in a different order. If you supply a stereo buffer it will treat each channel as a mono input. Same goes for anything above two channels.

1 Like

With regards to the first question about how the channels are “ordered”, it’s random. Rather, it starts from a random seed and starts reconstructing stuff, so there’s nothing to “sort” the results. Similarly, if you run an NMF on the same file over and over, the results will be in different places (and slightly different too).

What I’ve done in the past is then run some descriptor stuff on the results and order them either by loudness or centroid or whatever you think is important. @jamesbradbury whipped up a thing ages ago that then takes the weakest results and combine them.

As to the stereo/mono stuff, I think there’s a tab in the help file that explains that, though when I’ve done that I tend to just split things and manage it independently.

1 Like

In the helpfile, there is an example that does exactly that indeed. There are also examples of pre-seeding significative bases, which allow you to guestimate where things will fall.

1 Like

Thanks for the replies, that explains why I couldn’t work out the ordering!

So, my next task was to work out how to use some of the descriptor objects and how they connect up.

Which part of the helpfile was that? Just finding my way around everything…

the tab entitled “fixed bases” should help. There is an explanation and example on how a 10 bases over-separation of an extract is then ordered by centroid to pick one, recompose all other bases, and re-run the whole process on the whole file to get a predictible output.

I hope this helps!

1 Like

Ok! Thanks for all the help.

After much tinkering and cobbling together of helpfiles I think I’ve got something close to working. The aim here is to split into 10 layers with fluid.bufnmf~ analyse for loudness with fluid.bufloudness~ and fluid.bufstats~ then to be able to sort through that data with dict.

If anyone has a chance to look at this it would be super helpful:


----------begin_max5_patcher----------
4587.3oc2cs0jaiar9Y6eEnzwUEumyLJ39k4Iu48TUpr4sMa4hiDGMzlhTGR
pY73Tw+1C.AoD0HPRHIHS6ncsDGJJ1n+5F8Mbg+q29lY2m+k3xYf6.+N3Mu4
e8127l5SYNwaZ962LaczWVjFUVeYyx1t993hY2X+p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XCtj30Udo7D0WqQWrFgOw6wCR+IOb49pJ7
8JwDm6PLw3tdVPf86Juzfk8RIODAgQ8QIWDjjZ7Q0iFBSDD3IDVdO0vhwX06
ShX6t0EiZeR1c3ehg1Gtxlmpzrl+7RKF.6xa6ZcycMm.25HACYuFsNbvvtVA
Mo4yC+yqPaG4Cxdkl1kdITuNEYyKmDG6L2tZKh1r4o3hxlqtlHyVG8I6tvk7
l5+LIqyVT1rh3mRZudj8TQEKdLoJdgYC.pdcf7klcXlYqy07X11jF1TyeZZV
V8R5qWhG61rzVG8EtYsuTyNlm4VQaSqNDB1scj8wjLSiOtcaIqdGCq8st6SX
Guyhs+M378YKEsXQb1ga0YRyUHIJLhWuejAURHs4taQyaZDWElMnJCq0Ymfa
1ZcqOoU+pq38.FtdUxLDKePShhILrpdWWSfYz5ivBJCE5l0AqxnvIKdHIMcG
C0cEo0tzhlspHZYx9cOvF9GsSlXhTPbiyi5PpleFt8mseuj63iN9m09qvJHR
UK6IMxdyQ5Sgd0uJJakEjwhc6ndlmTR4axKZ6Np+opcW+1p7cL5QKkN2huC6
c3mTztZq7V6pVlQYsareTMOSTmslk0JS8BWyznJ2DYMdUu91d6+9s+GfyInX
0
-----------end_max5_patcher-----------

A couple of things I’m unsure of:

a) If I run a stereo file through it I’m getting a 20 channel resynth buffer as expected, but then 40 channel buffers for features and stats - why is this? (I’m assuming I need to read up more on what exactly these are, but pointers appreciated)…

b) What do I need to extract from the dict to measure loudness for each channel? I’m guessing (admittedly with no real knowledge of this sort of analysis) that taking one of the mean values will get me there?

I’m not sure what the relevance of the derivatives 0 and 1 are:

If you imagine you have a time series that goes:

0 1 2 3 4

The derivative of this is:

1 1 1 1

which describes the change between consecutive samples.

.bufstats~ will calculate the statistics of both of these time series and give you the results in separate channels.

The idea is that you can capture the variation within a time series by analysing the derivative time series too. There are pitfalls to that assumption, for example, imagine we have our original time series and a new one, 4 3 2 1 0 to compare. They have the exact same first derivative time series and we cannot differentiate them unless we start looking at some other metric or form of analysis. Further to that, adding more derivatives doesn’t help, as the next derivative is 0 0 0.

A new channel for each derivative of analysis is produced in the output :slight_smile:


I think your patching overall is pretty solid - can’t see anything that would hinder you from getting toward your goal of analysing the components of .bufnmf~ by loudness. Its likely you don’t need to enter a dictionary at all though and you could use several zl objects to sort a list of indexes that describe the order of components.

1 Like

Something like this:


----------begin_max5_patcher----------
618.3ocqUksaiBCE8Y3qvxOShvl89qLppxg3xPEXiLlNoSU+2G6qMIgrLEUk
HEi456x4bWLeFFf2IOvGwnmP+BED7YXP.HxJHv+d.tmcntiMBpg64iirFNNx
cllePCxSPwHBJCQQoym00J30xIAn.0KTL02J535wyE1tG7gb2aaHE3SZJmzy
pR7RchzeLvcnFiQO6OZfoq+cqn4EEuV6NMiltMNBQhyKrOyhsqIYaiQOas4q
vP6RzJ4tf+GCDuh5+sCMJUZ7ZYH81LjdWFF8crLIwwRRl8YJwtRo+PVduJ7l
7XzlLyeZJZCIM0Tv2jjuZVSdn0UGiqJxAhSytIiAO.sgWzhCdzJeYZXTNopm
i+LnMzbFH64i5VAS2JEmqD0ozMS0qNRVmP9tHU3T5JJxFFdmqF8ZCAwTSeSp
ruVFAu1JbuBIbrh+d6r9NEXJSRVaxvSJ.X3C4tIYbubOWIlZAqCszyDxQ8Gc
WlVErdmol9obaSFvFCYdkM0oWlArsU0xNo5kVgE69jALfdZgr8T1mUWyENal
0szpVYREkja2UDWUFmtzpcMmYAw6S+R71r4jYjuZoLg.nFvCOA5MnGXe7EU2
EDFZ++eTdAzSoIYzJKFRJnYovNZQZFwC+GFrVLN+npE6Zdssq6HgBN5Kiy7i
v3FEaeqA294dO+IGqc4leEQ2b2YgxaFc1rhxRSlK5l6t1rYqnUwjJnGIw2iX
2YDQtvJlnwkjoEVR6kNnjCla38yKFSqNp+jVdjn9Rge37tkukSGqqJ5tdb0c
WPMK0zVESgcFNav7OsyxcIC7EBKnFGXt6tfOjD9U3+.Sm1cW
-----------end_max5_patcher-----------
2 Likes

Thanks for explaining all this and the feedback on the patch- starting to see how these all come together…

Going to spend some time running some sounds through and listening to the ordering.

1 Like