All Projects → chr15m → jsfxr

chr15m / jsfxr

Licence: Unlicense license
JavaScript sound effects generator.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to jsfxr

retro.derpyenterprises.org
Old website
Stars: ✭ 13 (-89.17%)
Mutual labels:  retro, 8bit, 8-bit
anise-cheezball-rising
an exciting new adventure for the Game Boy Color
Stars: ✭ 72 (-40%)
Mutual labels:  retro, 8bit
hoard-of-bitfonts
turns out I like bitmap fonts
Stars: ✭ 811 (+575.83%)
Mutual labels:  retro, 8bit
LittleSixteen
Commodore 16 schematics and PCB, redrawn in Kicad
Stars: ✭ 26 (-78.33%)
Mutual labels:  retro, 8bit
Great-Cow-BASIC-Demonstration-Sources
Demonstration files for Great Cow BASIC - a compiler for Microchip and AVR 8-bit microcontrollers
Stars: ✭ 18 (-85%)
Mutual labels:  8bit, 8-bit
c64adventures
Adventures into retro 8 bit Commodore 64 programming
Stars: ✭ 14 (-88.33%)
Mutual labels:  8bit, 8-bit
figaro
Real-time voice-changer for voice-chat, etc. Will support many different voice-filters and features in the future. 🎵
Stars: ✭ 362 (+201.67%)
Mutual labels:  sound-effects, sound
cbmtapepi
Use a Raspberry Pi as fast mass storage solution for your Commodore 8-bit computer using just the datassette port.
Stars: ✭ 41 (-65.83%)
Mutual labels:  retro, 8-bit
jekyll-theme-8bit
👾 A Jekyll theme inspired by classic 8bit games.
Stars: ✭ 24 (-80%)
Mutual labels:  retro, 8bit
monobit
Tools for working with monochrome bitmap fonts
Stars: ✭ 124 (+3.33%)
Mutual labels:  retro, 8bit
Rx
👾 Modern and minimalist pixel editor
Stars: ✭ 2,063 (+1619.17%)
Mutual labels:  retro, 8bit
X-Piano
Now you can make your own piano!
Stars: ✭ 13 (-89.17%)
Mutual labels:  sound-effects, sound
Tic 80
TIC-80 is a fantasy computer for making, playing and sharing tiny games.
Stars: ✭ 3,176 (+2546.67%)
Mutual labels:  retro, 8bit
font8x8-rs
8x8 monochrome bitmap fonts for rendering. Implemented in Rust.
Stars: ✭ 15 (-87.5%)
Mutual labels:  8bit, 8-bit
ayfxedit-improved
AYFX Editor (Improved)
Stars: ✭ 24 (-80%)
Mutual labels:  sound-effects, 8-bit
hamtaro-in-pieces
A disassembly of the wonderful Game Boy Color game Hamtaro: Ham-Hams Unite!
Stars: ✭ 15 (-87.5%)
Mutual labels:  retro
birds
Bird Sound Synthesis based on AM+FM
Stars: ✭ 46 (-61.67%)
Mutual labels:  sound
mt762x-wm8960
MT762X WM8960 ALSA SoC machine driver
Stars: ✭ 19 (-84.17%)
Mutual labels:  sound
audio-playback
Ruby/Command Line Audio File Player
Stars: ✭ 20 (-83.33%)
Mutual labels:  sound
8BitComputer
A simple 8 bit computer emulator in C++.
Stars: ✭ 18 (-85%)
Mutual labels:  8bit

Quick 'n' easy game sound effects generator.

App 👉 https://sfxr.me

About | Library

About

A port of sfxr to HTML5 by Eric Fredricksen. Maintained by Chris McCormick.

jsfxr screenshot

Library

You can use the jsxfr library to generate and play sounds in your JavaScript game code.

Node

Install it:

npm i jsfxr

Require it:

const sfxr = require("jsfxr").sfxr;

See API below for usage examples.

Browser

Include the scripts in your page:

<script src="https://sfxr.me/riffwave.js"></script>
<script src="https://sfxr.me/sfxr.js"></script>

You can then directly use the sfxr namespace without requiring it.

API

Generate a sound effect using a preset algorithm and play it using webaudio API.

const sfxr = require("jsfxr").sfxr;

const preset = "pickupCoin";
const sound = sfxr.generate(preset);

sfxr.play(sound);

Available presets are pickupCoin, laserShoot, explosion, powerUp, hitHurt, jump, blipSelect, synth, tone, click, and random.

You can also use the interface at https://sfxr.me to find the sound you want and then use the sound definition. Click the "serialize" button and copy the JSON code for the sound you want. You will get a datastructure that you can use like this:

var sound = {
  "oldParams": true,
  "wave_type": 1,
  "p_env_attack": 0,
  "p_env_sustain": 0.31718502829007483,
  "p_env_punch": 0,
  "p_env_decay": 0.2718540993592685,
  "p_base_freq": 0.2612<F2>6191208337196,
  "p_freq_limit": 0,
  "p_freq_ramp": 0.43787689856926615,
  "p_freq_dramp": 0,
  "p_vib_strength": 0,
  "p_vib_speed": 0,
  "p_arp_mod": 0,
  "p_arp_speed": 0,
  "p_duty": 1,
  "p_duty_ramp": 0,
  "p_repeat_speed": 0.7558565452384385,
  "p_pha_offset": 0,
  "p_pha_ramp": 0,
  "p_lpf_freq": 1,
  "p_lpf_ramp": 0,
  "p_lpf_resonance": 0,
  "p_hpf_freq": 0,
  "p_hpf_ramp": 0,
  "sound_vol": 0.25,
  "sample_rate": 44100,
  "sample_size": 8
};

var a = sfxr.toAudio(sound);
a.play();

You can also use the short URL compressed version of the sound:

var a = sfxr.toAudio("5EoyNVSymuxD8s7HP1ixqdaCn5uVGEgwQ3kJBR7bSoApFQzm7E4zZPW2EcXm3jmNdTtTPeDuvwjY8z4exqaXz3NGBHRKBx3igYfBBMRBxDALhBSvzkF6VE2Pv");
a.play();

You can also access an array of samples. By default the buffer contains audio rendered at a sample rate of 44100.

var buffer = sfxr.toBuffer(sound);
console.log(buffer);

You can convert between the base58 short-url encoded format and JSON using b58encode and b58decode:

var b58string = sfxr.b58encode(sound);
var sound = sfxr.b58decode(b58string);

You can also access the lower level classes SoundEffect and Params if you need to. This can be useful for caching the internal representation for efficiency, or mutating the sound with params.mutate().

links

Thanks

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].