Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 998 Bytes

explainer.md

File metadata and controls

41 lines (30 loc) · 998 Bytes

Making a Drum Machine Controller by a USB GamePad using audio-node-template

Step 1: Clone the audio-node-template repository

Put stuff about cloning here

What's inside audio-node-template

index.js

	
		var setterGetterify = require('setter-getterify');
	module.exports = function(context) {
		
		var node = context.createGain();
		var nodeProperties = {
			propertyA: 'default value for A',
			propertyB: 0.123456,
			propertyC: 0x123456,
			propertyD: { 'also': 'objects are ok too' }
		};

		setterGetterify(node, nodeProperties);

		node.start = function(when, offset, duration) {
			
			console.log('start', 'when', when, 'offset', offset, 'duration', duration);

			when = when !== undefined ? when : 0;
			offset = offset !== undefined ? offset : 0;
			
		};

		node.stop = function(when) {
		};

		node.cancelScheduledEvents = function(when) {
		};

		return node;

	};
</code>