Skip to content

chanchal1987/pigment-patch-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arturia Pigments AI Preset Generator & Sound Deconstructor

An intelligent, self-contained AI-powered sound deconstructor that analyzes any input audio sample (WAV/MP3) and translates its spectral, harmonic, and temporal properties into exact, native preset parameters for the Arturia Pigments 7 virtual synthesizer.

The application serves a sleek, dark-themed virtual synth dashboard modeled directly after the Pigments interface. It features dynamic vector oscillators, ADSR envelope shapes, multimode filters, and circular rotary macro knob mapping, and outputs a perfectly formatted .pgtx preset archive ready to be imported directly into Pigments.


Features

  • AI Spectral Deconstruction: Analyzes upload audio files using the Google Gemini API to extract synth engine waveforms, cutoff frequencies, filter resonances, and ADSR envelope shapes.
  • Dynamic Synth UI: Recreates the Pigments 7 interface in HTML/JS, complete with custom canvas rendering for 3D wavetables, filter response curves, and ADSR visuals.
  • Circular Knob Indicators: Knobs display exact parameter values with glowing indicator dots rotating via matrix transforms.
  • Elastic Module Resizing: Responsive flexbox layout that expands, collapses, and resizes modules dynamically (e.g. Engine 2, Filter 2, Utility Engine) when active preset params trigger their display.
  • Automated Preset Generator: Compiles parameters into a Little-Endian encoded, CRC-32 checked manual ZIP archive with FAT creator headers and zero directories, satisfying Pigments' strict import parser constraints.

How to Generate a Gemini API Key

To use the AI audio deconstructor, you need a Gemini API Key:

  1. Visit the Google AI Studio website.
  2. Sign in with your Google Account.
  3. Click the Get API Key button in the top left corner of the dashboard.
  4. Click Create API Key.
  5. Select a project (or choose "Create API Key in new project").
  6. Copy your generated API key string (starts with AIzaSy...).

How to Build & Run the Application

Prerequisites

  • Go (version 1.22 or higher recommended)
  • An active Internet connection (to query the Gemini API)

1. Set the API Key Environment Variable

Set the GEMINI_API_KEY environment variable in your terminal session:

macOS / Linux (zsh or bash)

export GEMINI_API_KEY="your_api_key_here"

Windows (PowerShell)

$env:GEMINI_API_KEY="your_api_key_here"

Windows (CMD)

set GEMINI_API_KEY=your_api_key_here

2. Build the Executable

Run the following command in the project root to compile the Go binary:

go build -o server main.go

3. Run the Local Server

Start the compiled server executable:

./server

Or run it directly without compiling:

go run main.go

The server will start up on http://localhost:8080. Open this address in any modern web browser to access the synth generator deck.


How to Use the Application

  1. Select an AI Model: Use the dropdown in the header to select your preferred Gemini engine (defaults to Gemini 3.5 Flash for quick response times).
  2. Load Audio Sample: Drag-and-drop a WAV or MP3 audio file (up to 10MB) into the Sample Engine upload box, or click the box to browse your filesystem.
  3. Analyze: Click the Analyze button. The server uploads the audio, initiates spectral analysis, and displays the color-shifting Gemini loading sparkles.
  4. Inspect Synth Active Panel: Once analysis finishes, the results panel expands to display the predicted wavetables, filters, envelopes, and macro assignments.
  5. Download Preset: Click the Download .pgtx Preset button to save the synthesizer preset file to your computer.

How to Import the Preset into Arturia Pigments

Once you have downloaded the .pgtx preset file, follow these steps to import and play it inside Arturia Pigments:

  1. Open Arturia Pigments (either as a standalone application or as a VST plugin inside your DAW).
  2. Click the Menu icon (three horizontal lines) in the top-left corner of the Pigments interface.
  3. Select Import... from the dropdown menu.
  4. Locate and select the downloaded .pgtx file (e.g. User.pgtx or the name generated by the app) in your file browser, then click Open.
  5. Once imported, open the Preset Browser (click the search bar/preset name in the top center).
  6. Under Banks, select User. Under Types or search, find your newly generated preset (matches the PatchName displayed on the dashboard).
  7. Load the preset to load the AI-generated engines, filters, FX, and macro modulations automatically!

Codebase Architecture

  • ./: Contains the application entry point main.go, unit testing server_test.go, system configurations, and setup guides.
  • internal/arturia/: Handles binary parsing, merging, parameter routing sorting, and Little-Endian ZIP compiling to export Pigments-compatible .pgtx archives.
  • internal/audio/: Deals with client upload validation, size limits, and local audio file saves.
  • internal/gemini/: Defines the structured JSON prompt schema and interfaces with the Google GenAI SDK.
  • web/: Contains the responsive synth panel layout, custom CSS glows, and HTML5 canvas vector rendering engines.

About

AI-powered sound deconstructor and native preset generator for the Arturia Pigments 7 virtual synthesizer.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors