# Generating a table of audio wave tables for sample-based music programs

**URL:** <https://discourse.processing.org/t/generating-a-table-of-audio-wave-tables-for-sample-based-music-programs/46389>\
**Category:** Processing\
**Created:** [May 6, 2025, 6:36pm UTC](https://discourse.processing.org/t/generating-a-table-of-audio-wave-tables-for-sample-based-music-programs/46389 "2025-05-06T18:36:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scudly](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/scudly/32/5597_2.png) [@scudly](https://discourse.processing.org/u/scudly)\
**Post date:** [May 6, 2025, 6:36pm UTC](https://discourse.processing.org/t/generating-a-table-of-audio-wave-tables-for-sample-based-music-programs/46389/1 "2025-05-06T18:36:38Z")

</div>

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/](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](https://github.com/stegu/psrdnoise/tree/main/src) with tutorials and demos at [https://stegu.github.io/psrdnoise/](https://stegu.github.io/psrdnoise/).

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

---

<div class="post-metadata">

**Author:** ![damaru](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@damaru](https://discourse.processing.org/u/damaru)\
**Post date:** [May 6, 2025, 7:51pm UTC](https://discourse.processing.org/t/generating-a-table-of-audio-wave-tables-for-sample-based-music-programs/46389/2 "2025-05-06T19:51:38Z")

</div>

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.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/5/d/5d0fbf9c7f713e2bae7cd6589546c5ba432029ff.jpeg)

---

<div class="post-metadata">

**Author:** ![damaru](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@damaru](https://discourse.processing.org/u/damaru)\
**Post date:** [May 13, 2025, 1:56am UTC](https://discourse.processing.org/t/generating-a-table-of-audio-wave-tables-for-sample-based-music-programs/46389/3 "2025-05-13T01:56:10Z")

</div>

Yes, I do need to have a periodic source of noise so that you can loop over each waveform without having a glitch at the end. I came across a great solution for this, one that can be more generally applied to any Processing script, it’s just a couple of lines of Java that traverse a circle through the noise space:

> **[Noise loop / noise propagation (Processing) - bleuje](https://bleuje.com/tutorial3/)**
>
> This tutorial explains how to loop a value with noise, and then a perfect loop technique that’s similar to periodic function propagation from the previous tutorial but using noise and more …

I used that for my app which can be found here:

> **[GitHub - damaru-inc/waver: This generates audio wavetables.](https://github.com/damaru-inc/waver)**
>
> This generates audio wavetables.
