# Tweak mode not working with OpenSimplexNoise.java

**URL:** <https://discourse.processing.org/t/tweak-mode-not-working-with-opensimplexnoise-java/36494>\
**Category:** Processing\
**Created:** [April 21, 2022, 1:20pm UTC](https://discourse.processing.org/t/tweak-mode-not-working-with-opensimplexnoise-java/36494 "2022-04-21T13:20:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Namrad](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/namrad/32/15938_2.png) [@Namrad](https://discourse.processing.org/u/Namrad)\
**Post date:** [April 21, 2022, 1:20pm UTC](https://discourse.processing.org/t/tweak-mode-not-working-with-opensimplexnoise-java/36494/1 "2022-04-21T13:20:48Z")

</div>

Hello,

For me Processing’s Tweak Mode doesn’t seem to work together with [Kurt Spencer’s OpenSimplex noise class](https://gist.github.com/KdotJPG/b1270127455a94ac5d19). Whenever I use the Shift+Command+T key-combination to enter Tweak Mode I get the following error:

```auto
java.lang.NumberFormatException: For input string: "6364136223846793005"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.base/java.lang.Integer.parseInt(Integer.java:652)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at processing.mode.java.tweak.Handle.<init>(Handle.java:77)
	at processing.mode.java.tweak.SketchParser.addAllDecimalNumbers(SketchParser.java:198)
	at processing.mode.java.tweak.SketchParser.addAllNumbers(SketchParser.java:100)
	at processing.mode.java.tweak.SketchParser.<init>(SketchParser.java:82)
	at processing.mode.java.JavaMode.handleTweak(JavaMode.java:148)
	at processing.mode.java.JavaEditor.lambda$handleLaunch$27(JavaEditor.java:1021)
	at java.base/java.lang.Thread.run(Thread.java:829)

```

This refers to the 65th line of code in this noise class, which reads:

```auto
      seed = seed * 6364136223846793005L + 1442695040888963407L;

```

I’m confused why the error I get is a NumberFormatException, or how Tweak Mode and this numerical value in the seed calculation have anything to do with each other in the first place. Is it because the noise class has the .java extension?

Is this a problem which could likely be circumvented someway? Has anybody else run into this?  
Any help would be much appreciated!

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [April 22, 2022, 9:20am UTC](https://discourse.processing.org/t/tweak-mode-not-working-with-opensimplexnoise-java/36494/2 "2022-04-22T09:20:29Z")

</div>

You’ve discovered a limitation (one could go as far to say a bug) with tweak mode.

Tweak mode is treating all non-decimal numbers as integers, but the value here is a long datatype (it far exceeds the largest possible integer size: 2147483647), hence a `NumberFormatException` when the code attempts to parse the large long value as an integer.

Modify those values to make them smaller than 2147483647 and that should fix things.

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [April 28, 2022, 6:31pm UTC](https://discourse.processing.org/t/tweak-mode-not-working-with-opensimplexnoise-java/36494/3 "2022-04-28T18:31:05Z")

</div>

Were you using Processing 3? This seems to be fixed in Processing 4.

---

<div class="post-metadata">

**Author:** ![Namrad](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/namrad/32/15938_2.png) [@Namrad](https://discourse.processing.org/u/Namrad)\
**Post date:** [May 9, 2022, 8:30am UTC](https://discourse.processing.org/t/tweak-mode-not-working-with-opensimplexnoise-java/36494/4 "2022-05-09T08:30:18Z")

</div>

Oh! Really? Which version of Processing did you use where it worked? I tested it with version 4.0b1 initially, and in the most recent version (4.0b8) the issue still persists.

 ![Screenshot 2022-05-09 at 10.29.46](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/6/1/616de06c6bd94c9585c8406631fc84f12e09a642.png)
