Jump to content

Noise generators?


Recommended Posts

I've been looking around for implementations of noise generators for autoit, but as of yet have had no luck :( More particularly, I'm looking for an x octave noise generator, but I haven't found any for autoit.

Has anyone seen any x octave or perlin noise generators for autoit?

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

I have backup this from the forum but it is a frequency generator.

#AutoIt3Wrapper_UseX64=n
#include "Bass.au3"

Global $nFreq = 5000 ; Hz
Global Const $pi = ATan(1) * 4

_BASS_Startup()
_BASS_Init(0, -1, 44100, 0, "")

Global $hSample = _Bass_SampleCreate(88200, 44100, 1, 1, $BASS_SAMPLE_LOOP)

Global $tSampleData = DllStructCreate("short[44100]")
Global $fTmp = $pi * 2 / (44100 / $nFreq)
For $i = 1 To 44100
DllStructSetData($tSampleData, 1, 32767 * Sin($i * $fTmp), $i)
Next
_Bass_SampleSetData($hSample, DllStructGetPtr($tSampleData))


Global $hChan = _Bass_SampleGetChannel($hSample, 0)
_BASS_ChannelSetVolume($hChan, 30)
_Bass_ChannelPlay($hChan, 0)

Sleep(5000)

_Bass_SampleStop($hSample)
_BASS_SampleFree($hSample)
_BASS_Free()

You need to download BASS UDF :

Edited by TheDaverMan
Link to comment
Share on other sites

I'm not looking for frequency noise, I'm looking for mathematical noise...

This wiki article explains it better than I could. http://en.wikipedia.org/wiki/Perlin_noise

Perlin noise generates something like this, and is used in things like photoshop to make clouds

Posted Image

Simplex octave noise generators give a somewhat similar output, but (in other languages at least) are faster, and you can configure the contrast and spacing between light and dark areas.

http://en.wikipedia.org/wiki/Simplex_noise

Also note, that some noise generators will produce the same random looking result if you give it the same input conditions. I want to use autoit to experiment with noise functions, because I don't know other languages very well. Does anyone know if either noise generator has been made?

Edited by corgano

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

You've probably come across this link but it does contain Java code for perlin and simplex noise algos. I'm not smart enough to convert it to AutoIt though.

http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf

edit: forgot the link...stupid.

Edited by spudw2k
Link to comment
Share on other sites

With pure AutoIt the calculation will be very slow!

Anyway, on German web site there was a competition creating the fastest Perlin Noise without using any 3rd party stuff.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

I figured a pure autoit functions would be slow (unless someone would crazy enough to write it in assembly inside an autoit script, trancexx :P). I was hoping a solution like the free library already had someone write a wrapper for it, but I guess none exists. Sadly, I'm only good enough to use the functions, but not enough to write a wrapper for them :(. I'll see what the german site has

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

ImageMagick's "Plasma" function is a perlin noise generator.

This...

$img = ObjCreate("ImageMagickObject.MagickImage.1")
$perlin = $img.Convert("-size","256x256","plasma:fractal","-blur","0x2","-colorspace","Gray","plasma_greyscale.jpg")

..creates this...

Posted Image

Read more about it here...

www.imagemagick.org/Usage/canvas/index.html#plasma

(be sure to read further down about seeding and repeating, you can create tileable pics :) )

Also check out Fred's perlin noise script using imagemagick, for *Nix but maybe you can convert it to autoit.

http://www.fmwconcepts.com/imagemagick/perlin/index.php

Edited by Werty

Some guy's script + some other guy's script = my script!

Link to comment
Share on other sites

So, was it useful ? or did you miss my post ? :)

Just asking as I'm interested in it too, for a terrainmaker for IRRlicht and other 3d engines that people got working with autoit.

Dunno if you found a better solution.

Some guy's script + some other guy's script = my script!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...