I’ve been studing the Nature of Code book and reached the section on Perlin Noise. I got an idea - I can use Perlin noise to generate a table of audio wave tables that I can load into sample-based music programs.

I want to write a tutorial about this. I wrote a Java program that works, but I borrowed the Perlin functions from Processing.

I want to share example on github under the LGPL. Can I use the code that I borrowed from here, if I give the proper credit? What exactly to I need to do?

1 Like

Processing does not use actual Perlin noise. The Processing noise function was borrowed from a demo coding group and shares similar design ideas with Perlin noise but is possibly a little more efficient. If you search, you might be able to find the discussion of its origin.

If you want actual Perlin noise, or the somewhat better (faster at higher dimensions) simplex noise that Ken Perlin came up with a few years later, there are web sites out there with cleaner implementations. https://github.com/KdotJPG/OpenSimplex2 is one of the better ones which has implementations in several languages including Java.

1 Like

Hi @damaru

I agree with everything @scudly said. Also, the discussion about the nature of noise() in Processing and p5.js is here: noise() is not Perlin noise · Issue #7430 · processing/p5.js · GitHub

To answer your specific question: the core libraries of Processing are licensed under LGPL 2.1. This means you can reuse the code under these conditions:

  • You must clearly state any significant changes you made to the software.
  • You must also provide access to the source code of the parts you modified, under the same LGPL 2.1 license.

You can find more details about Processing’s licensing here.

1 Like

Thanks so much, that’s helpful!

Thanks very much! I mainly wanted to know if the original authors of that code wanted some sort of attribution, but I’ll checkout OpenSimplex first.

For music, you might want to create a periodic (repeating) noise signal. And for speed you might like to create the signal on the GPU writing the values to a texture or SSBO. If so, https://jcgt.org/published/0011/01/02/ describes a GPU-based (GLSL) optionally-periodic version of simplex noise. The code is available at https://github.com/stegu/psrdnoise/tree/main/src with tutorials and demos at https://stegu.github.io/psrdnoise/.

Here is my example using it to generate a real-time flow field: https://openprocessing.org/sketch/2364364.

Thanks, I’ll check that out. My immediate use case is to generate files I can load into Pigments, a software instrument that can load 256 waveforms of 2048 samples each (in one big file), and transition between them. Here’s a screen shot showing one of the wavetables they provide. I was able to generate a similar wavetable using the 2D noise function from Processing.

1 Like