Package net.paulhertz.pixelaudio.example
package net.paulhertz.pixelaudio.example
Package
net.paulhertz.pixelaudio.example provides example Processing sketches and
demonstrations of PixelAudio library functionality. The sketches are available as .java files
in the PixelAudio library example package and as Processing sketches in the library
release. Both formats share data in the /PixelAudio/examples/examples_data directory.
If PixelAudio is new to you, I recommend starting with the Basic PixelAudio Features,
followed by the Intermediate to Advanced: Tutorial Series. After that, feel free
to check out the other examples and the Performance and Production Examples.
Basic PixelAudio Features
LookupTablesdemonstrates the creation and visualization of lookup tables for spatial indexing and mapping.Starteris a minimal example that demonstrates initializing PixelAudio with a PixelMapGen, mapping colors to the signal path, and displaying the result.MultiGenDemodemonstrates switching between multiple PixelMapGen implementations (Hilbert, Moore, DiagonalZigzag) to explore different spatial patterns.MultiGenLookupTablesgenerates and displays lookup tables for different curve generators, useful for understanding spatial mapping.SimpleWaveSynthdemonstrates setting up a WaveSynth as an animated visual display with gamma adjustment and multiple curve generators (Hilbert, Moore, DiagonalZigzag).SimpleAnimationdemonstrates basic animation of a spectral display mapped to a geometric pattern.
Intermediate to Advanced: Tutorial Series
TutorialOne_01_FileIOcovers file I/O operations including loading and saving audio and image files with PixelAudio.TutorialOne_02_Animationdemonstrates basic pixel-shifting animation techniques within a standard framework for shifted pixel and audio indexing. Introduces the Sampler audio synthesis instrument.TutorialOne_03_Drawingenables interactive gesture drawing and real-time synthesis, with curve modeling and display control. Introduces the Granular synthesis instrument.TutorialOne_04_Networkdemonstrates network communication capabilities using UDP for remote control and data exchange with external applications.TutorialOne_05_GesturePlaygroundprovides an interactive playground for gesture-driven sampler and granular synthesis with full parameter control through a GUI.TutorialOne_06_WindowBufferdemonstrates window buffer management for streaming audio processing and sample-accurate control.
Audio and Image I/O
LoadImageToAudioloads an image file and converts it to audio using a PixelAudioMapper, demonstrating image-to-signal conversion with playback: an early but still useful example.LoadAudioToImageloads an audio file and converts it to a visual representation using a PixelAudioMapper: an early but still useful example.
Introduction to WaveSynth Series
BigWaveSynthdemonstrates basic features of a color organ that uses additive sine wave synthesis.BigWaveSynthAudioextends BigWaveSynth with audio output capabilities, enabling real-time sonification of visual patterns.JSONWaveSynthdemonstrates JSON-based serialization and loading of waveform parameters for configuration management.
Performance and Production Examples
Bagatelleis a comprehensive interactive audio-visual performance tool supporting brush management, session saving/loading, gesture recording, and real-time granular synthesis with extensive preset library support and a graphical user interface.DeadBodyWorkFlowis a near duplicate of Bagatelle. This example will be dropped in a future edition. Available in Eclipse version only.WaveSynthEditorprovides a GUI for editing WaveSynth color organ parameters. It can construct complex spectral and visual compositions that can be output to video. WaveSynth parameters can be saved to or retrieved from a JSON file.WaveSynthSequencerdemonstrates sequencing with the WaveSynth color organ, with frequency, rhythmic timing, and image generation.ArgosyMixeris a specialized mixing and synthesis tool for rhythmic pattern making in images and audio. It also provides a GUI with 18 different MultiGen instances to try out, a menu of patterns, animation controls, and image, audio, and video export.
Utility and Demonstration Examples
TransformPImageshows image transformation and manipulation techniques compatible with PixelAudio processing.TutorialOne_06_WB_Retrofitdemonstrates retrofitting existing code to use the WindowBuffer pattern for improved audio handling. Available only in Eclipse version.PANetworkClientINFprovides a network interface for remote communication with PixelAudio processes.
Companion Files
Some examples include Max/MSP support files for network integration:
UDP_Handler.maxpat- Max/MSP patch for UDP message handlingsimpleAudioIO.maxpat- Max/MSP patch for basic audio I/O
Development Notes
Most examples extend Processing's PApplet and follow the standard setup/draw pattern. Many support interactive keyboard control for real-time parameter manipulation. The tutorial series (TutorialOne_*) provides progressive lessons in increasing complexity.
-
ClassDescriptionArgosyMixer demonstrates use of the Argosy class to create and animate patterns and save them to video.Experimental real time performance application based on PixelAudio, with an editing GUI, Presets, and saving and loading JSON-format files for brushstroke and granular configuration data.Simple container for a brush hit-test result.Future Development: Barebones interface for "something that happens at a certain point", and then in AudioScheduler the time-when-something-happens gets connected to the-room-where-it-happens and the entire cast of Hamilton steps in, if you let them.Presets are applied to each new brush at the moment drawing is completed by releasing the mouse button and calling makeBrush(), the bottleneck method for all brush creation.BigWaveSynth shows how you can load a WaveSynth into the pixel array of a MultiGen.BigWaveSynthAudio shows how you can load the color output of WaveSynth into the pixel array of a MultiGen and play the WaveSynth's audio output with a PASamplerInstrument.Simple container for a brush hit-test result.Future Development: Barebones interface for "something that happens at a certain point", and then in AudioScheduler the time-when-something-happens gets connected to the-room-where-it-happens and the entire cast of Hamilton steps in, if you let them.Presets are applied to each new brush at the moment drawing is completed by releasing the mouse button and calling makeBrush(), the bottleneck method for all brush creation.Demo of how to set and save WaveSynth parameters from JSON files.LoadAudioToImage shows how you can open audio files and transcode their image data to an image.LoadImageToAudio shows how to load an image and turn it into an audio file that can be played by clicking on the image.PixelAudio Core Concept: Mapping The LookupTables example shows how to map a 1D audio signal onto a 2D bitmap, using lookup tables (LUTs) to create a one-to-one correspondence between audio samples and RGB pixels.MultiGenDemo: How to Combine Gens into a MultiGenThe LookupTables example shows how a central element of PixelAudio, the lookup table, connects a 1D audio signal with a 2D bitmap, putting audio samples and RGB pixels in one-to-one correspondence within a single PixelMapGen instance such as a Hilbert, Moore, or DiagonalZigzag.Interface for applications extending PApplet that use NetworkDelegate to send and receive UDP messages.This is the Starter example with animation added.TransformPImage demonstrates some of the commands available in the BitmapTransform class.The first tutorial opens audio or image files and loads either file type to both the image display and the audio buffer.This example sketch builds on TutorialOne_01_FileIO, which provided commands to open and display audio and image files, transcode image pixel data to audio samples, transcode audio samples to image pixel data, and save audio and image files.NEW FEATURESA light-weight version of the
AudioBrushclass for combining gestures and audio synthesis.Defines the curve drawing model for a brush using PACurveMaker.A class to store a hit-test result, recording an AudioBrushLite instance and its index in brush list.NETWORKING WITH UDPA light-weight version of the AudioBrush class for combining gestures and audio synthesis.Defines the curve drawing model for a brush using PACurveMaker.A class to store a hit-test result, recording an AudioBrushLite instance and its index in brush list.GesturePlayground uses a GUI to provide a tour of curve drawing with an interface to the two audio synthesis engines available in PixelAudio: the Sampler synth and the Granular synth.Simple container for a brush hit-test result.Future Development: Barebones interface for "something that happens at a certain point", and then in AudioScheduler the time-when-something-happens gets connected to the-room-where-it-happens and the entire cast of Hamilton steps in, if you let them.TutorialOne_06_WB_Retrofit A continuation of TutorialOne_03_Drawing that keeps the drawing, brush, sampler, granular, bounds, and envelope code from TutorialOne_03_Drawing, but changes the audio source model: - anthemSignal / anthemBuffer hold the entire loaded audio file.TutorialOne_06_WindowBufferA light-weight version of theAudioBrushclass for combining gestures and audio synthesis.Defines the curve drawing model for a brush using PACurveMaker.A class to store a hit-test result, recording an AudioBrushLite instance and its index in brush list.Deprecated, for removal: This API element is subject to removal in a future version.Additive audio synthesis engine produces colorful animated patterns and electronic synth sounds.Example sketch shows how to create an audio synth sequencer with the WaveSynth.