Package net.paulhertz.pixelaudio.io


package net.paulhertz.pixelaudio.io
Package net.paulhertz.pixelaudio.io provides JSON-based persistence for PixelAudio data structures.

Overview

This package implements serialization and deserialization of core PixelAudio objects to JSON format, enabling saving and loading of gestures, granular synthesis configurations, and complete audio brush sessions. The format is designed for the Bagatelle example sketch and supports the AudioBrush session paradigm.

  • PACurveMakerIO provides JSON read/write support for PACurveMaker gesture data with optional metadata (id, name, description, notes, style, and linked config path).
  • GestureGranularConfigIO provides JSON read/write support for GestureGranularConfig.Builder with full parameter serialization including timing, hopping, warping, grain, and ADSR parameters.
  • AudioBrushSessionIO implements a session manifest writer/reader for brush sets using generic adapter/factory patterns, enabling flexible brush collection management with support for multiple instrument types and linked gesture/config files.
  • AudioBrushSessionLoader reads AudioBrush session data from JSON files, with automatic file type detection (gesture, config, or session) and support for loading single files or complete sessions with linked resources.
  • AudioBrushLibraryLoader reads AudioBrush library JSON format and loads directories of gesture/config files into a collection of brush objects with error tracking.
  • AudioBrushFileNamer generates JSON filenames for AudioBrush "session" format with gesture and audio synth settings, supporting normalized base names and linked file references.

JSON Format Conventions

Each JSON file includes a header with format identifier, version, and type. Files follow these naming patterns:

  • gesture_001_gesture.json - gesture data (PACurveMaker)
  • gesture_001_config.json - configuration data (GestureGranularConfig.Builder)
  • rehearsalSet_session.json - session manifest with brush collection