# Altering Magnitude of Noise Value at Specific Coordinate

**URL:** <https://discourse.processing.org/t/altering-magnitude-of-noise-value-at-specific-coordinate/19718>\
**Category:** Coding Questions\
**Created:** [April 13, 2020, 12:34am UTC](https://discourse.processing.org/t/altering-magnitude-of-noise-value-at-specific-coordinate/19718 "2020-04-13T00:34:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![heatmiser](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@heatmiser](https://discourse.processing.org/u/heatmiser)\
**Post date:** [April 13, 2020, 12:34am UTC](https://discourse.processing.org/t/altering-magnitude-of-noise-value-at-specific-coordinate/19718/1 "2020-04-13T00:34:22Z")

</div>

Hi, I’m wondering if there is a way to increase the magnitude of noise at specific coordinates. The code below allows me to create topography based on perlin noise. As one can see, I get a noise value for every i and j. I’d like to know if it’s possible to have the noise value of a specific i, j to be magnified by a factor of 2 for example. Thank you for any input.

```auto
final static int W = 512; // width of the map
final static int H = 512; // height of the map
final static float k = 0.002; // noise coefficient
final static float l = 30; // resolution

float[][] m; // height map

boolean topomap = false;

void setup() { // creating perlin noise within window
  size(512, 512);
  m = new float[W][H];
  for (int j=0; j<H; j++) {
    for (int i=0; i<W; i++) {
      m[i][j] = noise((W+i)*k,(H+j)*k);
    }
  }
}

void draw() { // drawing pixels
  loadPixels();
  for (int j=0; j<H; j++) {
    for (int i=0; i<W; i++) {
      if (!topomap) {
        pixels[W*j+i] = color(round(m[i][j]*l)*(255/l)); // show height with "l" resolution
      }
    }
  }
  updatePixels();
}

```

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [April 18, 2020, 6:59pm UTC](https://discourse.processing.org/t/altering-magnitude-of-noise-value-at-specific-coordinate/19718/2 "2020-04-18T18:59:54Z")

</div>

> [@heatmiser](#):
>
> if it’s possible to have the noise value of a specific i, j to be magnified by a factor of 2 for example.

One approach: what if you have a height map, `float [][]m` …

…and also you had a magnitude map, `float [][] mg`, which was normally filled with 1s, but sometimes 1.5s or 2s?..?

Are you trying to create a mountain?
