# FluidDataSeries....in SC

**URL:** https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202
**Category:** Development and Maintenance
**Created:** [February 9, 2024, 6:37pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202 "2024-02-09T18:37:02Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![mccrmck](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/mccrmck/32/1464_2.png) [@mccrmck](https://discourse.flucoma.org/u/mccrmck)
#### Post date: [February 9, 2024, 6:37pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/1 "2024-02-09T18:37:03Z")

</div>

Been playing a bit with these new toys: [New Object Early Community Build #3 and 4-5-6: FluidDataSeries, and DTW-based classification and regression - NOW IN SC TOO](https://discourse.flucoma.org/t/new-object-early-community-build-3-and-4-5-6-fluiddataseries-and-dtw-based-classification-and-regression-now-in-sc-too/2103/5) and I thought it might make sense to start a thread for the examples, helpfiles, whatever.

---

<div class="post-metadata">

### Author: ![mccrmck](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/mccrmck/32/1464_2.png) [@mccrmck](https://discourse.flucoma.org/u/mccrmck)
#### Post date: [February 9, 2024, 7:04pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/2 "2024-02-09T19:04:45Z")

</div>

The first thought I had was regarding accessing frames with `.getFrame` - it seems that the `identifier` arg needs to be a string (consistent with accessing values via `.dump` while the `time` argument needs to be an integer?

This, for example will pull out values from `~series`:

```auto
// assuming ~series is a populated FluidDataSeries, let's say from "2-classifier-example.scd"
(
b = Buffer(s);

fork{
    20.do({ |i|
        0.1.wait;
        ~series.getFrame("199", i ,b,{ b.getn(0,2,{|m| m.postln}) });
    })
}
)

```

…whereas my first assumption was to use `"t%".format(i)` instead of `i` to match the entries revealed by `~series.print`. I guess if it’s properly documented, it’s not a dealbreaker, just thinking out loud!

---

<div class="post-metadata">

### Author: ![mccrmck](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/mccrmck/32/1464_2.png) [@mccrmck](https://discourse.flucoma.org/u/mccrmck)
#### Post date: [February 9, 2024, 7:06pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/3 "2024-02-09T19:06:28Z")

</div>

…I could also imagine a `.getnFrames` method being useful, but this is of course easy enough to add myself if I desperately need it.

---

<div class="post-metadata">

### Author: ![mccrmck](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/mccrmck/32/1464_2.png) [@mccrmck](https://discourse.flucoma.org/u/mccrmck)
#### Post date: [February 9, 2024, 7:19pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/4 "2024-02-09T19:19:13Z")

</div>

Could it be that `FluidDataSeries.print` is also a bit funky? If I draw two gestures in the “2-classifier-example.scd” `FluidPlotter` and then call `~series.print` I get the following:

```auto
DataSeries 22: 
series: 2
cols: 2
18:
         t0: 0.24619 0.11675
         t1: 0.24619 0.11675
         t2: 0.24619 0.11675
       ...
         t7: 9.8813e-3244.9407e-324
         t8: 0.24619 0.11675
         t9: 0.24619 0.11675
36:
         t0: 0.20305 0.76142
         t1: 0.20305 0.76142
         t2: 0.20305 0.76142
       ...
         t9: 1 0
         t10: 0.20305 0.76142
         t11: 0.20305 0.76142

```

But if I run my `.getFrame` routine from above, I get the following values:

```auto
// identifier: 18
[0.24619288742542, 0.11675126850605]
[0.24619288742542, 0.11675126850605]
[0.24619288742542, 0.11675126850605]
[0.24619288742542, 0.11675126850605]
[0.26395937800407, 0.17512691020966]
[0.39340102672577, 0.37055838108063]
[0.78172588348389, 0.75126904249191]
[0.99746191501617, 0.93147206306458]
[1.0, 1.0]
[1.0, 1.0]

// identifier: 36
[0.20304568111897, 0.76142132282257]
[0.20304568111897, 0.76142132282257]
[0.20304568111897, 0.76142132282257]
[0.20304568111897, 0.76142132282257]
[0.20304568111897, 0.76142132282257]
[0.21827411651611, 0.75380712747574]
[0.43908628821373, 0.62436550855637]
[0.68781727552414, 0.4340101480484]
[0.99746191501617, 0.18020305037498]
[1.0, 0.06091370433569]
[1.0, 0.012690355069935]
[1.0, 0.0]

```

I guess the duplicated values are from me moving my mouse too slowly, but are the `.print` values wrapping somewhere? Or have I misunderstood how to read the labels given by `.print`?

---

<div class="post-metadata">

### Author: ![mccrmck](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/mccrmck/32/1464_2.png) [@mccrmck](https://discourse.flucoma.org/u/mccrmck)
#### Post date: [February 23, 2024, 1:29pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/5 "2024-02-23T13:29:51Z")

</div>

At the risk of being a nag @tremblap, I wonder if you have any thoughts about these observations? Or if you can even reproduce them?

---

<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: [February 23, 2024, 2:07pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/6 "2024-02-23T14:07:11Z")

</div>

It’s on my radar - other fires are sadly bigger now but I’m coming

---

<div class="post-metadata">

### Author: ![mccrmck](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/mccrmck/32/1464_2.png) [@mccrmck](https://discourse.flucoma.org/u/mccrmck)
#### Post date: [February 23, 2024, 2:16pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/7 "2024-02-23T14:16:15Z")

</div>

All good! Just wanted to make sure this didn’t get swallowed by the void…good luck with the firefighting 🚒 🧯

---

<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: [February 29, 2024, 1:10pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/8 "2024-02-29T13:10:50Z")

</div>

Hey @mccrmck thanks for this thorough interface poking. I think we should keep it within the other since the questions you ask are not SC but more DataSeries ones (across all CCEs)

in all cases, they are very useful so thanks.

> [@mccrmck](#):
>
> The first thought I had was regarding accessing frames with `.getFrame`

ok maybe we should have called it getPoint - in effect it took me a few look at the code to remember how it goes. It is like DataSet getPoint, but needs the extra argument of knowing when in time it needs to happen. I will most probably change the name now to getPoint, which makes me reply to:

> [@mccrmck](#):
>
> I could also imagine a `.getnFrames` method

which could be implemented there, although the output would now be the same as get series but with a start and numframes… so I wonder if it is not better to keep it non-existant and use the (amazing) fluidbufcompose to truncate what we need?

---

<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: [February 29, 2024, 1:23pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/9 "2024-02-29T13:23:35Z")

</div>

> [@mccrmck](#):
>
> my first assumption was to use `"t%".format(i)`

this is a valid assumption. but maybe we should just remove the t in the printout…

> [@mccrmck](#):
>
> Could it be that `FluidDataSeries.print` is also a bit funky? I

it is - you found a bug!

ok I’ll sort that one.

---

<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: [February 29, 2024, 3:17pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/10 "2024-02-29T15:17:32Z")

</div>

> [@tremblap](#):
>
> it is - you found a bug!

fixed in a new version. thanks!

---

<div class="post-metadata">

### Author: ![mccrmck](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/mccrmck/32/1464_2.png) [@mccrmck](https://discourse.flucoma.org/u/mccrmck)
#### Post date: [March 1, 2024, 1:40pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/11 "2024-03-01T13:40:42Z")

</div>

> [@tremblap](#):
>
> keep it non-existant and use the (amazing) fluidbufcompose to truncate what we need?

Yeah, no need to clutter up the method list if we already have great tools! 😉

---

<div class="post-metadata">

### Author: ![tedmoore](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tedmoore/32/439_2.png) [@tedmoore](https://discourse.flucoma.org/u/tedmoore)
#### Post date: [March 1, 2024, 2:19pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/12 "2024-03-01T14:19:00Z")

</div>

Where is this new version? Are these tools on a branch on GH?

---

<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: [March 1, 2024, 3:00pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/13 "2024-03-01T15:00:06Z")

</div>

they are in a PR - I’ll make the interface change discussed elsewhere and I’ll compile new stuff for people

---

<div class="post-metadata">

### Author: ![tedmoore](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tedmoore/32/439_2.png) [@tedmoore](https://discourse.flucoma.org/u/tedmoore)
#### Post date: [March 1, 2024, 5:15pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/14 "2024-03-01T17:15:08Z")

</div>

I can pull the PR. I’m guessing there’s one on core and sc?

---

<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: [March 1, 2024, 5:30pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/15 "2024-03-01T17:30:50Z")

</div>

and one in docs, yes

I’ll change the printing and format and all what we discussed in the other thread later this weekend

---

<div class="post-metadata">

### Author: ![tedmoore](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tedmoore/32/439_2.png) [@tedmoore](https://discourse.flucoma.org/u/tedmoore)
#### Post date: [March 1, 2024, 11:50pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/16 "2024-03-01T23:50:56Z")

</div>

I see now this might be spread out over multiple PRs, so I will indeed wait for your compile…

---

<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: [March 2, 2024, 9:19am UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/17 "2024-03-02T09:19:50Z")

</div>

it is a single PR for each feature indeed… but they all have a similar core.

---

<div class="post-metadata">

### Author: ![tedmoore](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tedmoore/32/439_2.png) [@tedmoore](https://discourse.flucoma.org/u/tedmoore)
#### Post date: [March 14, 2024, 6:23pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/18 "2024-03-14T18:23:25Z")

</div>

Are these compiled yet!? Excited to get my hands on them!

---

<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: [March 14, 2024, 7:24pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/19 "2024-03-14T19:24:28Z")

</div>

they are, and 2 out of 3 classes done

---

<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: [March 14, 2024, 7:24pm UTC](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202/20 "2024-03-14T19:24:37Z")

</div>

but without examples they are not super useful 😃

[Next page](https://discourse.flucoma.org/t/fluiddataseries-in-sc/2202.md?page=2)
