# Visual Corpus Exploration Patch

**URL:** <https://discourse.flucoma.org/t/visual-corpus-exploration-patch/1154>\
**Category:** Code Sharing\
**Created:** [December 13, 2021, 12:59pm UTC](https://discourse.flucoma.org/t/visual-corpus-exploration-patch/1154 "2021-12-13T12:59:17Z")\
**Posts on this page:** 1\
**Page:** 2

<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:** [May 28, 2025, 1:41pm UTC](https://discourse.flucoma.org/t/visual-corpus-exploration-patch/1154/21 "2025-05-28T13:41:43Z")

</div>

Hello @Alisa

You know this patch is already done in SC as part of the [tutorial series](https://learn.flucoma.org/learn/2d-corpus-explorer/) done by @tedmoore ?

The final patch is available for download in the last youtube comments (or [here](https://learn.flucoma.org/examples/2d-plot/plotter-5-complete.scd). To query 5 items and get them to play sequentially, I have modified the `mouseMoveAction:` function (lines 115 to 124) to this:

```supercollider
		FluidPlotter(dict:dict,mouseMoveAction:{
			arg view, x, y;
			[x,y].postln;
			point.setn(0,[x,y]);
			~tree.kNearest(point,5,{
				arg nearest;
				if(nearest != previous){
					nearest.postln;
					view.highlight_(nearest);
					fork{
						nearest.do{
							arg near;
							~play_slice.(near.asInteger);
							0.3.wait;
						}
					};
					previous = nearest;
				}
			});
		});

```

Now this is dirty as it doesn’t retrieve the actual slice duration, but that should get you going 🙂

[Previous page](https://discourse.flucoma.org/t/visual-corpus-exploration-patch/1154.md?page=1)
