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

Possible addition to a plugins object... #32

Open
assertchris opened this issue Oct 19, 2016 · 2 comments
Open

Possible addition to a plugins object... #32

assertchris opened this issue Oct 19, 2016 · 2 comments

Comments

@assertchris
Copy link

assertchris commented Oct 19, 2016

I was wondering what your thoughts are on plugins (as part of the core library). For instance, I've created a fade in/out plugin (function), and thought it might be a cool idea to bundle it like:

const instruments = [
    instrument1
]

const from = 0
const to = 50
const steps = 8

BandJS.plugins.fade(instruments, from, to, steps, function() {
    instrument1.repeatStart()
    instrument1.note("quarter", "C3")
    instrument1.note("quarter", "D3")
    instrument1.repeat(3)
})

I could create a pull request, for this, if you think it's a good idea...

@meenie
Copy link
Owner

meenie commented Oct 19, 2016

The ability to fade like this is amazing! Dynamics are very important in music :). I'm don't feel like the way Band.js is built allows for plugins. I'm actually in the middle of rewriting the whole thing using RxJS. I can build in the concept of plugins at that point as well.

If you want, you could build the fading ability straight into the core of the app, rather than making it a plugin. What do you think about that?

BTW, by steps, do you mean how many notes go by? Usually in music, you see the crecendo or decrecendo lines the length of notes. So it might be better to say for how long the fade should go, i.e. half, quarter, whole, etc. What do you think?

@assertchris
Copy link
Author

What do you think about that?

Sounds cool. Lemme know where I can find the Rx version/send pull requests to :)

i.e. half, quarter, whole, etc. What do you think?

I think it's a good idea to support the musically correct way of describing a fade in/out, but I must confess I know even less of music theory than I do of the internals of this library. The easiest way I could figure to fake the fade was to adjust volume between instrument.note/instrument.rest calls (which is what the example demonstrates).

I was even working on a variation of the fade function, to inspect the source of the callback, and count the number of calls to note and rest, so that I could remove the steps parameter, but that complicated multiple instruments inside the fade block (so I removed that code).

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

No branches or pull requests

2 participants