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

Where should nodes' parameters live? #92

Open
sebpiq opened this issue Jan 19, 2014 · 2 comments
Open

Where should nodes' parameters live? #92

sebpiq opened this issue Jan 19, 2014 · 2 comments

Comments

@sebpiq
Copy link
Collaborator

sebpiq commented Jan 19, 2014

At the moment params can live in two places for the same node :

var sine = new Sine()
sine.parameters.frequency = 220  // place 1
sine.process(dst, frequencies)      // place 2

I suggest to clean this. Several possibilities :

  1. All parameters passed in process . This is simple, clear, coherent with ArrayMath, but if lots of parameters, could be annoying
  2. we leave it like this
  3. ?
@jussi-kalliokoski
Copy link
Owner

This is indeed something I've been pondering as well. 1) is coherent, and I like it in simple cases, but then if something has a lot of different parameters, or state, that may or may not be relevant to modify, it gets tricky. Not cool to have to specify all the stuff for example for BandLimitedOscillator. We should probably sit down to think the architecture a bit more. Maybe we shouldn't have classes but just functions (since if we have no state, instances make no sense)? I don't have a solution yet. This stuff is hard. x)

@sebpiq
Copy link
Collaborator Author

sebpiq commented Jan 19, 2014

I think it makes sense to have classes + instances, cause we do have states. For example in the case of an oscillator we have the phase.

We could also go for an hybrid solution : parameters are either passed to process or to the constructor but not both.

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