Skip to content

Latest commit

 

History

History

DJ

README.md

DJ

SIK Gesture & Hands Audio & Microphone Animation & Tween Physics

dj

Overview

DJ is an interactive DJ turntable experience built for SPECS that lets users scratch vinyl records, mix audio tracks, and control playback using hand tracking. It demonstrates real-time audio manipulation, physics-based vinyl rotation, and dual-deck mixing using the SPECS hand-tracking API. Learn more about the SPECS audio output API here.

NOTE: This project will only work for the SPECS platform.

Design Guidelines

Designing Lenses for SPECS offers all-new possibilities to rethink user interaction with digital spaces and the physical world. Get started using our Design Guidelines

Prerequisites

  • Lens Studio: v5.25+

Note: Ensure Lens Studio is compatible with SPECS for your SPECS device and OS versions.

  • SPECS OS Version: v7.0+
  • SPECS App iOS: v1.7+
  • SPECS App Android: v1.7+

To update your SPECS device and mobile app, please refer to this guide.

You can download the latest version of Lens Studio from here.

The hand tracking features require you to use Experimental APIs. Please see Experimental APIs for more details here.

Extended Permissions mode on device must be enabled for enabling some of the SPECS APIs. Please see Extended Permissions for more details here.

Getting Started

To obtain the project folder, clone the repository.

IMPORTANT: This project uses Git Large Files Support (LFS). Downloading a zip file using the green button on GitHub will not work. You must clone the project with a version of git that has LFS. You can download Git LFS here.

Initial Project Setup

The project should be pre-configured to get you started without any additional steps. However, if you encounter issues in the Logger Panel, please ensure your Lens Studio environment is set up for SPECS.

Key Script

AudioController.ts - Manages dual-deck real-time audio playback with variable speed and volume control via buffered FloatArrayWrapper streams.

VinylRotator.ts - Drives physics-based vinyl rotation with inertia decay, hand-tracking input, and smooth tween-based pause/resume transitions.

HandController.ts - Tracks the closest hand relative to the vinyl center to derive rotation direction and speed for scratching.

VinylInteraction.ts - Handles dragging the movable vinyl disc onto the left or right deck with lerp snapping and color-coded visual feedback.

VolumeController.ts - Provides a crossfade setVolume() method that balances audio between deck 1 and deck 2.

TweenManager.ts - Drives the TWEEN engine each frame and exposes the global tweenManager API for starting, stopping, pausing, and resuming tweens.

Testing the Lens

In Lens Studio Editor

  1. Open the project file DJ.esproj in Lens Studio 5.25+.
  2. Open the Preview panel and select a SPECS device preview configuration.
  3. Verify that all audio tracks appear in the track selection menu on the left.
  4. Use the simulated hand-tracking controls to test vinyl rotation and deck snapping.

In SPECS Device

  1. Build and push the lens to your SPECS device from Lens Studio.
  2. Follow the SPECS preview guide for device deployment.
  3. Enable Extended Permissions on device so hand tracking can access the required APIs.
  4. Drag a vinyl disc from the track list onto a deck, then move your hand over the vinyl to scratch.
  5. Use both decks simultaneously to mix two tracks with the crossfader.

Support

If you have any questions or need assistance, please don't hesitate to reach out. Our community is here to help, and you can connect with us and ask for support here. We look forward to hearing from you and are excited to assist you on your journey!

Contributing

Feel free to provide improvements or suggestions or directly contributing via merge request. By sharing insights, you help everyone else build better Lenses.


​

​

​

​

​

​


Built with 👽 by the SPECS team