Skip to content

A clap detection library for Node.js, using the cSound API

License

Notifications You must be signed in to change notification settings

aliask/clapper-csound

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clapper-csound

A clap detection library for Node.js, using the Csound API. I use it to turn a lamp on and off in my living room in a highly annoying fashion. You can too.

Installing

This package relies on the Node.js package csound-api, which in turn needs Boost 1.53.0 or later, and Csound, of course.

Have a read of the instructions over at the csound-api docs.

Once these are installed on your system, you can install this library by running

npm install clapper-csound

Usage

This package exposes four functions:

init, start, stop and updateSettings

Your code should look very similar to this:

const clapper = require('clapper-csound');

function trigger() {
  console.log('Doubleclap detected');
}

var settings = {
  debug: true
};

if(clapper.init(trigger, settings)) {
  clapper.start();
}

The full settings object looks like this:

var settings = {
  debug: false,
  clap: {
    spacing: 0.3,
    rhythmTolerance: 0.1,
    powerThreshold: 0.15
  },
  csound: {
    input: '-iadc'
  }
};

About

A clap detection library for Node.js, using the cSound API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published