Closed viewerw closed 1 year ago
Launch example https://playcode.io/1035150
Code
function playTremolo(){ var selectedPreset=_tone_0010_SoundBlasterOld_sf2; var AudioContextFunc = window.AudioContext || window.webkitAudioContext; var audioContext = new AudioContextFunc(); var player=new WebAudioFontPlayer(); var pitch=12*4+7; var volume=0.75; var duration=1; var when=audioContext.currentTime + 0; var slides=[ { delta: 0.5, when: 0.05 } ,{ delta: -0.5, when: 0.1 } ,{ delta: 0.5, when: 0.15 } ,{ delta: -0.5, when: 0.2 } ,{ delta: 0.5, when: 0.25 } ,{ delta: -0.5, when: 0.3 } ,{ delta: 0.5, when: 0.35 } ,{ delta: -0.5, when: 0.4 } ,{ delta: 0.5, when: 0.45 } ,{ delta: -0.5, when: 0.5 } ,{ delta: 0.5, when: 0.55 } ,{ delta: -0.5, when: 0.6 } ,{ delta: 0.5, when: 0.65 } ,{ delta: -0.5, when: 0.7 } ,{ delta: 0.5, when: 0.75 } ,{ delta: -0.5, when: 0.8 } ,{ delta: 0.5, when: 0.85 } ,{ delta: -0.5, when: 0.9 } ,{ delta: 0.5, when: 0.95 } ]; var audioBufferSourceNode = player.queueWaveTable(audioContext , audioContext.destination , selectedPreset , when , pitch , duration , volume , slides ); }
Launch example https://playcode.io/1035150
Code