# Biasing a query

**URL:** <https://discourse.flucoma.org/t/biasing-a-query/506>\
**Category:** Pre-Release Toolbox2 New Ideas\
**Created:** [June 2, 2020, 12:17am UTC](https://discourse.flucoma.org/t/biasing-a-query/506 "2020-06-02T00:17:40Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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:** [June 20, 2022, 9:16pm UTC](https://discourse.flucoma.org/t/biasing-a-query/506/10 "2022-06-20T21:16:23Z")

</div>

Kind of an old bump here, but I think this thread is the most relevant to this discussion/idea.

After getting some ok results [using a regressor to use a short analysis window to predict a longer one](https://discourse.flucoma.org/t/regression-classification-regressification/547/63) I was wondering how to best implement this in a patch.

Ideally I would take the realtime audio input (analysis window of 256 samples) and compare this to the corresponding window in the corpus,

_and also_

use the regressor on the realtime input to predict a longer window and then use that longer window to query the longer window in the corpus… with less weight.

I was thinking that a “lofi” solution to this would be to concatenate the realtime input descriptors/stats (8d) with the predicted/regressed one (also 8d) into a 16d point which would get compared to a concatenated 16d for the corpus (8d of the first 256 samples, and 8d of the first 4410 samples).

But this would give me a 50/50 weighting between the “real” data, and the predicted one.

So I was wondering if I could just double up on the initial 8d by duplicating them so each point would have:

> 8d of first 256samples  
> 8d of first 256samples (a literal duplicate)  
> 8d of predicted 4410samples

and that would be used to query:

> 8d of first 256samples (of corpus)  
> 8d of first 256samples (of corpus, a literal duplicate)  
> 8d of first 4410samples (of corpus)

I was thinking I could also achieve similar results by scaling the 8d of the 4410 windows down, but there aren’t simple ways to transform a buffer this way on the fly (as far as I know). I was thinking I could perhaps do something weird like creating a `fit` using `[fluid.normalize~ @min 0. @max 0.5]` and then use that to `transformpoint` the corresponding realtime input, but not sure if that would behave as I would expect.

Any thoughts on this kind of “lofi” weighting?

---

_[View the full topic](https://discourse.flucoma.org/t/biasing-a-query/506)._
