From 7110188d336ae412077a464c5101e28a8e6c7c70 Mon Sep 17 00:00:00 2001 From: rnentjes Date: Tue, 6 May 2025 19:13:43 +0200 Subject: [PATCH] Add project documentation and update .gitignore Introduces development guidelines for the VST Chip synthesizer, including setup, build, and testing instructions. Adds a placeholder README for the data directory and updates `.gitignore` to include new project-specific build artifacts and paths. --- .gitignore | 4 ++ .junie/guidelines.md | 105 +++++++++++++++++++++++++++++++++++++++++++ data/readme.md | 1 + 3 files changed, 110 insertions(+) create mode 100644 .junie/guidelines.md create mode 100644 data/readme.md diff --git a/.gitignore b/.gitignore index bda6eff..d7c982e 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,10 @@ bin/ .DS_Store /web +/web1 +/web2 +/data/*.db* +**/kotlin-js-store/* .kotlin .idea diff --git a/.junie/guidelines.md b/.junie/guidelines.md new file mode 100644 index 0000000..98c3e72 --- /dev/null +++ b/.junie/guidelines.md @@ -0,0 +1,105 @@ +# VST Chip Synthesizer Development Guidelines + +## Project Overview + +VST Chip is a Kotlin multiplatform project that implements a chip-style synthesizer with a web interface. The project consists of: + +- JVM backend that serves the web application +- JS frontend that runs in the browser +- Audio worklet processor for real-time audio processing + +## Build/Configuration Instructions + +### Prerequisites + +- JDK 11 or higher +- Gradle 7.x or higher +- Node.js and npm (for JS development) + +### Building the Project + +1. **Full Build**: + ```bash + ./gradlew build + ``` + +2. **JS Build Only**: + ```bash + ./gradlew buildJS + ``` + +3. **Deployment**: + ```bash + ./gradlew deploy + ``` + This will build the project, copy web assets, and deploy to the configured server location. + +### Configuration + +- Server port: 9005 (configured in `Main.kt`) +- JDBC stats port: 6005 +- Deployment directory: configured in `build.gradle.kts` as `vst-chip.midi-vst.com` + +## Testing Information + +- **Do not generate tests** for this project. The audio processing code is highly specialized and requires manual testing with audio + equipment. +- Manual testing should be performed using MIDI controllers and audio monitoring tools. + +## Development Information + +### Project Structure + +- **src/commonMain**: Shared code between JS and JVM +- **src/jsMain**: Browser-specific code +- **src/jvmMain**: Server-specific code +- **audio-worklet**: Audio processing code that runs in a separate thread in the browser + +### Key Components + +1. **JVM Server** (`src/jvmMain/kotlin/nl/astraeus/vst/chip/Main.kt`): + - Undertow server that serves the web application + - Database initialization + - Logging setup + +2. **JS Frontend** (`src/jsMain/kotlin/nl/astraeus/vst/chip/Main.kt`): + - UI implementation using Komponent library + - MIDI handling + - WebSocket client for server communication + +3. **Audio Processor** (`audio-worklet/src/jsMain/kotlin/nl/astraeus/vst/chip/ChipProcessor.kt`): + - Real-time audio synthesis + - MIDI message handling + - Sound generation with multiple waveforms (sine, square, triangle, sawtooth) + - Effects processing (FM, AM, ADSR envelope, delay, feedback) + +### Development Workflow + +1. Make changes to the code +2. Run `./gradlew buildJS` to build the JS part +3. Run the JVM application to test locally +4. Use `./gradlew deploy` to deploy to the server + +### Audio Worklet Development + +The audio worklet runs in a separate thread in the browser and handles real-time audio processing. When modifying the audio worklet code: + +1. Understand that it runs in a separate context from the main JS code +2. Communication happens via message passing +3. Performance is critical - avoid garbage collection and heavy operations in the audio processing loop + +### MIDI Implementation + +The synthesizer responds to standard MIDI messages: + +- Note On/Off (0x90/0x80) +- Control Change (0xb0) for various parameters +- Program Change (0xc9) for waveform selection + +## Deployment + +The project is configured to deploy to a specific server location. The deployment process: + +1. Builds the project +2. Copies web assets +3. Creates a symbolic link for the latest version \ No newline at end of file diff --git a/data/readme.md b/data/readme.md new file mode 100644 index 0000000..c5d999a --- /dev/null +++ b/data/readme.md @@ -0,0 +1 @@ +Data directory for the db \ No newline at end of file