# 3D Sample Scrubber (with Jitter)

**URL:** https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199
**Category:** Code Sharing
**Created:** [January 20, 2022, 10:35pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199 "2022-01-20T22:35:48Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![tmhglnd](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tmhglnd/32/1416_2.png) [@tmhglnd](https://discourse.flucoma.org/u/tmhglnd)
#### Post date: [January 20, 2022, 10:35pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/1 "2022-01-20T22:35:49Z")

</div>

Expanding a bit on the 2-dimensional sample explorer. Here is my 3d Sample Scatter Scrubber, a version that (also) uses the umap, but to 3-dimensions and plots all the samples between `-1` and `1` in a `jit.world`. You can then use the camera and `ASWD` keys to navigate the space (if you want complete freedom you can disable the `@locklook 1` in `gl.camera`). The points are highlighted based on the `knearest`, and with the `numneighbours` you can randomly play between a selection of samples in a granular style. It draws lines between recently played sounds. Hope you enjoy! And of course feedback or suggestions for improvement are welcome. This was nice to get me started again after the workshop in November.

> **[GitHub - tmhglnd/sample-scatter-scrubber: Plot and scrub through a set of...](https://github.com/tmhglnd/sample-scatter-scrubber)**
>
> Plot and scrub through a set of samples in 3D space organized based on their spectral description - GitHub - tmhglnd/sample-scatter-scrubber: Plot and scrub through a set of samples in 3D space org...

 ![screenshot](https://discourse.flucoma.org/uploads/default/original/2X/b/b4c209b486cd113e42bd14e350eadff232ce75ec.jpeg)

---

<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: [January 21, 2022, 8:13am UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/2 "2022-01-21T08:13:59Z")

</div>

I’ll check this later today or over the weekend, when less exciting things are done 🙂

thanks for sharing!

---

<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: [January 21, 2022, 10:18am UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/3 "2022-01-21T10:18:57Z")

</div>

ok I couldn’t resist - this is great!  
I get a lot of warnings while I load (the kdtree is looking for neighbours before it has a dataset fitted) but once everything is loaded, the interface is gorgeous! I love the history!

I see in the analysis that you didn’t use only the means but all the stats of all of them (as discussed in another thread) but it is easy to change for me to explore (numchans 2 uses means and stddevs)

lots of fun, thanks again for sharing!

---

<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: [January 21, 2022, 10:46am UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/4 "2022-01-21T10:46:46Z")

</div>

final note: the number of slices (numslices) made is actually not -1 but +1 the number of indices. In the list of slices you get, you should add the end of the full buffer before iterating them pair-wise, so you’d get from the last detected onset to the end of the buffer.

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [January 21, 2022, 11:18am UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/5 "2022-01-21T11:18:09Z")

</div>

Super cool! I think I might link to this thread in the [learn entry](https://learn.flucoma.org/overviews/2d-corpus-explorer).

---

<div class="post-metadata">

### Author: ![tmhglnd](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tmhglnd/32/1416_2.png) [@tmhglnd](https://discourse.flucoma.org/u/tmhglnd)
#### Post date: [January 21, 2022, 12:02pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/6 "2022-01-21T12:02:30Z")

</div>

Thanks for catching the errors. I fixed the errors in the latest commit, and also thanks for pointing out the num-slices. I joined the length of the buffer to the slices list as final point, so now the last one is included in the analysis as well.

---

<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: [January 21, 2022, 2:03pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/7 "2022-01-21T14:03:49Z")

</div>

> [@jamesbradbury](#):
>
> Super cool! I think I might link to this thread in the [learn entry](https://learn.flucoma.org/overviews/2d-corpus-explorer).

there is also a similar patch by @balintlaczko on the thread by @rodrigo.constanzo that could be linked here, since they go even further into the deep pit of jitter 3d navigation.

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [January 21, 2022, 2:25pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/8 "2022-01-21T14:25:46Z")

</div>

Excellent - cross links are my fav

---

<div class="post-metadata">

### Author: ![tmhglnd](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tmhglnd/32/1416_2.png) [@tmhglnd](https://discourse.flucoma.org/u/tmhglnd)
#### Post date: [January 22, 2022, 1:08pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/9 "2022-01-22T13:08:59Z")

</div>

Ah awesome, is there some repo or place where I can have a look at your 3D works @balintlaczko & @rodrigo.constanzo ? I’m curious 🙂

---

<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: [January 22, 2022, 2:15pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/10 "2022-01-22T14:15:22Z")

</div>

Here it is: no repo and a loooooong thread but the code is at this reply:

> [@Fluid.datasetplot~ abstraction for 2D/3D visualization](https://discourse.flucoma.org/t/fluid-datasetplot-abstraction-for-2d-3d-visualization/783/83):
>
> Hey guys. Had a nice chat with @rodrigo.constanzo the other day. I think my raycasting muscles are getting stronger. relaxed This version gets the point closest to where you click the mouse (in the jit.pworld) by casting a ray to (through) where you click, then getting the point, where the angle between the vector from the cam (kinda) to the point has the narrowest angle to the ray. Arguably not the most fail-proof method, but it seems to do the job: [datasetplot-raycast] The good thing abo…

---

<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: [January 22, 2022, 11:25pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/11 "2022-01-22T23:25:47Z")

</div>

Yup, that’s it. @balintlaczko did the heavy lifting for the proper 3d navigable-side of things. Not looked at this stuff in ages, but curious to see what you come up with if it’s of use/inspiration.

---

<div class="post-metadata">

### Author: ![balintlaczko](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/balintlaczko/32/1184_2.png) [@balintlaczko](https://discourse.flucoma.org/u/balintlaczko)
#### Post date: [January 26, 2022, 2:49pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/12 "2022-01-26T14:49:09Z")

</div>

Hey guys, inspiring work there, @tmhglnd, thanks for sharing! And as you found out we were way too unorganized to actually put the code in a repo, but hopefully the patches are still available in the forum thread.  
Some months later after that thread I went down the (dark) path of implementing an audiovisual piece using a ton of jitter and flucoma in tandem, but as always, I am a “bit” behind in the documentation of it. Technically it was fundamentally the same, 3D plotting, spaceship-style 6DOF navigation, and a ton of kdtree instances creating lightning strikes, wind, rain and other phenomena on the point cloud. Honestly, I was surprised how robust the flucoma implementation of the kdtree is, and I have grown to love working with it.  
Jitter on the other hand… _sigh_  
I hope it is enough to say that I immediately switched to using Unreal Engine after I finished this piece. 🙂

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [January 26, 2022, 6:29pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/13 "2022-01-26T18:29:30Z")

</div>

What is the landscape like for extending Unreal? Does it have an API for making extensions/plugins?

---

<div class="post-metadata">

### Author: ![balintlaczko](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/balintlaczko/32/1184_2.png) [@balintlaczko](https://discourse.flucoma.org/u/balintlaczko)
#### Post date: [January 26, 2022, 7:53pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/14 "2022-01-26T19:53:27Z")

</div>

It must do because there is an entire [marketplace](https://www.unrealengine.com/marketplace/en-US/store) of hundreds of plugins/packages. Lot of them are free, lot of them are not. They can be anything from blueprints, 3D model assets, or C++, shaders, and probably a lot more that I have no idea of.

---

<div class="post-metadata">

### Author: ![jamesbradbury](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/jamesbradbury/32/1252_2.png) [@jamesbradbury](https://discourse.flucoma.org/u/jamesbradbury)
#### Post date: [January 26, 2022, 10:58pm UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/15 "2022-01-26T22:58:42Z")

</div>

That could be an interesting parallel to explore for @tremblap later down the line as I know he is investigating (with great success) the compilation and use of FluCoMa in openframeworks right now. The game dev world is clearly meeting some need that is not supported by music-centric environments with bolt ons. [https://interactml.com/](https://interactml.com/) for example looks interesting for building interactive experiences supported by ML in Unity.

---

<div class="post-metadata">

### Author: ![balintlaczko](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/balintlaczko/32/1184_2.png) [@balintlaczko](https://discourse.flucoma.org/u/balintlaczko)
#### Post date: [January 27, 2022, 10:28am UTC](https://discourse.flucoma.org/t/3d-sample-scrubber-with-jitter/1199/16 "2022-01-27T10:28:52Z")

</div>

Oh this looks very nice. It would actually super powerful to have a suite of flucoma nodes available in the UE blueprint editor. But that would go beyond music and just would be a huge favor for game devs in general.
