Skip to content

cve415/Tone.js

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Custom Audio App ๐ŸŽต

A professional web-based audio application built with React and Tone.js for interactive music creation and sample manipulation

React Tone.js Web Audio API License

โœจ Features

  • ๐ŸŽผ Sample Playback System - Load and play MP3 files up to 90 seconds
  • ๐ŸŽ›๏ธ 3-Band EQ - Real-time frequency control (Low/Mid/High)
  • ๐ŸŽน Built-in Synthesizer - Multiple waveforms with ADSR envelope
  • ๐Ÿ”Š Master Volume Control - Global audio level management
  • ๐Ÿ“ฑ Responsive Design - Works on desktop, tablet, and mobile
  • โšก Sample-Accurate Timing - Professional-grade audio precision

๐Ÿ—๏ธ Built With

  • React - Modern UI framework
  • Tone.js - Web Audio framework for music applications
  • Web Audio API - Low-level audio processing
  • Modern CSS - Responsive design with dark theme

๐ŸŽต Audio Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Sample Player  โ”‚โ”€โ”€โ”€โ–ถโ”‚   3-Band    โ”‚โ”€โ”€โ”€โ–ถโ”‚   Master    โ”‚โ”€โ”€โ”€โ–ถโ”‚  Speakers   โ”‚
โ”‚   (Tone.Player) โ”‚    โ”‚EQ (Tone.EQ3)โ”‚    โ”‚Volume (Tone โ”‚    โ”‚             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚   .Volume)  โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                              โ–ฒ
โ”‚  Synthesizer    โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚  (Tone.Synth)   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ› ๏ธ Development

Available Scripts

npm start          # Start development server
npm run build      # Build for production
npm test           # Run test suite
npm run deploy     # Deploy to production

Project Structure

src/
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ AudioEngine.js      # Core audio processing
โ”‚   โ”œโ”€โ”€ SamplePlayer.js     # Sample playback controls
โ”‚   โ”œโ”€โ”€ EQProcessor.js      # 3-band equalizer
โ”‚   โ”œโ”€โ”€ Synthesizer.js      # Synth engine
โ”‚   โ””โ”€โ”€ MasterControls.js   # Global controls
โ”œโ”€โ”€ hooks/
โ”‚   โ”œโ”€โ”€ useAudioContext.js  # Audio context management
โ”‚   โ””โ”€โ”€ useToneEngine.js    # Tone.js integration
โ”œโ”€โ”€ utils/
โ”‚   โ””โ”€โ”€ audioHelpers.js     # Audio utility functions
โ””โ”€โ”€ App.js                  # Main application

๐ŸŽฎ Usage

Basic Sample Playback

  1. Click "Load Sample" to upload an MP3 file
  2. Use play/pause controls for playback
  3. Adjust master volume as needed

EQ Processing

  • Low: Adjust bass frequencies (20Hz - 250Hz)
  • Mid: Control midrange (250Hz - 4kHz)
  • High: Modify treble (4kHz - 20kHz)

Synthesizer

  • Choose waveform type (sine, square, triangle, sawtooth)
  • Play notes using the virtual keyboard
  • Adjust synth volume independently

๐Ÿ“Š Technical Specifications

Feature Specification
Sample Length Up to 90 seconds
Audio Library Size Under 100MB total
Supported Formats MP3, WAV, OGG
Browser Support Chrome, Firefox, Safari, Edge
Audio Latency <10ms (hardware dependent)
Sample Rate 44.1kHz standard

๐ŸŒ Browser Compatibility

Browser Support Notes
Chrome โœ… Full Recommended for development
Firefox โœ… Full Good performance
Safari โœ… Full iOS compatible
Edge โœ… Full Windows compatible

Note: Requires user interaction to start audio context (browser security requirement)

๐Ÿ“ฑ Mobile Support

  • Touch-friendly controls
  • Responsive layout
  • Optimized for mobile browsers
  • Works on iOS and Android

๐Ÿ”ง Configuration

Audio Settings

// Customize audio settings in src/config/audio.js
export const AUDIO_CONFIG = {
  sampleRate: 44100,
  bufferSize: 512,
  maxSampleLength: 90, // seconds
  maxLibrarySize: 100 // MB
};

UI Customization

// Modify theme in src/styles/theme.js
export const theme = {
  colors: {
    primary: '#4CAF50',
    background: '#1a1a1a',
    surface: '#2a2a2a'
  }
};

๐Ÿšง Roadmap

โœ… Completed

  • Basic sample playback system
  • 3-band EQ implementation
  • Synthesizer with multiple waveforms
  • Master volume control
  • Responsive UI design

๐Ÿ”„ In Progress

  • Waveform visualization
  • Performance optimization
  • Unit test coverage

๐ŸŽฏ Planned Features

  • Advanced synthesis (FM, AM, filters)
  • Multi-sample sequencer
  • Recording/export capabilities
  • MIDI controller support
  • Cloud sample library
  • Collaboration features

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments


Built with โค๏ธ for the web audio community

About

A Web Audio framework for making interactive music in the browser.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.1%
  • Other 0.9%