nl_tokens: Returns a function that plays an oscillator
pl_tokens: function oscillatorPlayer ( ctx , defaultOptions ) { defaultOptions = defaultOptions || { } return function ( note , time , <mask> , options ) { console . warn ( 'The oscillator player is deprecated.' ) console . log ( 'Starting with version 0.9.0 you will have to wait until the soundfont is loaded to play sounds.' ) var midi = note > 0 && note < 129 ? + note : parser . midi ( note ) var freq = midi ? parser . midiToFreq ( midi , 440 ) : null if ( ! freq ) return duration = duration || 0.2 options = options || { } var destination = options . destination || defaultOptions . destination || ctx . destination var vcoType = options . vcoType || defaultOptions . vcoType || 'sine' var gain = options . gain || defaultOptions . gain || 0.4 var vco = ctx . createOscillator ( ) vco . type = vcoType vco . frequency . value = freq /* VCA */ var vca = ctx . createGain ( ) vca . gain . value = gain /* Connections */ vco . connect ( vca ) vca . connect ( destination ) vco . start ( time ) if ( duration > 0 ) vco . stop ( time + duration ) return vco } }