# Segmentation by clustering

**URL:** https://discourse.flucoma.org/t/segmentation-by-clustering/510
**Category:** Code Sharing
**Created:** [June 7, 2020, 4:54pm UTC](https://discourse.flucoma.org/t/segmentation-by-clustering/510 "2020-06-07T16:54:52Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![rodrigo.constanzo](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/rodrigo.constanzo/32/12_2.png) [@rodrigo.constanzo](https://discourse.flucoma.org/u/rodrigo.constanzo)
#### Post date: [June 8, 2020, 6:08pm UTC](https://discourse.flucoma.org/t/segmentation-by-clustering/510/8 "2020-06-08T18:08:38Z")

</div>

First, this is really cool!

I, too, have had a hard time finding meaningful segments “automatically” by running longer bits of audio through any of the slicers. The friction in testing changes also slows things down as it’s hard to see/hear the results without building a load of plumbing around the process.

> [@jamesbradbury](#):
>
> I am able to find segmentation parameters (with `noveltyslice~` ) that are quite brittle and so a small change can easily produce too many or too little segments. Under segmenting a file is a huge loss in useful information while over segmenting makes it really hard to know what is meaningful while still often giving you the right slice somewhere in the mess of things.

This got me thinking that it would be super awesome to have a tweakable interface (like Reaper or Simpler) where you can adjust parameters and see the slices adjust in real-time. Obviously for some processes that’s not possible, but you could pre-render a load of settings. Somewhat like @tremblap’s automatic threshold finder, you can select a rough ballpark of slices you want, or a rough starting threshold, and then it would iterate through stuff (like in @tremblap’s patch), but what I’m suggesting would then cache all the results along the way, so you can scroll through some of the settings to find what you need. Or if you have time to spare, have it run in a way that generates a ton of outputs where you can then tweak the thresh in “realtime” and see the results of the slices in the material.

A super complex (and useful) variation of this would be doing the same kind of thing, but with intermediary processes (i.e. what you’re doing in Pyton), so you can tweak things and see/hear results to assess how well it’s working, rather than rendering, checking, rendering, checking, rendering, checking etc…

---

_[View the full topic](https://discourse.flucoma.org/t/segmentation-by-clustering/510)._
