saebekassebil / teoria

Javascript taught Music Theory
http://saebekassebil.github.io/teoria
MIT License
1.32k stars 114 forks source link

Export constant objects from core.js #72

Closed dbkaplun closed 9 years ago

saebekassebil commented 9 years ago

There's an ongoing effort of modularizing this lib better. See the modularado branch and the following modules:

notecoord - A data package containing the relative intervals bewteen notes in the Western music system accidental-value - The relative interval values of accidentals in music d'accord - A chord parsing module (independent of teoria)

If there's something specific you require, let me know.

saebekassebil commented 9 years ago

@secrettriangle I'm closing these two issues, as you've provided no description of what it is you want in detail. Feel free to open some new ones with more words in them

dbkaplun commented 9 years ago

Ask and you shall receive. All of this should be accessible somehow rather than vars within a closure.

dbkaplun commented 9 years ago

Really quite simple, don't know how much more info there is to provide.

dbkaplun commented 9 years ago

Does that make sense? Should I provide more info or open a new ticket?

saebekassebil commented 9 years ago

I quite agree that those things should be "accessible" in some way. But I don't believe a quick-fix is what this library needs. Some of those things are already available in the modules I linked you to earlier, some are not. We/I need to fix that, and I think #78 is going to take us closer the goal of exposing this stuff.

I'll reopen this, so we can keep track of what info is available as we progress. You're more than welcome to contribute to this if you have the time.

dbkaplun commented 9 years ago

I just mean that we should turn those vars into properties of already-exported objects somehow. That may not be the perfect solution but at least people will have the ability to access the information without having to copy/paste. (I happen to think it's a fine solution but I have only a cursory understanding of teoria.)

saebekassebil commented 9 years ago

Done. Ha. This was a very nice side-effect benefit from structuring this library in a more modular (node-compatible) way.

You can get all the "music-theory knowledge" from teoria~1.8.0 by doing:

var knowledge = require('teoria/lib/knowledge');

I know this is a bit "hidden" and it's true that the knowledge is a symptom of something growing too big, but I hope that it'll help you out for now.

Let me know if it works for you!

dbkaplun commented 9 years ago

Awesome! Nice work @saebekassebil :smile:

We should also move the scales and all other constants into knowledge.js or export them somehow.