// ZzFX - Zuper Zmall Zound Zynth - Micro Edition // MIT License - Copyright 2019 Frank Force // https://github.com/KilledByAPixel/ZzFX // This is a tiny build of zzfx with only a zzfx function to play sounds. // You can use zzfxV to set volume. // Feel free to minify it further for your own needs! 'use strict';let zzfx,zzfxV,zzfxX // ZzFXMicro - Zuper Zmall Zound Zynth - v1.2.0 by Frank Force ~ 880 bytes zzfxV=.3 // volume zzfx= // play sound (p=1,k=.05,b=220,e=0,r=0,t=.1,q=0,D=1,u=0,y=0,v=0,z=0,l=0,E=0,A=0,F=0,c=0,w=1,m= 0,B=0,M=Math,R=44100,d=2*M.PI,G=u*=500*d/R/R,C=b*=(1-k+2*k*M.random(k=[]))*d/R,g =0,H=0,a=0,n=1,I=0,J=0,f=0,x,h)=>{e=R*e+9;m*=R;r*=R;t*=R;c*=R;y*=500*d/R**3;A*=d /R;v*=d/R;z*=R;l=R*l|0;for(h=e+m+r+t+c|0;aa?0: (az&&(b+=v,C+=v,n=0),!l||++I%l||(b=C,u=G,n||=1);p=zzfxX. createBuffer(1,h,R);p.getChannelData(0).set(k);b=zzfxX.createBufferSource();b. buffer=p;b.connect(zzfxX.destination);b.start();return b};zzfxX=new AudioContext; // fix compatibility issues with old web audio (optional) // if this is used, you must remove the zzfxX=new AudioContext line above! //zzfxX=new(AudioContext||webkitAudioContext);zzfxX.z=zzfxX.createBufferSource;zzfxX.createBufferSource=(s=zzfxX.z())=>(s.start=s.start||s.noteOn,s)