Audio synthesis / processing in JavaScript
audiolibjs.org
audiolibjs.org
Also, from the API, it seems that I could implement Paulstretch algorithm ( http://hypermammut.sourceforge.net/paulstretch/ ) easily. When I'll have some free time, I'll try it. EDIT: I looked a bit closer on interface EFFECT and Paulstretch cannot be implemented as an effect, but as a generator. Needs to be studied more :)
Paulstretch would be a perfect addition to the library, it would open whole new doors for example for samplers (whoa, the sample is sustained forever!), of course with some limitations in regards of real time. Send me a message on GitHub, if you decide to take up on the task, I'd be glad to give you a hand with it! :)
If you want to look at the algorithm of Paulstretch you can have a look to a simple Python implementation: https://github.com/paulnasca/paulstretch_python/blob/master/... The algorithm is pretty fast, the most time consuming operations are the FFTs and IFFTs. That's why I think that it might work on real-time JS.
However, the Device API should allow access to external inputs, such as microphones and MIDI controllers, so it's coming along!
This is a design choice to make implementing new effects simple, and the framework providing this extra functionality for you.
//api-buffer-effect
self.effects[n].pushSample(buffer[i + n], 0);
//api-generator
out[i + n] = this.getMix(n) * this.mix + buffer[i + n];
This is very different from being able to process batches of samples within your effect or osc code -- even if the JIT inlines the functions of this.mix, you will still incur unnecessary setup cost.Of course, without profiling this is just speculation.
However, I should probably set up some public performance tests and compare the instructions these things compile to have some hard data back my claims, I wouldn't exactly trust me just saying it is so, as I have just tested these things on the fly.
But, however, this approach is more modular, and fits more use cases, and that matters even more for me right now, but trust me, I've spent my time optimizing every operation to the point that it doesn't make things harder to use. :)
I would love to see your performance benchmarks.