0.0.2 • Published 10 years ago

soundbank-multi v0.0.2

Weekly downloads
5
License
ISC
Repository
github
Last release
10 years ago

soundbank-multi

Repeat template descriptor for every item in input array, replacing placeholder with current item.

Use as a value provider in soundbank.

Install

$ npm install soundbank-multi

Example

Create a chord slot:

var Soundbank = require('soundbank')
var audioContext = new AudioContext()

audioContext.providers = {
  multi: require('soundbank-multi')
}

audioContext.sources = {
  oscillator: require('soundbank-oscillator')
}

var soundbank = Soundbank(audioContext)
soundbank.connect(audioContext.destination)

soundbank.update({
  id: 'note0',
  offset: 0,
  sources: {
    values: [60, 65, 68],
    template: {
      { node: 'oscillator',
        shape: 'square',
        note: {$value: true} // value is injected here
      }
    }
  }
})