# Fluid.pitch to find the overall pitch changement when sweeping across three strings at once

**URL:** <https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061>\
**Category:** Usage Questions\
**Created:** [August 15, 2023, 3:41am UTC](https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061 "2023-08-15T03:41:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![panstudiollrl](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/panstudiollrl/32/2156_2.png) [@panstudiollrl](https://discourse.flucoma.org/u/panstudiollrl)\
**Post date:** [August 15, 2023, 3:41am UTC](https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061/1 "2023-08-15T03:41:29Z")

</div>

Hello everyone, I would like to find the overall pitch changement when sweeping across three strings at once, therefore I could map it to smoothy control the upward or downward sound source movement with surround panner or Ircam Spat. I am currently using the fluid.pitch but found my patch made the movement a little bit jumpy… is there better ways to do with ? Thanks alot !

[![](https://img.youtube.com/vi/iTVbjdsY9yQ/maxresdefault.jpg "3 strings portamento to pitch") ](https://www.youtube.com/watch?v=iTVbjdsY9yQ)

---

<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:** [August 15, 2023, 1:07pm UTC](https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061/2 "2023-08-15T13:07:38Z")

</div>

As far as I know, none of the algorithms in `fluid.pitch~` are polyphonic, so they may have a hard time picking up the pitch with these slides.

That being said, you can use `fluid.stats` to smooth things out a bit to see if that improves things.

You can also look at the centroid output in `fluid.spectralshape~` as that correlates strongly with “brightness”, and the slides do improve in “brightness” as you move up the neck.

You can also try a combination of things by looking at the confidence output of `fluid.pitch~` and if it as `> 0.8` then take the pitch value, and if it is `< 0.8` then use the centroid instead. That may still be jumpy as you go from one type of descriptor to another, but that may help a bit.

At minimum, looking at the confidence will let you know how well the pitch algorithm is working, as if the confidence is constantly low (which I suspect it may be, given your material is polyphonic) the algorithm isn’t going to be very accurate.

---

<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:** [August 15, 2023, 3:08pm UTC](https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061/3 "2023-08-15T15:08:42Z")

</div>

I’m in the middle of something else, but fluid.chroma is good for catching harmonic content change.

more soon

---

<div class="post-metadata">

**Author:** ![panstudiollrl](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/panstudiollrl/32/2156_2.png) [@panstudiollrl](https://discourse.flucoma.org/u/panstudiollrl)\
**Post date:** [August 16, 2023, 2:14am UTC](https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061/4 "2023-08-16T02:14:42Z")

</div>

Thank you very much for your suggestion. I’ve updated the patch (as shown in the video) and incorporated ‘zl’ to find the average values within several samples, resulting in a very smooth outcome. It seems that under the fluid.pitch detection, the confidence rarely exceeds 0.8 for my sound source. The use of centroid has been quite helpful, and I hope to make further modifications to enhance the accuracy of this detection!

[![](https://img.youtube.com/vi/o02Y2VJ-U4E/maxresdefault.jpg "3 strings sweeping and centroid") ](https://www.youtube.com/watch?v=o02Y2VJ-U4E)

---

<div class="post-metadata">

**Author:** ![panstudiollrl](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/panstudiollrl/32/2156_2.png) [@panstudiollrl](https://discourse.flucoma.org/u/panstudiollrl)\
**Post date:** [August 16, 2023, 2:15am UTC](https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061/5 "2023-08-16T02:15:33Z")

</div>

Sounds interesting, let me take a look!

---

<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:** [August 16, 2023, 9:00am UTC](https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061/6 "2023-08-16T09:00:04Z")

</div>

I also recommend using `@unit 1` for both, and in the case of spectralshape also adding `@power 1`. `@unit 1` does frequency to midi conversion which essentially makes the changes in frequency linear, rather than logarithmic, which is generally preferable (unless being used to drive an oscillator directly). This will also make your scaling at the end more linear as well (e.g. `scale 0. 127. 0. 1.`).

I’ve personally not played with chroma very much, so no practical suggestions there, but I can imagine it being quite useful here.

 ![Screen Shot 2023-08-16 at 9.57.43 am](https://discourse.flucoma.org/uploads/default/original/2X/9/95bc5947af684f31094759dc27f7a35582eb4688.png)

---

<div class="post-metadata">

**Author:** ![panstudiollrl](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/panstudiollrl/32/2156_2.png) [@panstudiollrl](https://discourse.flucoma.org/u/panstudiollrl)\
**Post date:** [August 17, 2023, 4:25am UTC](https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061/7 "2023-08-17T04:25:35Z")

</div>

Thanks again for your suggestion.

Using MIDI pitch is indeed a great idea! I’ve realized that I’m not familiar with many of the arguments of fluid objects. I’ll try various combinations to experiment further. Additionally, I’m also interested in attempting to control this part using Wekinator. I’m planning to give it a try today as well.

here’s the updated patch

[![](https://img.youtube.com/vi/tZJz7_Svs3o/maxresdefault.jpg "3 strings sweeping and fluid.spectralshape~") ](https://www.youtube.com/watch?v=tZJz7_Svs3o)

---

<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:** [August 17, 2023, 9:49am UTC](https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061/8 "2023-08-17T09:49:35Z")

</div>

Looking good.

Yeah tons of attributes in there. Thinking now, you can also experiment with the `@minfreq` and `@maxfreq` parameters of both. Since you don’t care about low pitches here starting at `@minfreq 200` may work well, then from there, experiment with the top end (5k? 8k?).

---

<div class="post-metadata">

**Author:** ![panstudiollrl](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/panstudiollrl/32/2156_2.png) [@panstudiollrl](https://discourse.flucoma.org/u/panstudiollrl)\
**Post date:** [August 24, 2023, 10:34am UTC](https://discourse.flucoma.org/t/fluid-pitch-to-find-the-overall-pitch-changement-when-sweeping-across-three-strings-at-once/2061/9 "2023-08-24T10:34:25Z")

</div>

With @minfreq 200 and @maxfreq 5000 it works very will 😁
