This project is an interactive music grid that uses webcam input to create a unique musical experience. Users can create music by moving in front of their webcam, with different areas of the grid corresponding to different musical notes.
- Webcam-based interaction
- Customizable musical scales and keys
- Multiple instrument options
- Adjustable volume
- Different visual themes
- Grid and Theremin modes
- Responsive design
- Typescript
- HTML5
- CSS3
- JavaScript
- p5.js for webcam processing and canvas manipulation
- Tone.js for audio synthesis and playback
- Open the HTML file in a web browser that supports webcam access.
- Click the "Start" button to begin.
- Move in front of your webcam to trigger different notes on the grid.
- Use the controls to adjust various settings:
- Volume: Adjust the overall volume
- Scale: Choose between Major, Minor, Blues, Pentatonic, and Chromatic scales
- Key: Select the root note for the scale
- Instrument: Choose from a wide variety of instruments
- Theme: Switch between Dark, Light, and Colorful visual themes
- Mode: Toggle between Grid and Theremin modes
In Grid mode, the screen is divided into a grid of cells. Each cell corresponds to a specific note in the chosen scale. Movement detected in a cell will trigger its associated note.
In Theremin mode, the entire screen acts as a theremin-like instrument. Horizontal movement controls pitch, while vertical movement affects volume.
The code allows for easy customization of various elements:
- Grid size: Adjust
gridRows
andgridCols
variables - Movement sensitivity: Modify
movementThreshold
in theCell
class - Note duration: Adjust
minDuration
andmaxDuration
in theplayNote
method - Color schemes: Modify the
generateColors
function
This application should work in most modern browsers that support WebRTC for webcam access. Please ensure your browser is up to date for the best experience.
For privacy reasons, make sure to grant webcam permissions to the application when prompted by your browser.
Enjoy creating music with your movements!