# Beziers with noise

**URL:** <https://discourse.processing.org/t/beziers-with-noise/36949>\
**Category:** Coding Questions\
**Created:** [May 18, 2022, 9:49pm UTC](https://discourse.processing.org/t/beziers-with-noise/36949 "2022-05-18T21:49:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)\
**Post date:** [May 18, 2022, 9:49pm UTC](https://discourse.processing.org/t/beziers-with-noise/36949/1 "2022-05-18T21:49:19Z")

</div>

Hi there,

I am doing a loop with bezier curves and I am trying to make small variations between them, as you can see on the picture. I have read that noise function is the best way to make these kind of variations but I have seen some different tutorials and I am not able to use it correctly. Could you please help me to understand what am I doing bad? Thanks!

![beziers noise](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/8/0/8007338b2ac6b46672585292fbc622d90eb5b3c7.jpeg)

```auto
float v = 0.0;
size (1000,1000);

noFill();
strokeWeight(3);
float n = noise(v);
for(int i=-100; i < 1200; i = i+10) {
bezier(0,i, 0,i+n, 0,i+100, 1000,i);

  }

```

---

<div class="post-metadata">

**Author:** ![The\_Traveler](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/the_traveler/32/16252_2.png) [@The\_Traveler](https://discourse.processing.org/u/The_Traveler)\
**Post date:** [May 18, 2022, 10:48pm UTC](https://discourse.processing.org/t/beziers-with-noise/36949/2 "2022-05-18T22:48:41Z")

</div>

Stepping through it with the debugger shows that the value of n doesn’t change in your loop.

---

<div class="post-metadata">

**Author:** ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)\
**Post date:** [May 18, 2022, 11:08pm UTC](https://discourse.processing.org/t/beziers-with-noise/36949/3 "2022-05-18T23:08:53Z")

</div>

thank you @The_Traveler , and how can I solve that?

---

<div class="post-metadata">

**Author:** ![The\_Traveler](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/the_traveler/32/16252_2.png) [@The\_Traveler](https://discourse.processing.org/u/The_Traveler)\
**Post date:** [May 18, 2022, 11:22pm UTC](https://discourse.processing.org/t/beziers-with-noise/36949/4 "2022-05-18T23:22:28Z")

</div>

I’ll give you a hint. You need to find a way to change the value of v and hence n on each iteration of your drawing loop. You might rearrange your code to fit inside the loop and perhaps use random() to generate a value for v within lower and upper limits. Perhaps placing your float n = noise(v) statement in the same block with your bezier function might work. Cheers.

---

<div class="post-metadata">

**Author:** ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)\
**Post date:** [May 18, 2022, 11:29pm UTC](https://discourse.processing.org/t/beziers-with-noise/36949/5 "2022-05-18T23:29:04Z")

</div>

Thanks for the hint. But even if I multiply v x times I don’t get nothing, so how could I do it?

---

<div class="post-metadata">

**Author:** ![The\_Traveler](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/the_traveler/32/16252_2.png) [@The\_Traveler](https://discourse.processing.org/u/The_Traveler)\
**Post date:** [May 18, 2022, 11:37pm UTC](https://discourse.processing.org/t/beziers-with-noise/36949/6 "2022-05-18T23:37:43Z")

</div>

Take a look at the Reference page for noise. There are at least 3 variations of setting parameters to noise() you can use or modify. [Reference / Processing.org](https://processing.org/reference/noise_.html) You may want to look into noiseSeed() and noiseDetail() to adjust the level of change in the Perlin noise function as well.

---

<div class="post-metadata">

**Author:** ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)\
**Post date:** [May 18, 2022, 11:42pm UTC](https://discourse.processing.org/t/beziers-with-noise/36949/7 "2022-05-18T23:42:37Z")

</div>

you are right! Now I have something! But the variations are so aggressive, how coud I make them softer?

```auto
float v = 0;
size (1000,1000);

noFill();
strokeWeight(3);
for(int i=-100; i < 1200; i = i+10) {
v = v + 0.1;  
float n = noise(v) * width;
bezier(0,i, 0,i+n, 0,i+100, 1000,i);

  }

```

---

<div class="post-metadata">

**Author:** ![The\_Traveler](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/the_traveler/32/16252_2.png) [@The\_Traveler](https://discourse.processing.org/u/The_Traveler)\
**Post date:** [May 19, 2022, 12:19am UTC](https://discourse.processing.org/t/beziers-with-noise/36949/8 "2022-05-19T00:19:08Z")

</div>

Good, your making progress. Perlin noise is subtle. You might try applying noiseDetail() as well to adjust it. [Reference / Processing.org](https://processing.org/reference/noiseDetail_.html) Once you have the parameters set to where you like them, usually by experimenting with them, there is no further need to adjust noiseDetail() in your rendering loop.
