Git Product home page Git Product logo

jfxr's Introduction

Jfxr is a browser-based tool to generate sound effects, for example for use in games. It was inspired by bfxr, but aims to be more powerful and more intuitive to use.

Start using it right now at jfxr.frozenfractal.com.

FAQ

Can I use these sounds commercially?

Yes! Any sound you create with jfxr is entirely yours, and you are free to use it in any way you like, including commercial projects.

Is attribution required?

Attribution is not required, but I would really appreciate if you could link back to jfxr in some way. I would also be delighted if you send me a link to your creation!

How does it compare to sfxr/bfxr?

Compared to bfxr, the only missing feature is the mixer (which mixes multiple generated sounds together). There is an open issue to address that. Some filters also have a slightly different meaning, most notably the bit crunch, which is a real bit crunch rather than a downsample.

What are the system requirements?

Jfxr has been tested on the latest Chrome and Firefox, on Linux and OS X. In other modern browsers, I guarantee that the sliders will look broken, but hopefully everything else will still work.

Reporting bugs

Please report any issues you find to the issue tracker on GitHub.

Technical details

Jfxr uses Angular.js for its UI and module dependency management. It relies on several modern web technologies: WebAudio, canvas2d, local storage and of course CSS3.

Developing

To assemble the JavaScript files into a runnable whole, you need Node.js and Yarn installed. (npm might work, but is not recommended.)

To install the development dependencies, run:

cd app
yarn install

Then, to build the app:

yarn build

This produces output in the app/dist directory, which can be used locally or copied to a webserver.

Use as a library

The sound synthesis code can be used as a standalone library. To build it separate from the app:

cd lib
npm install
npm run build

This produces an npm package in the lib/dist directory, which can be used as-is or published to the npm registry.

For development, there is also a script to continuously rebuild on change:

npm run watch

For further details, see lib/README.md or the documentation on npmjs.com.

Ports

License

The code itself is under a three-clause BSD license; see LICENSE for details.

Any sound effects you make are entirely yours to do with as you please, without any restrictions whatsoever.

jfxr's People

Contributors

dependabot[bot] avatar ttencate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jfxr's Issues

Feature request: Extendable sound types

I asked the developer of bfxr for this feature once, and he declined to add it to his project, but I still think it's a good idea. I’d like to be able to create additional “classes” of sound effect, beyond “Pickup/coin, Laser/shoot, Explosion, Powerup, Hit/hurt, Jump, Blip/select”.

I’d like to see a means by which people can develop their own categories for other types of sound, and extend *fxr by adding them and sharing them.

There’s so many categories that aren’t currently well represented by the existing ones: wind/surf, voices, vehicle/engine, alarm/siren, and so on.

Someone with advanced knowledge in audio engineering could design “sound profiles” for these by setting range constraints on the various sliders, and then save that as a new sound type.

Ideally, rather than adding these specific categories, if you made jfxr extendable in this way, anyone who uses it could create new sound types and then save them for later use, or even share them so that anyone using jfxr could use them.

Integrating jfxr in Gdevelop - a bit of help

Hi,
I built the web app and am now getting it embedded in gdevelop.
Basically I need to get the json data of the sound effect and the base64 string of the wav file.
Then I need to be able to load the json data when angular opens and it was saved back to gdevelop in the past.
That is how it works for jsfx.

Because jfxr is an angular app, I am now wondering how do I access its controller and all of its methods in electron/nodejs? Is there a simple way to access the dom?

Sorry I dont have any previous Angular experience

EDIT: Pull ready to merge in gdevelop now
4ian/GDevelop#716
Much thanks to both @4ian and @ttencate for the help/advice along the way

npm run build fails

I get this error:

E:\DEV\jfxr\app>npm run build

> [email protected] build E:\DEV\jfxr\app
> grunt

Running "jshint:files" (jshint) task
>> 17 files lint free.

Running "webpack" task
Hash: 0490a0246d856f881d76
Version: webpack 4.22.0
Time: 85ms
Built at: 2018-10-21 20:53:08

ERROR in Entry module not found: Error: Can't resolve './app/js/index.js' in 'E:\DEV\jfxr\app'
Warning:  Use --force to continue.

Aborted due to warnings.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! [email protected] build: `grunt`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\blury\AppData\Roaming\npm-cache\_logs\2018-10-21T19_53_08_518Z-debug.log

Clarify licensing issue

People are asking whether the generated sounds are OK for commercial use. Yes, they are, but this should be documented somewhere.

Add compression window / exponential falloff

Compression currently works on a single sample, essentially sample = Math.pow(sample, compression). It would be useful to have a compressor that amplifies quiet parts of the sound, based on the RMS of a short sliding window, or (easier) the RMS of all samples so far, exponentially weighted to favour recent ones. The current compressor would be a special case for falloff = 0.

Crashes in WebKit and Firefox Nightlies due to WebAudio API issues

The three offending lines:

Turns out the first one currently requires the BufferSize (at least in WebKit) and the latter two also require at least the when argument to be present.

Setting the buffer to 1024 and passing 0 as the first parameter to this.source.start() and this.source.stop() made it work in both browsers.

For reference:

Consider renaming Vibrato and Tremolo to FM and AM

From an email conversation:

From a synth-geek perspective, I might rename the term “Vibrato” to “Frequency Modulation” or “FM", because vibrato (usually a guitar or vocal modulation ‘effect’) never gets to the speeds that this particular modulator does, usually no faster than 2 - 10 Hz = pretty slow. If it did, we would have some VERY bizarre vocal/string/guitar pedal sounds!

The same goes for “Tremolo” - a quick rename to “Amplitude Modulation” or “AM” - again due to actual speeds being beyond human capability.

Add undo button

There should be a way to undo what you just did. Plus, of course, a Ctrl+Z / Cmd+Z shortcut key.

[suggestion] Package as native app

Wrapping Jfxr with something like electron would allow for easy distribution. This means that you could easily distribute Jfxr in sites like itch.io.

I've had a go myself, using nativefier, and all seems to be working. However I think it'd be best if the original author creates (and owns) the entry on itch.io.

Add a volume slider

A volume slider would be very nice, because the sounds are really loud when my computers at regular volume

unable to run npm install / build in current nodejs


i am pretty sure, this is an update problem, that i am unable to resolve:

  • i am using npm: '8.11.0', node: '16.15.1'
  • when running npm install, it fails with the following error:
npm ERR! code 1
npm ERR! path /Users/tp/Documents/GitHub/jfxr/app/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/local/bin/node /Users/tp/Documents/GitHub/jfxr/app/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
  • after updating the sass version, like so:
    "node-sass": "^7.0.1",
    "sass-loader": "^10.3.0",

npm install completes with 41 vulnerabilities

  • however, npm run build then fails with:
ERROR in ./css/index.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
ValidationError: Invalid options object. Sass Loader has been initialized using an options object that does not match the API schema.

even updating "mini-css-extract-plugin": "^1.6.2" does not resolve this issue.

i tried several versions now, updating all the modules, running npm audit fix at several stages, but was unable to get a build.
i hope i am not missing something obvious here...

Save/export not working well on Safari

"Save" opens the JSON in a new tab, where you can hit Cmd+S to save. "Export" opens a new tab which briefly displays some playback controls, but then switches to a noninteractive QuickTime logo. There seems to be no way to save the WAV from there.

This is an issue with Safari that, unfortunately, even the awesome FileSaver.js shim cannot do anything about: eligrey/FileSaver.js#12

We need to detect whether this is broken, and show the user a helpful warning.

Add loop option

This should do some automatic crossfading of configurable duration, and of course looping playback.

Switch fully to Webpack

The Grunt + Webpack approach doesn't allow for an efficient development workflow; we can only run the entire pipeline again if something changes. But I think we can drive everything from Webpack and get some extra goodies as a bonus (ES2015, SCSS).

  • Replace grunt-contrib-jshint by eslint-loader
  • Replace grunt-contrib-copy by file-loader
  • Replace grunt-contrib-cssmin by sass-loader
  • Replace grunt-contrib-imagemin by image-webpack-loader
  • Add support for ES2015 using Babel, compile it to ES5 or even ES4 [pointless, because AudioContext requires a fairly modern browser anyway, and pretty much implies ES5 support]

Tremolo applied twice.

I'm not 100% sure as I only looked at the code, but I believe Tremolo is applied twice to the sound:

  • once in the "Envelope" phase via the amplitudeAt function.
  • once in the "Tremolo" phase.

API instead of click

Hello team, i work with python, i am not skilled for javascript, is it possible to have an API to GET / POST a json and download the resulting sound ?
JFXR is very nice

Load from link is broken

Add checkbox to make preset buttons overwrite the current sound

Without this, the sound list fills up really quickly, and deleting them all is tedious.

Probably needs Undo option first, in case you hit the preset button expecting it to create a new sound, but instead it overrides your carefully crafted current sound.

The web app uses too much CPU

I like the visualization and tooltips of this app. However, it the performance is not very well. On my mac book pro (chrome), it takes 100% cpu time. After turn off the "auto" option, it still takes 20-30% when idle. Can you fix this? Or simply port it to desktop? Or a mobile app?

Feature request: Layering sounds

I'm unsure how difficult this would be to implement as this project is entirely out of my domain, but it would be really convenient to additively stack multiple sounds on top of each other, and compress/amplify/normalize the result at the end.

Unable to run `yarn build` on MacOsX

I have macOsX 10.15 and i can run the command yarn install, but when I run the command yarn build, I get the following error:

yarn run v1.22.19
warning ../../../package.json: No license field
$ webpack
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:133
		if(isError) throw e;
		            ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/webpack/lib/NormalModule.js:471:10)
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/webpack/lib/NormalModule.js:503:5
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/webpack/lib/NormalModule.js:358:12
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at Object.context.callback (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at Object.module.exports (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/eslint-loader/index.js:274:11)
    at LOADER_EXECUTION (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:119:14)
    at runSyncOrAsync (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:120:4)
    at iterateNormalLoaders (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /Users/Hackcraft_/Downloads/jfxr-master/app/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.1.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Play preview sound on release of slider, not during drag

Right now when you change a parameter, the sound plays as you drag the slider. This results in the sound being repeated over itself - not playing to the end until you release it.

I think it will be generally better to hear it from start to end when the mouse releases the slider instead of as you are dragging it.
That way the sound will play from start to end clearly and we wont have to click on the play button after that to hear it out properly

request: set jfxr.autoplay to false onload

this is so the app doesnt autoplay upon loading.
I am trying to stop it from playing a sound when loading , because when embeding it in gdevelop, I am making it load a sound that it previously stored in a gdevelop project- after it has loaded.

What ends up happening is that it loads, it plays the last edited sound from another resource, then loads the sound from my resource and plays it after.

I was wondering if there is a way of disabling this by appending autoplay=0 to the url of the app or something

Add Undo button

This should undo the last modification to the current sound.

Add band-limited oscillators

Quoting my friend @thedjinn: "I would strongly suggest using band-limited waveforms as oscillators though, because that eliminates the audible aliasing. [...] One way to get band-limited waveforms is to create them with the Fourier series. If that's too slow (e.g. if you want real-time stuff) then precompute some wavetables and sample from these using Hermite interpolation. There are plenty of examples on MusicDSP."

Add downsample

What bfxr calls "Bit crush" is actually a downsampling and re-upsampling. Add it under this name (with sweep).

Something horribly wrong with encoding in links

Make it faster / don't freeze the UI

Currently, the sound is synthesized all in one go. For long sounds, this leads to UI freeze and bad user experience.

There is already some code to do the work in chunks, and set a 0 millisecond timer to start the next chunk. This worked, but I noticed that this slows down generation of short sounds significantly. Maybe we could use a dynamic chunk size, and run synchronously if that would give acceptable latency, asynchronously otherwise.

I also tried web workers, but there are some problems. You cannot interrupt a web worker unless it's going through its message loop, which means we need to run in chunks inside the web worker as well. Alternatively, we could kill the entire worker and start a new one, but a garbage collection bug on Chrome made the tab crash after some 50 workers had been created. We could also have a pool of workers, and just let old ones run to completion, wasting some CPU.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.