# Intended way to add/remove slices from a slice buffer?

**URL:** https://discourse.flucoma.org/t/intended-way-to-add-remove-slices-from-a-slice-buffer/832
**Category:** Usage Questions
**Created:** [March 13, 2021, 12:32pm UTC](https://discourse.flucoma.org/t/intended-way-to-add-remove-slices-from-a-slice-buffer/832 "2021-03-13T12:32:31Z")
**Posts on this page:** 6
**Page:** 1

<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: [March 13, 2021, 12:32pm UTC](https://discourse.flucoma.org/t/intended-way-to-add-remove-slices-from-a-slice-buffer/832/1 "2021-03-13T12:32:32Z")

</div>

Although I’m nowhere near that point at the moment, I was thinking that it would be good to have a visualizer for figuring out settings for the buf-based slicers (similar to [`fluid.datasetplot~`](https://discourse.flucoma.org/t/fluid-datasetplot-abstraction-for-2d-3d-visualization/783/2)).

Something that would run the buffer audio through a realtime equivalent to visualize envelopes as well as showing static threshold lines (ala Reaper), and perhaps some other stuff in terms of lockout timings etc…

Would also be nice to have something slick like @jamesbradbury thing which over segments and then joins things together, although I’m more directly interested in [chaining together segmenters](https://discourse.flucoma.org/t/chaining-onset-detectors-novelty-ampslice/503) to get the higher level novelty slicing, but with more precise amplitude-based segmenting to find where in the hop of the novelty slicer to _actually_ slice.

But all of this is to say that it struck me that I have no idea how would one remove, or worse, add slices to a buffer of slices. I guess for removing you can `peek~` everything out, and filter for zeros, and then `peek~` it all back in if you want to use it in a `fluid.context~`, but then it gets real fiddly if you have to keep track of when the “6th slice” is, as that no longer corresponds to a position in the buffer.

Worse still is the idea of adding _additional_ slices manually, ala what @tutschku has talked about wanting a couple of times. Where you use whatever process to find slices, then using some kind of UI to remove, or add, additional slices.

Of all of my many issues with buffers, I hadn’t really thought about how rigid it is in terms of position/compression/expansion.

Am I overlooking some kind of workflow here for how this is meant to happen?

---

<div class="post-metadata">

### Author: ![weefuzzy](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/weefuzzy/32/362_2.png) [@weefuzzy](https://discourse.flucoma.org/u/weefuzzy)
#### Post date: [March 13, 2021, 1:28pm UTC](https://discourse.flucoma.org/t/intended-way-to-add-remove-slices-from-a-slice-buffer/832/2 "2021-03-13T13:28:01Z")

</div>

We’ve not done anything particular on this. I would have thought that if you’re needing to mutate the list of slice points, then getting out of the buffer and leaving it in list / coll / dict form until / if you really need it back in a buffer again makes most sense.

---

<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: [March 13, 2021, 2:20pm UTC](https://discourse.flucoma.org/t/intended-way-to-add-remove-slices-from-a-slice-buffer/832/3 "2021-03-13T14:20:25Z")

</div>

That’s what I’ve generally done, but I just wondered if there was an intended “internal” way to remove/insert samples that I wasn’t aware of (some kind of slippery bufcomposing).

Obviously once you’re `zl`-ing, the sky’s the limit (if the sky is only 32k units high that is).

---

<div class="post-metadata">

### Author: ![alicee](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/alicee/32/497_2.png) [@alicee](https://discourse.flucoma.org/u/alicee)
#### Post date: [June 29, 2021, 11:20am UTC](https://discourse.flucoma.org/t/intended-way-to-add-remove-slices-from-a-slice-buffer/832/4 "2021-06-29T11:20:12Z")

</div>

Nice, yes. Coming super late to the party (has it finished? or is there an after party?) - considering the same requirements in SC. So pre-labelling a corpus with novelty slice, then live matching to it.  
There are some annoying small segments that I want to exclude … adding this here to note that it’s a musical requirement … will update if/ when we figure it out : )

---

<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: [June 29, 2021, 11:55am UTC](https://discourse.flucoma.org/t/intended-way-to-add-remove-slices-from-a-slice-buffer/832/5 "2021-06-29T11:55:37Z")

</div>

a good way is to make a corpus with the same label and put the durations as a dimension. You can then datasetquery with conditions on that to copy the other dataset. The datasetquery example has a few of those ideas of putting conditions on a given DS to prune another DS to a destination one, check the message `transformjoin`

---

<div class="post-metadata">

### Author: ![alicee](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/alicee/32/497_2.png) [@alicee](https://discourse.flucoma.org/u/alicee)
#### Post date: [June 29, 2021, 1:17pm UTC](https://discourse.flucoma.org/t/intended-way-to-add-remove-slices-from-a-slice-buffer/832/6 "2021-06-29T13:17:38Z")

</div>

Nice, thank you. This is likely more elegant than my impulse, which was just to hack an “ignore” list : )
