Ignotus-mago / PixelScanner

Scan 2D pixel maps to 1D arrays derived from space-filling curves.
Other
0 stars 0 forks source link

Currently I am refactoring and rewritng this library, which has so far just been used for my own generative art. I am preparing it for public release, I hope! Many of the current classes are going away before the public release, though they may survive in my personal library to support old code. The new classes are: PixelAudioMapper and the abstract class PixMapGen and its child classes. These two classes are extensively notated, and I hope my explanations make sense. PixelAudioMapper is the one to read first. PixMapGen classes provide it with the Lookup Tables it uses.

PixelScanner is a Processing Library that provides an interface and various implementing classes for moving between 2D bitmaps and 1D arrays in pixel orders determined by space-filling curves such as a zigzag pattern, a Hilbert curve, and a Moore curve. It works the other way around, too: you can turn a 1D signal (including live or recorded audio) into a 2D image. I created it specifically to aid in a project that makes extensive use of Hilbert and Moore curves for creating a sort of color organ where sine waves determine the mix of pixel values (i.e., colors).

PixelScanner is developed from the Processing Library Template, traces of which will undoubtedly persist until I have everything edited.

I am developing this library to aid in developing several small apps that move between 1D signals and 2D images in a consistent way. I figured keeping the code in a library would assure that. It will also re-educate me on how to create libraries for Processing with the new template. The experience will help me to plan the next release of IgnoCodeLib, an extensive library for P3+ featured on the Processing Libraries Page at processing.org and in the P3 distribution.

For people who would like to experiment with methods for proceeding from 1D signals to 2D images in various interesting ways, this library should at least provide a place to get started. Here's a sample video (https://www.flickr.com/photos/ignotus/52132647816/) of my project for 150 Media Stream. I expect the sample code to include the following as-yet-unreleased examples: