Skip to content
osauerPublic

About

HitFactory Education DAW - Interactive music production learning environment

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

HitFactory Education DAW

A professional Digital Audio Workstation (DAW) built with React, TypeScript, Tone.js, and Go for interactive music production education. Features both real-time browser-based audio synthesis and high-quality backend rendering.

Version 0.1.0 (2025-01-13)

Major Improvements

  • TypeScript Refactoring: Complete type safety overhaul (Gates 4-5)
    • Eliminated all TypeScript errors (62 β†’ 0)
    • Proper type definitions for Tone.js integration
    • Removed legacy components and type mismatches
  • State Management: Migrated to Zustand from React hooks
  • Code Quality: Isolated side effects into dedicated hooks and services
  • MCP Support: Enhanced Model Context Protocol integration

Features

🎡 Music Production

  • Dual Rendering Modes:
    • Frontend (Tone.js): Real-time browser-based synthesis for instant playback
    • Backend (Go): Professional 96kHz rendering with DSP processing
  • Professional mixer with multi-track STEM control
  • Advanced production controls (frequency management, dynamics, stereo imaging)
  • Visual spectrum analyzer and meters
  • A/B comparison mode
  • Production presets (Amateur, Balanced, Vintage, Modern, Electronic)
  • Song architecture visualization and editing

πŸŽ“ Educational

  • Progressive tutorial system
  • Interactive quizzes
  • Achievement system with points
  • Production challenges
  • Theory tooltips
  • Real-time parameter change indicators

πŸ› οΈ Technical Stack

  • Frontend: React 18 + TypeScript + Vite
  • Audio Engine: Tone.js (frontend) / Custom DSP (backend)
  • Backend: Go + hyperserve framework
  • Styling: Tailwind CSS
  • Data Model: Unified MusicProject structure
  • Deployment: Single binary with embedded assets

Project Structure

HF_DAW/
β”œβ”€β”€ src/                    # Frontend source
β”‚   β”œβ”€β”€ App.tsx            # Main application
β”‚   β”œβ”€β”€ components/        # React components
β”‚   β”œβ”€β”€ hooks/             # Custom React hooks
β”‚   β”œβ”€β”€ types/             # TypeScript definitions
β”‚   β”œβ”€β”€ data/              # Music projects and presets
β”‚   └── utils/             # Utility functions
β”œβ”€β”€ pkg/audio/             # Go audio processing
β”‚   β”œβ”€β”€ models.go          # Data models (golden source)
β”‚   β”œβ”€β”€ production_renderer.go  # Backend renderer
β”‚   └── handler.go         # Audio file handling
β”œβ”€β”€ internal/              # Go internal packages
β”‚   β”œβ”€β”€ handlers/          # HTTP handlers
β”‚   └── router/            # Route configuration
β”œβ”€β”€ docs/                  # Documentation
β”‚   β”œβ”€β”€ hf_ds.md          # Data structure specs
β”‚   └── hf_mbb.md         # Music business blueprint
└── audio_output/          # Backend rendered files

Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Go 1.24+
  • Modern web browser with Web Audio API support

Quick Start

# Clone the repository
git clone https://github.com/osauer/HF_DAW.git
cd HF_DAW

# Install all dependencies
make setup

# Start development servers
make dev

Production Build

# Build everything
make build

# Run production server
./hf-daw

Deployment

System Requirements

  • Linux/macOS/Windows with Go runtime
  • 512MB+ RAM recommended
  • 100MB disk space for binary and assets

Deployment Steps

  1. Build the production binary:

    make build
  2. Create required directories (automatically created on first run):

    • audio_output/ - For backend-rendered audio files
    • uploads/ - For user audio uploads
    • uploads/recordings/ - For in-app recordings
  3. Environment Variables (optional):

    • HF_DAW_MCP_TOKEN - Secure MCP endpoints
    • PORT - Change default port (8080)
  4. Run the server:

    ./hf-daw

Docker Deployment (Optional)

FROM golang:1.24-alpine AS builder
WORKDIR /app
COPY . .
RUN apk add --no-cache make nodejs npm
RUN make build

FROM alpine:latest
RUN apk add --no-cache ca-certificates
WORKDIR /root/
COPY --from=builder /app/hf-daw .
RUN mkdir -p audio_output uploads/recordings
EXPOSE 8080
CMD ["./hf-daw"]

Systemd Service (Linux)

[Unit]
Description=HitFactory DAW Server
After=network.target

[Service]
Type=simple
User=www-data
WorkingDirectory=/opt/hf-daw
ExecStart=/opt/hf-daw/hf-daw
Restart=on-failure
Environment="HF_DAW_MCP_TOKEN=your-secret-token"

[Install]
WantedBy=multi-user.target

Key Features Deep Dive

Render Mode Toggle

Switch between instant browser playback and professional backend rendering:

  • Browser Mode: Low latency, real-time synthesis
  • Server Mode: 96kHz, professional mastering chain, downloadable files

Music Project Structure

Comprehensive data model supporting:

  • Core Musical DNA (tempo, harmony, dynamics, timbre)
  • Song Architecture (sections, arrangements, transitions)
  • STEM Collection (individual tracks with processing)
  • Production metadata and technical specs

Production Controls

  • Core Musical DNA: BPM, groove, harmony, dynamics
  • Mixer Panel: Per-STEM volume, pan, mute, solo
  • Production Nuances: Frequency separation, compression, stereo imaging
  • Advanced Controls: Transient shaping, automation, multi-band processing

Development

Available Commands

make dev          # Start dev servers (frontend + backend)
make build        # Build for production
make test         # Run tests
make lint         # Run linters
make clean        # Clean build artifacts
make kill         # Stop all servers
make setup        # Install all dependencies

Frontend Development

npm run dev       # Start Vite dev server
npm run build     # Build frontend
npm run type-check # TypeScript checking

Backend Development

go run main.go    # Run backend server
go test ./...     # Run Go tests
go build          # Build binary

API Endpoints

Web Interface

  • GET / - Landing page
  • GET /daw - Main DAW application

Audio API

  • POST /api/daw/render - Simple audio render
  • POST /api/daw/production/render - Production quality render
  • GET /api/daw/production/status?jobId={id} - Check render status
  • GET /api/daw/production/stream?jobId={id} - Stream rendered audio
  • POST /api/daw/production/preview - Quick preview render
  • WS /ws/daw/production/render?jobId={id} - WebSocket progress

MCP (Model Context Protocol)

  • GET /mcp - MCP tools and capabilities

Architecture Notes

  • Frontend: Modern React with hooks, TypeScript for type safety
  • Audio Processing: Dual engine (Tone.js client-side, Go server-side)
  • State Management: React hooks with proper separation of concerns
  • Backend: Zero-dependency hyperserve framework
  • Deployment: Single binary with embedded frontend assets
  • Data Model: Unified MusicProject structure (see pkg/audio/models.go)

Contributing

  1. Read CLAUDE.md for AI-assisted development guidelines
  2. Check KANBAN_BOARD.md for current tasks
  3. Follow the existing code style and patterns
  4. Ensure all tests pass before submitting
  5. Auto-commit is enabled - commits happen automatically

License

MIT License - see LICENSE file for details

Acknowledgments

  • Built with hyperserve framework
  • Audio synthesis powered by Tone.js
  • Inspired by professional DAWs and music education needs

About

HitFactory Education DAW - Interactive music production learning environment

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages