Skip to content

2.1. queueWaveTable

Srgy Surkv edited this page Sep 13, 2019 · 5 revisions

Send audio from instrument to the output

Using

queueWaveTable(audioContext, target, preset, when, pitch, duration, volume, slides);
  • audioContext - AudioContext
  • target - a node to connect to, for example audioContext.destination
  • preset - variable with the instrument preset
  • when - when to play, audioContext.currentTime or 0 to play now, audioContext.currentTime + 3 to play after 3 seconds
  • pitch - note pitch from 0 to 127, for example 2+12*4 to play D of fourth octave (use MIDI key for drums)
  • duration - note duration in seconds, for example 4 to play 4 seconds
  • volume - 0.0 <=1.0 volume (0 is 'no value', 'no value' is 1)
  • slides - array of pitch bends from startup value, every item consists of
    • pitch - tone shift
    • when - time shift
Clone this wiki locally