/patr

Primary LanguageJavaScript

Patr - a step sequencer

Simple monophonic note sequencer, built on the Web Audio API. With some experimental js approaches that are probably not recommended.

This is considered alpha version 0.02. The code isn't likely to be something you'd want to fork or adapt in it's present state. The application can be a bit fun to play with, though.

Demo

http://sleepdirt.com/patr_demo/

Live

http://proto.blandhand.net/patr/

How To

The controls should be self-evident. All controls besides re-start are keyboard-accessible.

  • re-start: refresh to a new randomized pattern (no control key, to avoid "unexpected" results)
  • play/pause (press the spacebar)
  • pace (P key): beats per minute
  • len (L key): note/step count
  • shuff (S key): shuffle - randomly re-order existing notes
  • ea (E key): re-shuffle each n cycles
  • clear (C key): set all notes to zero (ie. off)
  • regen (R key): generate a new random set of notes (weighted to produce a "significant" ratio of zero/off notes)
  • tone (T key, then 0-5 keys): select synth tone - 'spring', 'organ' and 'wind' tones are from soundtoy. (Note: the dropdown remains open until you click 'tone' or press 'T' by design)
  • note sliders: select and drag or press up/down to change; tab / shift+tab to move left to right between sliders
  • browser back/fwd buttons (Alt/AppleKey + left or right): cycle through history of changes

Compatability

My focus has been with the Web Audio API. I've added a wrapper for Mozilla's Audio Data API (now abandonded), and a Flash fallback, but, while these render the audio well enough, it is utterly out-of-sync with the UI display [I'm working on this].

  • WebKit broswers:
  • Firefox, version 25 and above
  • [Barely, brokenly] iOS Safari and Chrome
  • Other: The mozFlashAudioContext.js wrapper falls back to a flash audio engine, based on dynamicaudio.js - though the audio and UI do not sync.

Issues

( This codebase is on hold, pending the resolution of this long-standing webaudio scriptProcessorNode issue )

  • Use of 'ea' (re-shuffle each n iterations) control can interfere with some UI functions.
  • The 'tone' control has some questionable, janky hover-interaction.
  • Three of the four main code modules are due for heavy refactoring. So there is significant unnecessary complexity, and a handful of ugly/crufty spots.