Another noob question on scaling non-overlaying corpora

Hi all there! I am glad to be participating for the first time in this forum, and as it couldn’t be other way, I have a very noob question I hope someone could help me understand and tackle a better solution.
I have scanned through the related topics and I know there have been many approaches and discussions regarding the topic of scaling non-overlaying corpora. From reading most of them I have come to the idea that there’s probably not a straight forward solution nor a universal one for every project. Unfortunately, I understand very little of maths and only the basics of AI/machine learning solutions to be able to work around a solution by myself. So here are some of the characteristics of my project just in case someone can think of a possible approach:

I am writing a piece for doublebass-flute and live electronics. I intend to do some live mosaicking with concatenative synthesis. The corpus I am using is pretty varied, all sounds coming from playing around, hitting, bowing and scratching a cheap aluminium pizza plate (and captured with a contact and condenser mic).

To ensure that most of the corpus is available for playing despite a direct match, I intend to scale it.
In order to do this I was thinking of:

  1. putting the analyzed corpus (descriptors and mfcc) into fluid.robustscale~ (as I read this would be better for non uniformly distributed data)
  2. doing the same with a analyzed target audio from the flute
  3. training a regression engine to fit the scaled flute descriptors with the raw flute descriptors
  4. feeding the live input analyzed descriptors to the regression engine and finally using this to find a match with fluid.kdtree~

There’s probably more than one conceptual mistake here so I apologize for the very noob question. I also apologize for duplicating topics. I felt my question was way simpler and steeper than all the exchanges that took place here and so I thought of begging a new one not to mess up the other ones.

I hope someone could give me a hand here!

Thank you very much and greets!

Hello and welcome

This is definitely not a noob question! It is actually one of the core questions of the whole project! So I will try to unfold a few ideas if you don’t mind - some of it might sound obvious, some of it cryptic - come back to me with what is not clear and I’ll try to help.

The workflow you describe is far from trivial: overlapping such different sonic material for musaiking implies a lot of very interesting questions and challenges.

  1. describing sound - what you care about for a musaik to be ‘right’ depends on how to describe it - this is contextual and very much dependent on your tastes and musical intention.

  2. how often you query for that is also not trivial: A full gesture? a granular stream? every attack? when it is loud?

Just talking about this could be really fun and would help me help you on how to get going with audio query… if that all sounds too complicated, let me know too, and I might have another approach to your quest.

Looking forward to hearing from you

p

I can offer some of my experiences trying to do similar things.

As @tremblap mentioned, the descriptors (and stats) will have a big impact on what you find. So picking descriptors (and stats) that are conceptually (and musically) meaningful to what you want to differentiate. For example, pitch may be important in your bass/flute, but perhaps quite static in the corpus of pizza plate sounds. So you may get a bunch of bad/junk info in the corpus which the matching will try to make sense of, which in my experience leads to a “stuck note”-type sound since the bad pitch data tends to all come back as a single value (0 or -999 or whatever).

Similarly the amount of each type of descriptor/statistic matters too. Say if you take MFCCs and stats, you’re looking at hundreds of values right there. Whereas you may have only 1-8 (depending on settings/stats) for loudness, meaning that in a nearest-neighbor matching sense, the loudness is almost irrelevant in the sea of MFCC numbers.

Towards that end, dimensionality reduction can be useful (e.g. making a reduced “timbre” space out of the MFCC/stats), but this can be a whole rabbit hole in and of itself. There’s some experiments/tests in this thread here.

A simpler solution/approach is to try just using descriptors/stats at the start as those are, roughly, in similar amounts. And depending on the units you use, can also be in similar scale (dB and MIDI pitch for example where 1 “unit” is roughly/equally perceptually different). That will let you get an analysis/process pipeline going and test other parameters like the playback speed, grain size, and other things that @tremblap mentions.

As perhaps a not so immediately useful aside, in my experience I found I get better (audible) results by doing no scaling of the data spaces at all, even if they are vastly different. I tried with robust scale, standardization, and normalization too. Again, this is likely specific to my approach/descriptors/corpora/input, so take that with a grain of salt. But I did want to say that “getting it working without fancy stuff” is usually a good place to start.

You probably don’t need (or want) a regressor at all in what you’re doing. You can just scale your corpus, then create a scaling for your input space (then transformpoint individual descriptor chunks) and fit a kdtree with the corpus and just find the nearest point from your scaled inputs.

@agustinissidoro I’ll make a little patch later, as simple as possible, to showcase the moving parts. That should get the discussion going with some sounds :slight_smile:

@agustinissidoro let me know if you are on Max SC or Pd so I can use the right one…

Hi! @tremblap and @rodrigo.constanzo Thank you both for your answers, they have been of great value. Also, sorry for the delay in the reply, I am in Argentina, some hours earlier.

Dear @tremblap, I am using Max. Also, your questions really got me thinking about what I am looking for as regards the electronics in my piece and particularly what I want to achieve with the mosaicking. I will try to answer as clearly as I can what I have thought so far:

  1. A good or right mosaiking to my purposes should be one that makes available the most varied sounds in the corpus. I like to think of a corpus as a whole complex identity, each sample being a particular, yet related, expression of that. With this in mind, a good mosaicing should be able to render this complexity audible as much as possible. This pseudo-spinozian explanation is the best I can do to describe my purpose. For the technical part, I am not so interested in direct matching, perhaps a “rigorous mosaiking”, as much as in having a consistent matching. This is perhaps the main reason I thought of scaling in the first place, but as @rodrigo.constanzo mentioned, I am probably wrong at this.

However, this poses a problem: the actions of the flute for the mosaiking part are mainly characterized by noise-air sounds combined with frulatti, something very “gestural”, but with little variety in terms of audio characteristics (or so I guess…). The “musical target” here is to have a smooth complex texture composed by the gestural flute actions plus the timbrically-colouring granual mosaiking. @rodrigo.constanzo 's contributions resonated to me here: what descriptors should work better here to grasp meaningful changes? Almost certainly not pitch.

  1. This kind of mosaiking I am describring should play for full gestures, almost non-stop and ongoing for the purpose of the smooth texture. Nonetheless, I have planned to include other kinds of electronics behaviour for other events, for example, the kind of rodrigo’s corpus playing in the sp library for loud attacks, but this should be trigger by an entierly different engine.

I am probably biased by the “getting it working with a lot fancy stuff” idea you mention @rodrigo.constanzo :sweat_smile: and so I will definetly try a more straight forward approach; I was giving too much importance to the preconception that playing the most varied sounds out of the corpus with small overlapping space would not be very effective, but I will follow your advice and try things as you suggested. Thank your as well for the explanation on scaling and discarding the need of a regression part. Also, I am learning tons with your sp library and it sounds amazing!

Thank you both for your kind answers and I hope I was clear enough while explaining the characteristics of the project.

Greets!

2 Likes

With what you’re describing, I would try different combinations of “vanilla” descriptors (e.g. centroid, loudness, flatness, etc…). MFCCs are great for timbre, but aren’t super great for material that is noise based (as in noisy sounding).

That’s great that you’re finding SP Tools useful. sp.concatsynth~ is essentially my solution to this using FluCoMa, though I prefer the overall sound and performance I get with C-C-Combine, which is completely different under the hood. The abstractions related to concat stuff in SP Tools are a bit more complex than necessary since there are loads of arguments/abstractions up and down the chain, but the core architecture is probably ok to look at in terms of structure.

It would make an easy jumping point to experiment with the playback parameters though. To see what kind of window size/density you want, etc…

@agustinissidoro this is interesting - but you still forgot to tell me when you want to match: as a continuous flow aka a granular process? every attack?

as for the matching, I would start with something simple, to hear what it yields, and then post here again with what is working and what isn’t in line with your musical explorations. This is exactly what @rodrigo.constanzo did and it worked out ok :slight_smile:

As a start point, let’s modify the patch from the browsing tutorial. Incoming.

This is ugly code, but there are a few variations from the 4th step of the tutorial

  1. I changed the centroid to a log centroid because I like that descriptor more
  2. I removed the default audio in and I analyse as a stream of descriptor. Way too fast but that is just to show one dirty way. playback can be done via a metro, or attacks, or delays after attacks, etc.
  3. I robust-scale 10-90 instead of full range normalisation

if you go through the numbers it should work, and start creative question - what you will get and how disapointed you are will enable to clarify the questions (how to trigger, how to describe, how to playback)

I hope this helps. I’ll use that in a session tomorrow in the same workflow

p


----------begin_max5_patcher----------
5680.3oc68z1bixijeNyuBNWyGta27jE8BucUcUk62wtWMEwF6vyP.u.dlIy
Va9seB0BarCuHLRXkYHSUIi.an6VsZ0cq9k+0mta0SY+HpXk0+s0e25t69We
5t63Wp5B2IFe2pWB+w5jvB9Ga05rWdIJsb08v8Ji9QI+5dOXUTFlWZU9bjU3
gMwYV+yCQ4uV+ASO7R1gxjnR9iwVb03M7ub1S+4ePw0ez8gkqeNNc2WxiVWB
vlqC8A66snXR0ePN7+fsev15+6zyONs9wipt1+9Sep5W2KIhwd.OEk2N3haA
bQm.27vWhJix+RTZ3SIQMwO3YT959H.OVs5dqUOElta0Q.uEr0A4TgeNNA7+
XyQVrRQ1nuyPh2MItKrLpcJ.58T.h2pNwx9vNWBG6ndb7hf6G6vWA1UlsaWx
HPDmqZpLlsJnW7DyQMJhOKho0+V6yh64q7hGAyLAupOF19QSafY01k+G2AXV
a9fXPHfbBr6tUaiSh9VTdQbVZiO8cqB2uuwkuqwWohj7mY7Gj+8GuTbJbIxw
KkG8s3KerrmaNCcJY3xgbNBu5GtzUmdLYahxSODeb9gO4H.I9zPJicoXe3Z3
KWMaUe6SDHjMBUQTB7q9sKky1S8aH7hMOuKIa8Wi1zfgiMWrOJMNcedTASfa
Xo.3Od6MQaCOjT9ksYokEw+jCBnJVtVt+VAH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sZOqZ+VXxgnrsu2wYmHBIYo65lvd1G8E1TT0Gy8nuEN+twbQC+
gmcq2mowZdojuo5Yf1dNUcwki9jf9olx2tJIIm4Ggg8TJ0SFYIWaOfUj9Tuy
kAsnorZDLTaU1YQE6vRTIzNkI1tQXcz2gNgy9CHEoINy+DmqtGPBtb+TAgn8
RS0wiKoqMQanV06H1x9lnmskcmkaOE7lNOcx6BmTxaxQh2DwSEuIOYdSXU7l
bkEmPS7MgkhivWA3DRp4IWUP8Px9llJ0SFFBUfQRwNnf2iCUhWjy4SjWdN4X
dgqxW3zgFiN9MNON5lAfEMDvRfSV1kbbz6AV6oArxrLSER38lIVEJQhWDVEu
IYdQ9pPTHYDaC2N+TkeaoWZgkGzu3wPyz77QTHWr8Z4qwukJPIY2uucTxqaL
h.MDzyG4RcZrvmOZpHgsLpRnBNMYzYIPEaEJyhTrsJdSxryAREzNjLRiQpPM
LjTL0TU7ljQQBGk7llMdbYPo2qBKXiyEA+R0q3hfd4h.d48A6R2A5xkA4B2m
fcEbKe5e+o+e.k8SzRA
-----------end_max5_patcher-----------
1 Like

Cool, that’s useful to see.

A couple differences and things to note (for @agustinissidoro) with the approach in SP Tools (and C-C-Combine).

In my approach I tend to load a single file (which is still possible in this example, but just replace-ing the buffer~ corpus instead of loading a folder) and then slice at a fixed interval, as opposed to onsets/slices. This is a large point of diversion as I end up with (usually (significantly)) more segments this way, as well as not necessarily having slices happening on “onsets”.

This approach also has the side effect of each grain/segment being the same size, which has ramifications further down the line for playback.

Another big point of divergence is in the playback/matching. Although it’s a relatively simple edit in the patch that @tremblap shared, this example is monophonic in that when a new match is found, it stops playing the current grain and immediately starts playing the next one. So even though the slices you are creating upstream are generally going to be of different sizes, each one is only played for amount of time based on your matching rate (which in this case looks like the signal vector size and/or @history amount in fluid.stats~).

I would drop my playback bit from SP Tools in, but it’s fundamentally different in that the example @tremblap posted presumes a single long (concatenated) buffer with variable start/end points. That small playback bit can be wrapped in a poly~ or made to use mc.play~ instead without much work.

Similarly to this last point, the match/playback rate is fixed based on the analysis pipeline. So you can also experiment with having periodic/aperiodic options here, as well as having different rates. A simple hack there would be to use zl reg and a metro to only send a match when you want:
Screenshot 2022-09-20 at 1.30.06 pm

This is kind of hacky as you’d ideally have your rate correlated with a similarly lengthed analysis length, but this could give you a different flavor of playback.

More ugly code, or as @jacob.hart so kindly captured, “garage code”

In this, after playing with the guitarist, I have:

  • added 13 MFCC of spectral descriptor (we’ll see how it fares tomorrow)
  • added a gate to my query - it only queries when there is sound coming in
  • removed all the temporary buffers using the generated buffers and the buffer message instead
  • used a simple dimension reduction algo (MDS is not as powerful as UMAP but it is much faster)

All of that in a few minutes, just for experimenting. So many more moving parts… and I reckon I could remove the first 2 (loudness and logcentroid) but I’ll try with the performer first to see how they feel…

I hope this helps



----------begin_max5_patcher----------
6226.3oc68rsbaqjiOm7UvUUdXmY8wC6K71T0tk2ef8GXloRQKQYyyghTKIU
RblZ729zrQSIJadARtapN1xoJ6PQIQ.z.nAPiK+yO+oE2W7ijpEN+Um+lym9
z+7ye5SxWp4E9j55OsXS7OVlEWIeaKVVrYSRd8haf6Um7iZ4qGdqS7tUoENO
DWmrx4+eWR4SN+0+T66aab8xGSye3qkIKqgmWPf+st23v78Z9Cwi07Gp6stN
+C0GJe2lz7rjZ4Slb3EK1U29ptpWMckDJJt+2+Ml6hlW6e84O27qaPhW4IeW
7geEZ0fMigCbITycoRTQ9aJcHTf1KJPdMJvaejvaq9osIvyawBm+wYfb0EO7
PFB7f4SjX.u82mxRQO3AI5vyrLdSRcR4WSxiuOKo6Z2qPxTA+0YgmCrH9+37
aDW2QPeefGjEFIWMYZZYjFsP6n3PxeA25TUGWV6T+XhRRTJCNBV6ERAzUyBf
b5YI.tay8IkiAtDIb54IWj7bGeQpenk1CzRNKdzE23r3937GzJi5DZa7BfEL
+.spsgEL2pa7fUONSupaXdVg5lsRIuzQYl8cAlYW4dfd9ZhYlQWLFC6h8e8R
PR.g.xovtOsXcZVx2RJqRKx67b+zh3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