# To slice or not to slice

**URL:** <https://discourse.flucoma.org/t/to-slice-or-not-to-slice/2818>\
**Category:** Getting Started and Wayfinding\
**Created:** [July 8, 2026, 12:28am UTC](https://discourse.flucoma.org/t/to-slice-or-not-to-slice/2818 "2026-07-08T00:28:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![areacode](https://discourse.flucoma.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@areacode](https://discourse.flucoma.org/u/areacode)\
**Post date:** [July 8, 2026, 12:28am UTC](https://discourse.flucoma.org/t/to-slice-or-not-to-slice/2818/1 "2026-07-08T00:28:51Z")

</div>

Hi all -

I am revisiting FluCoMa, trying to understand some old code in SuperCollider. I can never quite tell if I should be posting in the “Getting Started” forum since I keep getting started, over and over again.

My general approach with buffer manipulation has generally been to slice up a buffer first, and then perform analysis on short snippets - but I’ve been wondering if there’s an approach to slicing the buffer based on the analysis.  
With something like FluidBufOnsetSlice, I am breaking snippets into fragments dictated by volume - but maybe I would like fragments based on how long a spectral centroid is within 10% of the first-detected frequency..

Is there a way to do this? Would anyone consider helping me refresh my memory in how to get started?

Thanks for everything!

---

<div class="post-metadata">

**Author:** ![tremblap](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tremblap/32/5_2.png) [@tremblap](https://discourse.flucoma.org/u/tremblap)\
**Post date:** [July 8, 2026, 10:59am UTC](https://discourse.flucoma.org/t/to-slice-or-not-to-slice/2818/2 "2026-07-08T10:59:13Z")

</div>

Hello

Thank you for this. It is beyond starting, as you say, because you have the vocab and concepts and experience of tutorials already. Let me jump in on different questions you asked, with a few nuances and proposals.

> [@areacode](#):
>
> My general approach with buffer manipulation has generally been to slice up a buffer first, and then perform analysis on short snippets - but I’ve been wondering if there’s an approach to slicing the buffer based on the analysis.

This is normal - this is what we ‘teach’ as a simpler workflow. But you are absolutely right to challenge this, because it might not work for your current use.

> [@areacode](#):
>
> With something like FluidBufOnsetSlice, I am breaking snippets into fragments dictated by volume

Technically, it is by spectral difference (if the sound gets more-or-less suddenly brighter). You can also use Novelty and track the changes of spectrum, mfcc, pitch…

> [@areacode](#):
>
> I would like fragments based on how long a spectral centroid is within 10% of the first-detected frequency..
> 
> Is there a way to do this?

Currently, not simply, but nothing like rocket science either.

first I would AmpGate to make sure you analyse stuff about silence. that should give you long segments.

Then you could analyse those for centroids, then import buffer that in the language. you’ll get a time-series that has the right sample rate (the audio sample rate divided by the hop size) and you can process that Array in SC. You can do that with the pitch too, and decide what you mean by ‘first detected pitch’ (first after silence, first large confidence, etc)

Then you will get a frame address of where to cut. you convert that back to the original sample rate and you have a splice point.

I hope this helps?

---

<div class="post-metadata">

**Author:** ![lauraparker](https://discourse.flucoma.org/letter_avatar_proxy/v4/letter/l/f4b2a3/32.png) [@lauraparker](https://discourse.flucoma.org/u/lauraparker)\
**Post date:** [November 15, 2026, 8:37am UTC](https://discourse.flucoma.org/t/to-slice-or-not-to-slice/2818/3 "2026-11-15T08:37:47Z")

</div>

One concrete way: don’t pre-slice. Run FluidBufSpectralShape (centroid) over the AmpGated buffer, then read the destination buffer into a FloatArray in SC. Smooth it briefly (3–5 frame median) and use a simple state machine: choose the first stable centroid above your silence/noise floor as reference; scan until the value leaves ±10%; mark a boundary; start the next reference after a minimum segment length. Convert frame indices with hopSize/sampleRate. The same scan works for pitch after you define “first detected” as, say, first stable voiced frame.
