I might add in some default samples if someone can suggest good ones with a suitable license? That said I believe this is exactly how a MPC would work, i.e. no sounds loaded when it is powered on!
Sure, the problem is 99.999% of people don't have small cut up mp3's ready to go. Making your project useless to us because we'll never see how it works!
I couldn't care less if you close the tab. It's a technical demo of the new W3C AudioContext API. Why don't you create something notable instead pontificating what people want?
You passed the 16th note high hat test! Well done.
FWIW, you said "mp3" but I just used the first folder of one-shot samples I came across, which happened to be WAVs and worked fine, but may have contributed to Chrome crashing when I hit the back button.
You can slice samples by clicking and dragging on a waveform, which will cause the selected part of the waveform to be played whenever the pad is triggered.
Tried that out, it works well, but also revealed another limitation—it seems as if I can only trigger two pads concurrently. That may be less a flaw in your app and more an inherent reality resulting from the fact that my keyboard wasn't necessarily meant to be used as a drum pad.
Edit: Potential workaround would be pad-linking (hard kick and deep kick, snare and clap, kick and closed hh if I know I'm playing 16th note hats, etc), if indeed there's no issue with playback of multiple samples and it's only a limitation of the input device.
When I mentioned slicing, I meant more along the lines of setting multiple slice points and assigning the slices to several pads, as one would when loading a drum break into an MPC, for instance. A copy function would accomplish largely the same thing.
Anyway, it's all academic, there's a Maschine sitting right next to the keyboard on my desk, it's not as if I'm actually going to use this as an MPC replacement. Just throwing ideas out there.
Off the top of my head, things that this is lacking: velocity control for each pad, a way to zoom in on waveforms and chop up samples, maybe better loop controls, and the ability to export as .wav?
But suggestions aside, as a budding hip-hop producer/hacker, I had the idea to make this but never the skills/conviction. It made my day to see that this is something actually doable, and capable of being done well.
Thanks. There are a few things I want to add, e.g. a better sequencer, variable tempo, quantisation, local persistence of loaded samples and sequencer data, zoomable waveform for finer grained editing on longer files, etc. I'm quite busy so who knows when I'll get around to it?
This is such an ignorant comment. You're wrong, it's actually nothing like that. It's technical demonstration of edge W3C APIs, not something coded against proprietary APIs or around rendering engine bugs. It requires any browser that has implemented the W3C AudioContext API, which at this point only Chrome has implemented in a generally available release. But this doesn't quite fit into the 80 char constraint of HN link titles.
The difference is that someday this will also work in Firefox, Opera, and/or Safari -- perhaps even the mobile versions. It requires Chrome today, but it won't require Chrome forever.