<commit_before># LoveNoise - a Love Noise Wrapper library

__LoveNoise__ is a wrapper library for LOVE's noise functions.

Installation
------------

The lovenoise.lua and the presetnoise.lua files should be dropped into an existing project and require lovenoise.

```lua
lovenoise = require "lovenoise"
````

Examples
--------

Creating a new noise object:
```lua
-- This creates a new Noise object called testNoise which contains two noise
-- functions.
testNoise = lovenoise.newNoise({
								   {"fractal", 64, {3, 0.5, 2}},
								   {"simplex", 128}
							   })
-- The following lines sets testNoise's threshold and seed to 0.2 and 1337
-- respectively.
testNoise:setthreshold(0.2)
testNoise:setseed(1337)

-- The previous lines can also be done in this way:
testNoise:setthreshold(0.2):setseed(1337)
````

Using the new noise object:
```lua
-- This returns the value of the multiplied noise function values at position
-- x=0.2, y=0.5, thresholded by 0.2 and seeded by 1337.
local val = testNoise:eval(0.2, 0.5)
````

Noise Format
------------
```lua
{
	{"nameofnoise", scale, {args, if, any}},
	{"othernoise", scale, {args, if, any}},
	...
}
````

Available Noise Functions<commit_msg>readme update<commit_after># LoveNoise - a Love Noise Wrapper library

__LoveNoise__ is a wrapper library for LOVE's noise functions.

Installation
------------

The lovenoise.lua and the presetnoise.lua files should be dropped into an existing project and require lovenoise.

```lua
lovenoise = require "lovenoise"
````

Examples
--------

Creating a new noise object:
```lua
-- This creates a new Noise object called testNoise which contains two noise
-- functions.
testNoise = lovenoise.newNoise({
								   {"fractal", 64, {3, 0.5, 2}},
								   {"simplex", 128}
							   })
-- The following lines sets testNoise's threshold and seed to 0.2 and 1337
-- respectively.
testNoise:setthreshold(0.2)
testNoise:setseed(1337)

-- The previous lines can also be done in this way:
testNoise:setthreshold(0.2):setseed(1337)
````

Using the new noise object:
```lua
-- This returns the value of the multiplied noise function values at position
-- x=0.2, y=0.5, thresholded by 0.2 and seeded by 1337.
local val = testNoise:eval(0.2, 0.5)
````

Noise Format
------------
```lua
{
	{"nameofnoise", scale, {args, if, any}},
	{"othernoise", scale, {args, if, any}},
	...
}
````

Available Noise Modifiers
-------------------------

###:setthreshold(threshold)
Sets the threshold for the result value. If threshold is less than 0,
thresholding is disabled.

###:setseed(seed)
Sets the seed value for the noise object. If the function is called with no
arguments, it's set to the default value.

Available Noise Functions
{'fraction_non_alphanumeric': 0.14407092722571113, 'fraction_numerical': 0.030661248614702624, 'mean_word_length': 3.3536977491961415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1128868', 'n_tokens_mistral': 958, 'n_tokens_neox': 831, 'n_words': 321}