Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zzfx

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zzfx - npm Package Compare versions

Comparing version 1.2.1 to 1.2.3

.gitattributes

2

package.json
{
"name": "zzfx",
"version": "1.2.1",
"version": "1.2.3",
"description": "A Tiny JavaScript Sound FX System",

@@ -5,0 +5,0 @@ "main": "ZzFX.js",

# ZzFX - Zuper Zmall Zound Zynth
[![NPM Package][npm]][npm-url]
[![Build Size][build-size]][build-size-url]
[![NPM Downloads][npm-downloads]][npmtrends-url]
[![DeepScan][deepscan]][deepscan-url]
ZzFX is a tiny sound generator designed to produce a wide variety of sound effects with minimal code overhead. It's perfect for games, prototypes, and any web application that needs sound without the bulk of traditional sound files.
# [ZzFX Sound Designer](https://killedbyapixel.github.io/ZzFX) - [Soundboard Demo](https://codepen.io/KilledByAPixel/full/BaowKzv)
## ZzFX Features
![ZzFX Image](/screenshot.png)
- Tiny sound generator with 20 controllable parameters
- Play audio via code, no need for sound asset files
- Compatible with nearly all web browsers
- Small code footprint, the micro version is under 1 kilobyte uncompressed
- Can produce a large variety of sound effect types
- Sounds can be played with a short function call
- No additional libraries or dependencies are required
- Open source with MIT license, you can use this for anything!
## 🌟 Features
# Why Use ZzFX?
- Compact: Less than 1 kilobyte when compressed!
- Versatile: 20 controllable parameters for diverse sound effects.
- No Dependencies: Standalone with no external libraries.
- Cross-Browser: Compatible with nearly all web browsers.
- Open Source: MIT licensed, use it anywhere!
- You can quickly add or change sound effects with just one line of code
- Without sound asset files your game is smaller and faster for users to download
- While prototyping you can use ZzFX for placeholder sound effects
- For size limited game jams like [JS13K](https://js13kgames.com/), ZzFX uses very minimal overhead
- ZzFX is not just for games, you can use it to easily add sounds to any website
## 🔊 Why Use ZzFX?
# How to Use
- Code-Driven Sound: Add or change sound effects with just one line of code.
- Lightweight: No sound asset files mean faster download times.
- Prototyping: Ideal for placeholder sound effects.
- Game Jams: Minimal overhead for size-limited competitions like [JS13K](https://js13kgames.com/).
- Not Just for Games: Enhance any website with sound.
## 🚀 How to Use
* Download from github or use `npm install zzfx`

@@ -30,5 +36,5 @@ * Import ZZFX as a module with using `import {ZZFX, zzfx} from './ZzFX.js'`

* To play a sound just call zzfx(), something like `zzfx(...[,,,,.1,,,,9])`
* Use [the ZzFX sound designer web app](https://killedbyapixel.github.io/ZzFX) to create new sounds
* Use [the ZzFX sound designer web app](https://killedbyapixel.github.io/ZzFX) to craft new sounds.
Here are a few more examples examples...
Sample sounds...

@@ -42,23 +48,30 @@ ```javascript

![ZzFX Image](/screenshot.png)
## 🎶 ZzFX Music
## [ZzFX Music](https://keithclark.github.io/ZzFXM/)
- [ZzFX now supports music via ZzFXM by Keith Clark!](https://keithclark.github.io/ZzFXM/)
- Both the player and songs are super tiny and compress well
- [NoteCraft](https://killedbyapixel.github.io/NoteCraft/) can also export to ZzFXM
- Super tiny player and songs.
- Compatible with [NoteCraft](https://killedbyapixel.github.io/NoteCraft/) exports.
# ZzFX Micro Code
## 🛠️ ZzFX UI Features
- Random Sound Generation: Create sounds from presets.
- Sound Management: Auto-save, rename, and favorite sounds.
- Sound Visualization: View sound wave images on playback.
- Sharing: Load sounds via pasted zzfx code.
- Export/Import: Drag-and-drop support for sound lists.
- Offline Playback: Save sounds as .wav files.
## 🖥️ ZzFX Micro Code
Here's all the code you need to play ZzFX sounds with JavaScript!
```javascript
// ZzFXMicro - Zuper Zmall Zound Zynth - v1.2.1 by Frank Force ~ 880 bytes
// ZzFXMicro - Zuper Zmall Zound Zynth - v1.2.3 by Frank Force ~ 887 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;a<h;k[a++]=f)++J%(100*F|0)||(f=q?1<q?2<
q?3<q?M.sin((g%d)**3):M.max(M.min(M.tan(g),1),-1):1-(2*g/d%2+2)%2:1-4*M.abs(M.
0,B=0)=>{let 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;a<h;k[a++]=f)++J%(100*F|0)||(f=q?1<q
?2<q?3<q?M.sin((g%d)**3):M.max(M.min(M.tan(g),1),-1):1-(2*g/d%2+2)%2:1-4*M.abs(M.
round(g/d)-g/d):M.sin(g),f=(l?1-B+B*M.sin(d*a/l):1)*(0<f?1:-1)*M.abs(f)**D*zzfxV

@@ -72,59 +85,15 @@ *p*(a<e?a/e:a<e+m?1-(a-e)/m*(1-w):a<e+m+r?w:a<h-c?(h-a-c)/t*w:0),f=c?f/2+(c>a?0:

## ZzFX UI Features
## 🎮 Games Using ZzFX
- Generates random sounds from presets
- Sound list is automatically saved
- Each parameter can be modified with constraints
- Lock and mutate buttons for each parameter
- Sounds can be renamed
- Shortens code for zzfx sound calls
- Displays image of sound wave when played
- Sounds can be marked as favorites to prevent removal
- Sounds can be loaded by pasting zzfx code for easy sharing
- List of sounds can be exported and imported
- Supports drag-and-drop of exported files into sound list
- Supports saving sounds as wav files for offline playback
[Space Huggers](https://js13kgames.com/entries/space-huggers) / [Packabunchas](https://js13kgames.com/entries/packabunchas) / [Galaxy Rider](https://js13kgames.com/entries/galaxy-rider) / [The Adventures of Captain Callisto](https://js13kgames.com/entries/the-adventures-of-captain-callisto) / [Welcome to Space](https://js13kgames.com/entries/welcome-to-space) / [Bogus Roads](https://www.newgrounds.com/portal/view/747570) / [NoteCraft](https://js13kgames.com/entries/notecraft) / [The Wandering Wraith](https://js13kgames.com/entries/the-wandering-wraith) / [Bounce Back](https://www.newgrounds.com/portal/view/755171) / [Hue Jumper](https://killedbyapixel.itch.io/hue-jumper) / [Bubba's Back Room](https://js13kgames.com/entries/bubbas-back-room) / [Backstabber Hero](https://js13kgames.com/entries/backstabber-hero) / [Spendotron: 2019](https://killedbyapixel.itch.io/currency-wars) / [Dioretsa](https://js13kgames.com/entries/20461-dioretsa) / [Back 2 Back](https://js13kgames.com/entries/back-2-back) / [Quick Wins](https://js13kgames.com/entries/quick-wins) / [Back Relax](http://js13kgames.com/entries/back-relax) / [Back To The Island](https://js13kgames.com/entries/back-to-the-island) / [Backspace It](http://js13kgames.com/entries/backspace-it) / [Back To The Stars](https://js13kgames.com/entries/back-to-the-stars) / [Can't Get Back](https://js13kgames.com/entries/cant-get-back) / [Letchworth Village](https://js13kgames.com/entries/letchworth-village) / [Noegnud](https://js13kgames.com/entries/noegnud) / [Sausage Redemption](https://gogoprog.itch.io/sausage-redemption) / [Marshmallow Sky](https://github.com/baturinsky/marshmallow-sky) / [Big Champ](https://js13kgames.com/entries/big-champ) / [I want to google the game](https://js13kgames.com/entries/i-want-to-google-the-game) / [Edge Not Found](https://js13kgames.com/entries/edge-not-found) / [Stolen Sword](https://js13kgames.com/entries/stolen-sword) / [Highway 404](https://js13kgames.com/entries/highway-404) / [The Last Spartan](https://js13kgames.com/entries/the-last-spartan) / [OS13k](https://github.com/KilledByAPixel/OS13k) / [Crab Story](https://www.crabstory.io/) / [Cooking for Skully](https://github.com/gheja/js13k2022) / [Egg Time Rewind](https://js13kgames.com/entries/egg-time-rewind) / [Charon Jr.](https://js13kgames.com/entries/charon-jr) / [13](https://js13kgames.com/entries/13) / [Soul Surf](https://js13kgames.com/entries/soul-surf) / [Dead Again](https://js13kgames.com/entries/dead-again) / [Trench Fisher](https://swashvirus.github.io/trench-fisher) / [Path to Glory](https://js13kgames.com/entries/path-to-glory) / [Merlin vs Alfonso](https://js13kgames.com/entries/merlin-vs-alfonso) / [Casual Crusade](https://js13kgames.com/entries/casual-crusade) / [Squirtcopter](https://joachimford.uk/squirtcopter/)
## Games Using ZzFX
![ZzFX Image](/icon.png)
- [Space Huggers](https://js13kgames.com/entries/space-huggers)
- [Packabunchas](https://js13kgames.com/entries/packabunchas)
- [Galaxy Rider](https://js13kgames.com/entries/galaxy-rider)
- [The Adventures of Captain Callisto](https://js13kgames.com/entries/the-adventures-of-captain-callisto)
- [Welcome to Space](https://js13kgames.com/entries/welcome-to-space)
- [Bogus Roads](https://www.newgrounds.com/portal/view/747570)
- [NoteCraft](https://js13kgames.com/entries/notecraft)
- [The Wandering Wraith](https://js13kgames.com/entries/the-wandering-wraith)
- [Bounce Back](https://www.newgrounds.com/portal/view/755171)
- [Hue Jumper](https://killedbyapixel.itch.io/hue-jumper)
- [Bubba's Back Room](https://js13kgames.com/entries/bubbas-back-room)
- [Backstabber Hero](https://js13kgames.com/entries/backstabber-hero)
- [Spendotron: 2019](https://killedbyapixel.itch.io/currency-wars)
- [Dioretsa](https://js13kgames.com/entries/20461-dioretsa)
- [Back 2 Back](https://js13kgames.com/entries/back-2-back)
- [Quick Wins](https://js13kgames.com/entries/quick-wins)
- [Back Relax](http://js13kgames.com/entries/back-relax)
- [Back To The Island](https://js13kgames.com/entries/back-to-the-island)
- [Backspace It](http://js13kgames.com/entries/backspace-it)
- [Back To The Stars](https://js13kgames.com/entries/back-to-the-stars)
- [Can't Get Back](https://js13kgames.com/entries/cant-get-back)
- [Letchworth Village](https://js13kgames.com/entries/letchworth-village)
- [Noegnud](https://js13kgames.com/entries/noegnud)
- [Sausage Redemption](https://gogoprog.itch.io/sausage-redemption)
- [Marshmallow Sky](https://github.com/baturinsky/marshmallow-sky)
- [Big Champ](https://js13kgames.com/entries/big-champ)
- [I want to google the game](https://js13kgames.com/entries/i-want-to-google-the-game)
- [Edge Not Found](https://js13kgames.com/entries/edge-not-found)
- [Stolen Sword](https://js13kgames.com/entries/stolen-sword)
- [Highway 404](https://js13kgames.com/entries/highway-404)
- [The Last Spartan](https://js13kgames.com/entries/the-last-spartan)
- [OS13k](https://github.com/KilledByAPixel/OS13k)
- [Crab Story](https://www.crabstory.io/)
- [Cooking for Skully](https://github.com/gheja/js13k2022)
- [Egg Time Rewind](https://js13kgames.com/entries/egg-time-rewind)
- [Charon Jr.](https://js13kgames.com/entries/charon-jr)
- [13](https://js13kgames.com/entries/13)
- [Soul Surf](https://js13kgames.com/entries/soul-surf)
- [Dead Again](https://js13kgames.com/entries/dead-again)
![ZzFX Image](/icon.png)
[npm]: https://img.shields.io/npm/v/zzfx
[npm-url]: https://www.npmjs.com/package/zzfx
[build-size]: https://badgen.net/bundlephobia/minzip/zzfx?3
[build-size-url]: https://bundlephobia.com/result?p=zzfx
[npm-downloads]: https://img.shields.io/npm/dw/zzfx
[npmtrends-url]: https://www.npmtrends.com/zzfx
[deepscan]: https://deepscan.io/api/teams/22950/projects/26379/branches/838286/badge/grade.svg
[deepscan-url]: https://deepscan.io/dashboard#view=project&tid=22950&pid=26379&bid=838286
/*
ZzFX - Zuper Zmall Zound Zynth v1.2.1 by Frank Force
ZzFX - Zuper Zmall Zound Zynth v1.2.3 by Frank Force
https://github.com/KilledByAPixel/ZzFX

@@ -5,0 +5,0 @@

@@ -13,3 +13,3 @@ // ZzFX - Zuper Zmall Zound Zynth - Micro Edition

// ZzFXMicro - Zuper Zmall Zound Zynth - v1.2.1 by Frank Force
// ZzFXMicro - Zuper Zmall Zound Zynth - v1.2.3 by Frank Force

@@ -16,0 +16,0 @@ // ==ClosureCompiler==

@@ -11,10 +11,10 @@ // ZzFX - Zuper Zmall Zound Zynth - Micro Edition

// ZzFXMicro - Zuper Zmall Zound Zynth - v1.2.1 by Frank Force ~ 880 bytes
// ZzFXMicro - Zuper Zmall Zound Zynth - v1.2.3 by Frank Force ~ 887 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;a<h;k[a++]=f)++J%(100*F|0)||(f=q?1<q?2<
q?3<q?M.sin((g%d)**3):M.max(M.min(M.tan(g),1),-1):1-(2*g/d%2+2)%2:1-4*M.abs(M.
0,B=0)=>{let 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;a<h;k[a++]=f)++J%(100*F|0)||(f=q?1<q
?2<q?3<q?M.sin((g%d)**3):M.max(M.min(M.tan(g),1),-1):1-(2*g/d%2+2)%2:1-4*M.abs(M.
round(g/d)-g/d):M.sin(g),f=(l?1-B+B*M.sin(d*a/l):1)*(0<f?1:-1)*M.abs(f)**D*zzfxV

@@ -21,0 +21,0 @@ *p*(a<e?a/e:a<e+m?1-(a-e)/m*(1-w):a<e+m+r?w:a<h-c?(h-a-c)/t*w:0),f=c?f/2+(c>a?0:

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc