/** A note whose sound is generated by one or more BytebeatNode
* @param {Object[]} oscParams array of oscillator specific options
* @param {string} oscParams.bytebeat
* @param {number} [oscParams[].frequency=8000] frequency of the oscillator in Hertz
* @param {number} [oscParams[].tempo=120] tempo to be passed to bytebeat function
* @param {boolean} [oscParams[].floatMode=false] Whether the bytebeat function expects an output between 0:255 (default) or -1:1
*/
class BytebeatNote extends Note {
constructor (target, noteParams, oscParams) {
super(target, noteParams)
for (const p of oscParams) {
const n = new BytebeatNode(this.context,
p.bytebeat,
p.frequency,
p.tempo,
p.floatMode)
n.connect(this.envGain)
n.start()
this.oscs.push(n)
}
}
}