Some day, perhaps, but the code is MIT license and anyone is welcome to collaborate. (FWIW, @pcgregory turned my fasttracker 2 player into a full fledged tracker: https://wetracker.herokuapp.com/) I'm busy with other projects now; this is something I keep coming back to once in a while, and if I do it'll be to improve the fidelity before I make a pretty frontend...
It still needs accent emulation which is a bit of work, high pass output filter (it's bassier than a real 303 because there's some capacitors between the filter output and the amplifier I'm not emulating), the knob ranges / nonlinearities aren't quite right...
edit: And it also needs the square wave, which is super weird on the 303, as you're aware (yours has a sample for it I think)
Haha, sorry about that. I think your preview sounds a lot better than my version and the code is impressive. I need to make a few changes to my app, one of the main ones is the fact that you cant adjust the cutoff whilst the envelope is in progress but I have recently come across this technique which I am going to implement:
http://stackoverflow.com/questions/30019666/web-audio-synthe...
My Acid Machine app has been built in a way so that all of the instruments are self contained modules, you could possibly create an instrument that would be compatible with the whole UI and step sequencer etc of my app quite easily.
Well, in your case you're using the webkit exponentialRampToValueAtTime or whatever it's called, so you could just recompute the envelope (it's an exponential sweep... actually it's sort of double-exponential, which is another thing I need to fix in mine) and issue new filter sweeps every time the knobs move, right? you could set it based on when the envelope was triggered in the past and it should work fine.
edit: nevermind, I thought you could specify a startTime in addition to endTime but you can't. so you'd have to use audioContext.currentTime to figure out where the sweep should be now, ramp to there, and exponential sweep down to the final value at the end time.
I've not tried the technique linked to yet but it makes it sound like you don't need to make any calculations yourself if you connect a gain node to the filter input and adjust that instead of directly adjusting the filter. I'm guessing it takes that input and adds it to the current value of the envelope.
15 comments
[ 2.7 ms ] story [ 50.2 ms ] thread[1] https://news.ycombinator.com/item?id=13526149
Basically, not at all like a 303 except in spirit
https://github.com/a1k0n/gsynth/blob/master/modules/tb303/tb...
It doesn't sound very much like a real tb303 whatsoever. I'm working on a JavaScript one based on an x0xb0x I built, but it has a long way to go.
https://www.a1k0n.net/code/x0x/
It still needs accent emulation which is a bit of work, high pass output filter (it's bassier than a real 303 because there's some capacitors between the filter output and the amplifier I'm not emulating), the knob ranges / nonlinearities aren't quite right...
edit: And it also needs the square wave, which is super weird on the 303, as you're aware (yours has a sample for it I think)
I can't remember how I found these numbers or what I googled to come across them.
My Acid Machine app has been built in a way so that all of the instruments are self contained modules, you could possibly create an instrument that would be compatible with the whole UI and step sequencer etc of my app quite easily.
edit: nevermind, I thought you could specify a startTime in addition to endTime but you can't. so you'd have to use audioContext.currentTime to figure out where the sweep should be now, ramp to there, and exponential sweep down to the final value at the end time.
It definitely needs some improvement.
Try it out live here: http://errozero.co.uk/acid-machine/