# 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

- Related Packages
  Package
  Description
  net.paulhertz.pixelaudio
  Core classes for PixelAudio, a Processing library that maps between sound and image data.
  net.paulhertz.pixelaudio.curves
  Gesture, path, and Bézier curve modeling classes for PixelAudio.
  net.paulhertz.pixelaudio.example
  Package `net.paulhertz.pixelaudio.example` provides example Processing sketches and demonstrations of PixelAudio library functionality.
  net.paulhertz.pixelaudio.granular
  Granular synthesis classes for PixelAudio.
  net.paulhertz.pixelaudio.sampler
  Digital audio sampling synthesis classes for PixelAudio, built on the Minim library for Processing.
  net.paulhertz.pixelaudio.schedule
  Package `net.paulhertz.pixelaudio.schedule` provides sample-accurate event scheduling, gesture-based time management, and audio utility functions for the PixelAudio library.
- Class
  Description
  AudioBrushFileNamer
  Generate JSON filenames for AudioBrush "session" format, with gesture and audio synth settings.
  AudioBrushFileNamer.Result
  AudioBrushLibraryLoader
  Read AudioBrush library JSON format.
  AudioBrushLibraryLoader.BrushData
  AudioBrushLibraryLoader.LoadResult
  AudioBrushSessionIO
  Session manifest writer/reader for brush sets.
  AudioBrushSessionIO.BrushAdapter<B>
  AudioBrushSessionIO.BrushFactory<B>
  AudioBrushSessionIO.BrushRecord
  AudioBrushSessionIO.SessionData<B>
  AudioBrushSessionIO.SessionMeta
  AudioBrushSessionLoader
  Read AudioBrush session data form JSON files.
  AudioBrushSessionLoader.BrushData
  AudioBrushSessionLoader.JsonFileType
  AudioBrushSessionLoader.LoadResult
  GestureGranularConfigIO
  JSON read/write support for GestureGranularConfig.Builder.
  GestureGranularConfigIO.InstrumentType
  GestureGranularConfigIO.Meta
  GestureGranularConfigIO.Result
  PACurveMakerIO
  JSON read/write support for PACurveMaker.
  PACurveMakerIO.Meta
  PACurveMakerIO.Result