Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add drum synth #192

Open
mmckegg opened this issue May 12, 2016 · 12 comments
Open

add drum synth #192

mmckegg opened this issue May 12, 2016 · 12 comments

Comments

@mmckegg
Copy link
Owner

mmckegg commented May 12, 2016

Add sources for synthesised drum sounds based on @itsjoesullivan's awesome drum modules:

Will need to figure out a way to integrate the params into Loop Drop's automation/linking system. May have to import the source directly to hook (maybe add to audio-slot).

Not sure if there should just be a single "Drum Synth" source, or if each sound should be it's own.

@itsjoesullivan
Copy link

Cool! Any way I can help?

@mmckegg
Copy link
Owner Author

mmckegg commented May 16, 2016

@itsjoesullivan: for some reason I'm experiencing hard crashes after the module has triggered many (say 1000+) times. I'm running inside of electron.

Trying to get to the bottom of it. Very strange.

@mmckegg
Copy link
Owner Author

mmckegg commented May 17, 2016

@itsjoesullivan: I just tried the updated kick-eight, snare, and hi-hat. Great news! They aren't causing crashes anymore!

Guess it must have been the noise buffer generation causing problems.

@itsjoesullivan
Copy link

Oh sweet, good to hear. My benchmarks (setInterval(play, 100);) showed that the new versions use about 1/3 of the resources. However, when I stopped playback CPU usage remained troublingly high. So I suspect we're not out of the woods yet.

I'm interested to see how you're using these! Would be great to checkout a branch.

@mmckegg
Copy link
Owner Author

mmckegg commented May 18, 2016

@itsjoesullivan: I'm currently experimenting with adding params to all of the different drum modules. Would you prefer I create issues, or just send you some PRs?

Working on adding them to audio-slot and then I'll expose them as source nodes in Loop Drop. I'll give you a link once I push something.

Hopefully I'll have some stuff on SoundCloud soon featuring your drums 😄

@itsjoesullivan
Copy link

I'm not sure exactly what the API change is, but issue or PR is fine! I'll be excited to hear them in your music. I git cloned Loop Drop, and boy do things sound great going through the effects chain you've set up. That's an area I haven't spent much time in.

@mmckegg
Copy link
Owner Author

mmckegg commented May 18, 2016

Got distracted testing this afternoon and this happened: https://soundcloud.com/destroy-with-science/overflow-noise-buffer - it's all kick-eight, kick-nine, snare and a couple of basic synths.

As you can probably hear, I have added params for controlling pitch, and added decay time to the snare. Haven't got as far as messing with hi-hats yet, but I think I'd like to swap out the open: true option for a decay param.

DRUM SYNTHS ARE SO MUCH FUN!! Finally can stop using boring old 808 and 909 samples 😆

@itsjoesullivan
Copy link

Wow, awesome! Listened a few times, I guess you've got pitch on the kick, at least?

I spent some time working on the snare. With what I just published, snareNodes have detune, snappy (noise gain), and tone (balance b/w low and high pitch oscillator) AudioParams, and a duration property, which is just a number. All can be screwed around with here. Does exposing those parameters that way fit into your model? Anything else that can be usefully exposed?

Yeah, samples are a little boring, but when it comes to pitched snares I think our ears are more used to hearing and 808 snare sample tuned rather than the actual synthesizer. So I think there's room/need for both.

@mmckegg
Copy link
Owner Author

mmckegg commented May 19, 2016

@itsjoesullivan: I see you are experimenting with "custom" AudioParams. I tried something similar a while back, and I found that while it worked great - there was a major performance penalty when using a lot of them (over built in params).

But there's also another hack where you can take the output of the node, run it through a flatline waveshaper, and then apply gain to that. I seem to recall it performed a little better. But I actually ended up removing all of the AudioParam hacks from loop drop, and did my own thing. It's a bit crappy, but at least there's no performance penalty.

@mmckegg
Copy link
Owner Author

mmckegg commented May 19, 2016

@itsjoesullivan: But yes, exposing the params like that does fit my model nicely, so will have to benchmark and see how it goes!

@itsjoesullivan
Copy link

Naturally, I got the voltage idea from you -- maybe you should publish it as a module? But I don't think there's anything custom about the detune param -- it's just an AudioParam attached to a GainNode that is attenuating a buffer source node ("voltage") that's connected to the oscillators' respective detune params. No script processor involved. It is some complexity though, so if there is a performance hit I'm in trouble because that's what my envelope generator uses as well.

re: performance, I realized that now that these instruments share some audio graph between "node"s, I need to do something like this to avoid leaving around thousands of silent gain nodes that eat up CPU. so, look for that to roll out eventually.

Anyway, I'll follow this, happy to merge in whatever you need when the time comes.

@mmckegg
Copy link
Owner Author

mmckegg commented May 19, 2016

@itsjoesullivan: I created audio-voltage a while ago, but it looks like it could do with being updated to the BufferSource method. Didn't realise it was still using the old ScriptProcessor method.

@mmckegg mmckegg added the active label Jun 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants