Skip to content

profmitchell/AudioUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AudioUI

Modern, accessible audio interface components for React applications

npm version MIT License GitHub

AudioUI Overview

Documentation | Components | GitHub

πŸŽ›οΈ What is AudioUI?

AudioUI is a comprehensive library of React components specifically designed for audio applications, digital audio workstations (DAWs), synthesizers, and music production tools. It provides professionally crafted UI elements with modern design principles and full accessibility support.

Component Gallery

Component Example 1 Component Example 2 Component Example 3 Component Example 4 Component Example 5

πŸ“¦ Installation

# npm
npm install audioui

# yarn
yarn add audioui

# pnpm
pnpm add audioui

AudioUI is compatible with React 18+ and works with frameworks like Next.js, Vite, and Create React App.

View Documentation

Overview

AudioUI is a comprehensive library of React components specifically designed for audio applications, digital audio workstations (DAWs), synthesizers, and other music production tools. It provides professionally crafted UI elements common in music software with modern design principles and full accessibility support.

✨ Key Features

  • πŸŽ›οΈ Professional Audio Controls: Knobs, faders, XY pads, and other audio-specific UI components
  • 🎹 MIDI Integration: Built-in MIDI support for components like drum pads and keyboards
  • πŸ“± Responsive: Fully responsive components that work across desktop and mobile devices
  • β™Ώ Accessible: ARIA-compliant components with keyboard navigation and screen reader support
  • 🎨 Customizable: Easily themeable to match your application's design system
  • ⚑ Optimized: High-performance components with minimal re-renders for low-latency audio applications
  • πŸ”Œ Framework Agnostic: Works with any React-based project, including Next.js, Remix, and more
  • 🎚️ JUCE Integration: Ready-to-use starter template for integrating with JUCE 8's WebView feature

Quick Start

import { ADSREnvelope, Dial, MIDIPad, PitchBend } from 'audioui';

function MySynthUI() {
  return (
    <div className="synth-container">
      <Dial 
        value={75} 
        min={0} 
        max={100} 
        onChange={(value) => console.log('Dial value:', value)} 
      />
      
      <ADSREnvelope
        attack={0.1}
        decay={0.3}
        sustain={0.5}
        release={1.0}
        onValueChange={(values) => console.log('ADSR values:', values)}
      />
      
      <PitchBend 
        onChange={(value) => console.log('Pitch bend:', value)} 
      />
      
      <MIDIPad 
        note={60} 
        onTrigger={(note, velocity) => console.log('Note on:', note, velocity)}
        onRelease={(note) => console.log('Note off:', note)}
      />
    </div>
  );
}

πŸ“š Component Documentation

Core Components

Component Description Documentation
Dial/Knob Rotary control for parameters View docs
Knob Specular Photorealistic knob with specular highlights View docs
Slider - Ethereal Linear control with ethereal visual style View docs
XY Pad Two-dimensional control surface View docs
ADSR Envelope Attack, Decay, Sustain, Release envelope editor View docs
Pitch Bend Wheel Vertical/horizontal pitch bend control View docs
Modulation Wheel Modulation wheel control View docs
Meter - Arc Circular level meter display View docs

Additional Components

  • MIDI Provider - Context provider for MIDI functionality
  • Filter Display - Visual representation of filter curves
  • Drum Pad - Trigger pad for percussion samples
  • Preset Browser - Interface for managing and selecting presets

πŸ”§ Advanced Usage

Theme Customization

AudioUI components can be customized to match your application's theme:

<Dial 
  value={50}
  size="lg"
  trackColor="rgba(0,0,0,0.2)"
  indicatorColor="#6366f1"
  variant="flat"
  showValue={true}
  valueFormatter={(v) => `${v}%`}
/>

Integration with Web Audio API

import { useEffect, useRef } from 'react';
import { Dial } from 'audioui';

function AudioProcessor() {
  const audioContextRef = useRef(null);
  const filterRef = useRef(null);
  
  useEffect(() => {
    audioContextRef.current = new AudioContext();
    filterRef.current = audioContextRef.current.createBiquadFilter();
    // Additional audio setup...
  }, []);
  
  const handleFilterChange = (value) => {
    if (filterRef.current) {
      filterRef.current.frequency.value = value * 100;
    }
  };
  
  return (
    <div>
      <h3>Filter Frequency</h3>
      <Dial
        min={20}
        max={20000}
        value={1000}
        onChange={handleFilterChange}
        logScale={true}
      />
    </div>
  );
}

🎚️ JUCE Integration - AudioUIJUCEStarterTemplate

AudioUI provides a starter template for integrating with JUCE 8's WebView feature, allowing you to build audio plugins with React-based UIs.

Key Features

  • JUCE 8 audio processing backend with C++
  • React frontend for modern UI development
  • Hot-reloading capability for rapid UI development
  • Seamless communication between C++ and JavaScript
  • Cross-platform compatibility

Getting Started

# Clone the starter template
git clone https://github.com/profmitchell/AudioUIJUCEStarterTemplate

# Set up the React frontend
cd AudioUIJUCEStarterTemplate/frontend
npm install
npm start

Open the JUCE project in your IDE (Xcode/Visual Studio), build and run it. The application will automatically connect to the React development server and display your UI with hot-reloading support.

View JUCE Starter Template β†’

Resources for JUCE WebView Development

Acknowledgments

Special thanks to the JUCE team for creating the WebView feature that makes this integration possible, and to Jan Wilczek for his invaluable tutorial that helped shape our implementation approach.

πŸ“‚ Project Structure

/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/                 # Core UI components
β”‚   β”‚   β”œβ”€β”€ dial.tsx        # Rotary knob component
β”‚   β”‚   β”œβ”€β”€ adsr-envelope.tsx
β”‚   β”‚   β”œβ”€β”€ XYPad.tsx
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ site-sidebar.tsx    # Documentation site components
β”‚   └── ...
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ docs/               # Documentation pages
β”‚   β”‚   β”œβ”€β”€ components/     # Component documentation
β”‚   β”‚   β”œβ”€β”€ installation/   # Installation guide
β”‚   β”‚   └── introduction/   # Introduction to AudioUI
β”‚   └── ...
└── ...

🀝 Contributing

We welcome contributions to AudioUI! Whether it's new components, bug fixes, or documentation improvements, your help is greatly appreciated.

Getting Started with Contributions

  1. Fork the repository on GitHub

  2. Clone your fork locally:

    git clone https://github.com/YOUR-USERNAME/AudioUI.git
    cd AudioUI
  3. Create your feature branch:

    git checkout -b feature/amazing-feature
  4. Commit your changes with descriptive commit messages:

    git commit -m 'Add some amazing feature'
  5. Push to the branch:

    git push origin feature/amazing-feature
  6. Open a Pull Request on GitHub

Contribution Guidelines

We have comprehensive documentation for contributors:

Component Contributions

Contributing a new audio component? Ensure it meets these criteria:

  • Accessible (keyboard navigable, ARIA compliant)
  • Mobile responsive
  • Well-documented with clear prop interfaces
  • Includes basic tests
  • Follows AudioUI's design system

Documentation Contributions

Documentation improvements are just as valuable as code! Consider:

  • Adding usage examples
  • Creating tutorials
  • Improving component documentation
  • Fixing typos and clarifying instructions
  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add some amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Please see our contributing guidelines for more details.

πŸ”„ Development Workflow

# Clone the repository
git clone https://github.com/profmitchell/AudioUI.git
cd AudioUI

# Install dependencies
pnpm install

# Start the development server
pnpm dev

# Build for production
pnpm build

# Deploy to GitHub Pages
pnpm deploy:pages

πŸ“ License

AudioUI is MIT licensed.

🏒 Created By

Cohen Concepts - Building the future of audio software interfaces. Mitchell Cohen - Professor of Electronic Music Production and Sound Design at Berklee College of Music in Boston.

πŸ™ Acknowledgements

AudioUI is built on the foundation of shadcn/ui, a collection of re-usable components built using Radix UI and Tailwind CSS. We extend our gratitude to the shadcn/ui team for their excellent work that made this project possible.


Made with ❀️ for audio developers and music enthusiasts.

About

Modern, accessible audio interface components for React applications https://www.npmjs.com/package/audioui

Resources

Code of conduct

Contributing

Stars

Watchers

Forks