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 additional drum kits #10

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

andlehma
Copy link

@andlehma andlehma commented Oct 5, 2018

Per issue #5

Lays out the framework to add tons of different drum kits. I only added one, but it would be pretty trivial to add more.

@kylestetz
Copy link
Owner

Thanks @andlehma! I have some feedback on general approach here.

First: are these samples royalty free and/or in the public domain? I want to avoid checking in anything copyrighted.

Feedback on the approach

The lazy loading system should keep around all of the drum samples as buffers, perhaps organized in an object such as drumBuffers = { acoustic: [], 808: [], ... }. Right now the loader sets the variable drumBuffers equal to whatever it last loaded; this effectively unloads any previous sounds, rather than keeping them around, and it also means that you can't make two drum tracks that have different sounds. The first one will probably end up playing whatever the second one loaded.

Ditto for loading states: we need to keep track of the loading state for each set of drum samples.

Apart from that, I think the drumMap file could contain all of the kits, rather than having a file for each. The drumMap could just get a little more nested, just like the suggestion above:

const drumMap = {
  acoustic: { 0: '/path/to/file/', 1: ...  },
  808: { 0: '/path/to/file/', 1: ... },
};

This would simplify things a bit and it would allow drumBuffers and drumMap to share the same structure. When checking to see whether we need to load something, we can do something very similar to the original if statement:

// if we don't have buffers for this specific type and we're
// not already loading them, go ahead and load them.
if (!drumBuffers[type].length && !loadingDrums[type]) { ... }

Nitpicks

There's some formatting issues; I think you're using spaces while the repo is using tabs, and there are a few lines missing semicolons.

@andlehma
Copy link
Author

Thanks for the great feedback @kylestetz

I changed the loading approach in accordance with your feedback, so go ahead and take a look at it.

As for the samples being royalty free, I'm not entirely sure. I downloaded them from sampleswap.org. At https://sampleswap.org/about, they don't seem too sure about the legality of the samples. They state:

Our policy is to require that contributors only upload original sounds that they are giving up into the public domain, but there's no way for us to be sure that 100% of the sounds on this site are free and clear from any copyright restrictions. You'll have to use your own judgement.

Given that, I'd like to switch out the samples for something in much less of a grey-area. I looked around for some public domain drum samples, and found very little. Do you have any recommendations as to where I can find some good royalty free samples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants