GithubHelp home page GithubHelp logo

iain8 / drumbox01 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 599 KB

a drum machine for beats inside browser

Home Page: http://iain8.github.io/drumbox01/

License: MIT License

CSS 8.68% JavaScript 2.08% HTML 1.28% TypeScript 82.18% Rust 5.77%

drumbox01's Introduction

drumbox01

An HTML5 drum machine, inspired by the usual retro classics and more modern takes such as the mighty Microtonic by Sonic Charge. Development started in Javascript but I had an object-oriented structure in mind already so I decided to take the opportunity to try out Typescript, having seen it pop up originally a few years ago.

The result is a better structured application, but one that unfortunately compiles into a big messy JS file at the moment. However there is the ability to compile into AMD type modules, so that is on the list for the future. The only dependencies are jQuery and jQuery Knob for the UI.

There are four channels, each comprises of:

  • An oscillator, with pitch and amplitude envelopes and choice of four waveforms
  • A noise generator (short audio buffer containing random noise) with amp envelope and planned filter
  • Mix controls and a peak filter on the output

The channels are connected to a simple step sequencer of 16 beats in length, you can alter the tempo or division size (step size) and eventually hopefully articulation. It triggers the envelopes of the channels per step, this gets around the Web Audio API limitation of having to recycle nodes after you call stop() (i.e. they never stop, their volume is just manipulated accordingly).

The result of this, combined with use of setInterval() rather than future scheduling, is that timing is not exactly super tight, and if you switch tabs it suddenly sounds drunk. This is an area to spend more development time on in the future.

There’s even support for mobile devices, at least as far as it making sound (after dealing with the iOS implementation of Web Audio being strangely behind the spec with methods like noteOn() rather than the modern start()).

Future plans are as mentioned to refactor the sequencer into something more robust, add the missing features to the channels and spruce up the interface. Some weird effects could be fun too but that might be a separate project.

References:

Design inspiration:

drumbox01's People

Contributors

iain8 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

meeroslav

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.