Coder Social home page Coder Social logo

oampo / audiolet Goto Github PK

View Code? Open in Web Editor NEW
894.0 894.0 118.0 3.43 MB

A JavaScript library for real-time audio synthesis and composition from within the browser

Home Page: http://oampo.github.com/Audiolet/

License: Apache License 2.0

JavaScript 99.56% CSS 0.33% Shell 0.12%

audiolet's People

Contributors

baffo32 avatar ekosz avatar ewdicus avatar jemaltieri avatar kamasoutra avatar maxnordlund avatar oampo avatar sntx 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  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

audiolet's Issues

Disconnecting - what am I doing wrong?

var audiolet = new Audiolet();
var sine = new Sine(audiolet, 440);
sine.connect(audiolet.output);
sine.disconnect(audiolet.output);

I'm getting the 'inputPin is undefined' error.

Do you have any example of disconnecting nodes?

WAV Output

Add a node which buffers audio into a Float32Array and allows you to export it as a .wav file.

Skipping in Chrome

The basic sine example does not play properly for me in Chrome 14.0.835.186, Windows 7 64-bit. It begins skipping after just a second or two. I have the same issue with any other continuous sound from Audiolet.

The sink.js tests all perform fine for me.

amd compatibility

hi,

amd / requirejs support would be super. dependency clarity, module packaging, and lazy loading would be a nice addition.

assuming you'd like the library to continue to work without requirejs, though, will mean the implementation requires a little thought.

your thoughts?

Safari Support

Hi,

Cant seem to get this to work in safari, is fine in chrome, even the examples.

Thanks, Ed

not require audiolet instance passed to all new objects

don't worry- last one for now. i realize this one is a bit more difficult, but i wouldn't think it's impossible to remove the necessity to pass an Audiolet instance to everything you create.

since i think you can only safely make one instance of sink.js, one way to achieve this would just have scheduler, device, etc set as globals, and pass sampleRate through generate(). i haven't thought about it too much and surely this isn't a good solution... but just to get the ball rolling...

your thoughts?

Pass different frequncies to each channel?

Is there a way to pass an audiolet.output to each channel? For example in the creation of Binaural Beats two slightly different frequencies are passed to the left and right channel. How is this possible with Audiolet?

Missing audiofile.js

It seams to be missing in the Audiolet.js file, and the build/dist scripts as well. Will try to fix this, but havn't heard about juicer until today.

Retrieving Output Buffer from a Node

Hello,

I'd like to retrieve the output buffer from a node somewhere inside the graph for use in visualization. When I log this.node.outputs[0].buffer I get an AudioletBuffer who's first channel is a Float32Array with 4096 values. However if I try this.node.outputs[0].buffer.getChannelData(0) or this.node.outputs[0].buffer.channels[0] the Float32Array has length 0. Am I missing something?

Thanks

Visualization Example

In the buffered approach, it was reasonably easy to show a decent graph of a buffer. In the single sampled approach it seems quite difficult to get similar results. Currently, the included visualization example does not show the graph. Is there a working example of this? Or perhaps more detail on the ramifications of changing to single sample that will allow us to graph it well?

Thanks,
Elliott

build and dist creating bad files

hi,

when i run ./build from the src dir without changing any files, it creates a new Audiolet.js file which differs from the distributed one. when i include it using the Sine example from the readme, i get this error:

Uncaught ReferenceError: Sink is not defined Audiolet.js:707

it seemed that the sink definition was non-existent in Audiolet.js. on a whim, i tried changing the globbing in the build file from sink.js/*.js to sink.js/**/*.js- which actually resolved that issue (and included the Sink definition), but brought upon two new errors:

Uncaught TypeError: Cannot set property 'EventEmitter' of undefined Audiolet.js:5715
Uncaught TypeError: Property 'Sink' of object [object Window] is not a function Audiolet.js:707

i'd keep going down the rabbit hole trying to resolve it but i wanted to see if i was missing something? i am using juicer 1.0.16. thanks!

Caching Buffers?

Hi, just wondering have anyone done any caching with audiolet?

For example, if you create a 1second sine wave, and were to play it back multiple times, would it possible to create a pre-calculated audio object? With this audio object, it could be more efficient to playback the object anytime you need without generating/calculating the buffers again.

Limiter example?

I've played around with the Limiter, but can't seem to get it to do much. I'd be great to have an example of it's proper usage.

More node events

AudioletNodes should emit more events which are useful for GUIs. Connect and disconnect are the obvious candidates.

No audio sink available

Hi,

I'm running Chome 15.0.874.121 on a Mac OS 10.6.8 (snow leopard). Just wondering if anyone encounter this error "No audio sink available" when you try to make too many connections to audiolet in a short time? (Eg. in the user-guide examples, keep pressing "Run examples" and you would encounter this error in a few seconds)

Firefox 8 doesn't seem to have this problem, so I'm suspecting its my browser/plateform or perhaps I'm missing some code that doesn't release resources?

Thanks.

Uncaught No audio sink available

Pretty much any of the examples stop outputting audio and give the error "Uncaught No audio sink available" for Audiolet.min.js:257. Is this just a result of Chrome not fully supporting the audio api yet?

Sample player and FFT

Hi there!

This is not probably the best place to ask this type of questions, but i don't know were to ask them!

I'm using AudioLet to generate sound for a while and i'm loving it.
But now i need to play a sample and get the FFT info. I've been looking to the API documentation and there is a FFT class. I don't know why i can't put it to work. Is there any example where i can see how this is done? or can anyone provide one?

thanks a lot
J

Example code pops/skips and bufferFill runs forever.

tl;dr: is it possible to use this library without it popping and crackling

Hi, I've been playing with audiolet today trying to do some funky text-to-music synthesis in the browser. First, thank you for making this! I would be totally unable to have the fun of making my project without your efforts.

I began by running a few of the examples, and proceeded to follow the tutorial in the wiki. The endlessly generated aimless music blew my socks off! But... it started to pop and crackle after about 30 seconds. At first I thought this may be due to the complexity of the PChoose and PSequences and the Infinitys -- so I went back to an example I'd tried earlier: the simple chord demo.

Play it once, it's fine. Play it ten times, still alright. Play it 50 times... and every play afterward will crackle and pop. "Maybe it's also too complicated", I thought, so I tried just a simple sine note -- got the same result.

I've hit this running Firefox 29.0 (after applying that JavaScriptNode -> ScriptProcessor fix from jussi-kalliokoski/sink.js#20) and Chrome 35.0.1916.114 on Ubuntu 10.10, running in a virtual machine. I thought maybe it's a VM thing, so I tried it externally in Chrome 34.0.1847.137 m on Windows 7 with the same results. Then I considered that it might be my laptop -- it's an i5 with 4GB of RAM, but it feels sluggish some days -- but my roommate got the same results on his substantially beefier desktop.

Doing some profiling and digging into the code, I found that even playing a single note will leave the function bufferFill running about every 80-100ms at the top of the stack forever, as though it got orphaned from a setInterval call, and the memory usage of the page steadily climbs over time -- gc kicks in and drops it, but about every 3-4 gcs, the growth period doubles. I tried to go in and hunt it down, but the timer/worker code is tanglier than I can wrangle.

So my questions: is the bufferFill function a red herring, and this is business as usual? Is it just a fact of life that web audio skips and pops and there's an old webkit bug somewhere, or is this a bug in our layer? Maybe even a bug in sink.js's worker implementation?

Thanks again, for making this and for reading. Any light shed would be welcome; even just an adjustment of my expectations. :)

Optimise, test and merge SingleSample branch

Moves from ticking variable length buffers to ticking a sample at a time. This is good because it simplifies the code significantly, and makes it easier to do stuff like short feedback loops, integrating the Web Audio API and working with fixed length buffers for FFT. The downside is that it's about an order of magnitude slower at the moment, but this should be at least partly optimisable away.

commonjs support

I would like CommonJS support for using in browserify (and others,) which might help simplify the build process & better track dependencies, too.

Here is an example package.json file:

{
  "name": "audiolet",
  "version": "1.0.0",
  "description": "Real-time audio synthesis and composition from within the browser",
  "main": "src/audiolet/commonjs.js",
  "repository": {
    "type": "git",
    "url": "http://github.com/oampo/Audiolet.git"
  },
  "bugs": {
    "url": "http://github.com/oampo/Audiolet/issues"
  },
  "scripts": {
    "build": "browserify src/audiolet/commonjs.js --standalone Audiolet -o src/audiolet/Audiolet.js && uglifyjs src/audiolet/Audiolet.js -o src/audiolet/Audiolet.min.js"
  },
  "devDependencies": {
    "browserify": "^8.0.3",
    "uglify-js": "^2.4.16"
  },
  "dependencies": {
    "sink.js": "^0.0.1"
  }
}

In this example src/audiolet/commonjs.js should be an entry point that exposes the API with module.exports, and you can build standalone versions (for plain browser-globals & requirejs) with npm run build.

If you don't want to go full-on into browserify, etc, support for CommonJS would still enable others who use it to use audiolet easier (and without adding script tags to html.)

if this is published to npm, users can do npm install audiolet to install in their project & use it like this:

var Audiolet = require('audiolet');

Since browserify will build versions for others (requirejs, browser-global) you don't have to manage concatenating the files & if the user uses a module system that avoids browser-globals, they won't be exposed.

Also, as a sidenote, this will add server-side node to your available deployment targets. sink,js already targets node server-side sound, so it should work pretty well, natively.

The real work is going through all the files and setting up the CommonJs dependencies in every file. I am happy to do this work, if all this sounds like a good idea.

Audio Channel routing

I'd like to be able to route audio coming from Audiolet to the audio channels of the OS. I see that Audiolet has internal channels and routing capabilities, is there a way to hook into these channels using something like Soundflower?

I am working on a project that includes remixing streaming internet audio. I've hit a stumbling block at being able to access independent audio streams. Browsers send audio exclusively on channels 1 and 2 AFAIK.

Any help/ideas greatly appreciated.

Uncaught No audio sink available. again?

hm. all of my previously working tests now seem to be returning this error... I see some changes to master head, and using this version removes the error, but my tests are silent. thoughts?

Uncaught No audio sink available. 

[enhancement] Add missing bower.json.

Hey, maintainer(s) of oampo/Audiolet!

We at VersionEye are working hard to keep up the quality of the bower's registry.

We just finished our initial analysis of the quality of the Bower.io registry:

7530 - registered packages, 224 of them doesnt exists anymore;

We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).

Sadly, your library oampo/Audiolet is one of them.

Can you spare 15 minutes to help us to make Bower better?

Just add a new file bower.json and change attributes.

{
  "name": "oampo/Audiolet",
  "version": "1.0.0",
  "main": "path/to/main.css",
  "description": "please add it",
  "license": "Eclipse",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {
    "<dependency_name>": "<semantic_version>",
    "<dependency_name>": "<Local_folder>",
    "<dependency_name>": "<package>"
  },
  "devDependencies": {
    "<test-framework-name>": "<version>"
  }
}

Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.

NB! Please validate your bower.json with jsonlint before commiting your updates.

Thank you!

Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!

Tighter integration with the Web Audio API

This ability to offload some of the processing to C++ would be cool, and would add a fair chunk of DSP code without having to do too much work. The difficult part of this is moving from variable length buffers to fixed length buffers in the graph, and any overheads associated with moving between the C++ and the JS.

chrome 21 problems getting sinks

Not getting any sinks in chrome 21.

this at line 5660:

function Sink (readFn, channelCount, bufferSize, sampleRate) {
    var sinks   = Sink.sinks,
        dev;
    for (dev in sinks){
        if (sinks.hasOwnProperty(dev) && sinks[dev].enabled){
            try{
                return new sinks[dev](readFn, channelCount, bufferSize, sampleRate);
            } catch(e1){
                console.log(dev); // added by me
                console.log(e1); //added by me
            }
        }
    }

    throw Sink.Error(0x02);

is hitting the throw every time.

When dev variable is 'webaudio' or 'webkit', I get a "SYNTAX_ERR: DOM Exception 12", "Error: An invalid or illegal string was specified." which is traced to line 6281:

        node        = context.createJavaScriptNode(bufferSize, 0, channelCount),

Seems "createJavaScriptNode" is misbehaving?

add "midi" sequencing support

i'd like to add what would essentially act as midi inputs and outputs for AudioletNodes (actually, perhaps AudioletGroups only in this case?). my ultimate goal is midi effects, like arpeggiation. a nice side effect of doing this through a midi chain (similar to Ableton) is that we could eventually incorporate true midi i/o into the system with minimal effort.

i have this working as proof-of-concept outside of audiolet you can see here... i ripped out the relevant code to help illustrate here: midi interface proof of concept arp user-keyboard-to-midi message

your thoughts?

Visualization fails in chrome

Browser: chrome 31.0.1650.63
System: OS X 10.8.5
The examples: demo-visualization, drum-machine
Behavior: a blank canvas

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.