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

Feature Request: Bring back the Tonal export #179

Open
mickmister opened this issue Jan 5, 2023 · 3 comments
Open

Feature Request: Bring back the Tonal export #179

mickmister opened this issue Jan 5, 2023 · 3 comments

Comments

@mickmister
Copy link
Member

For a short time, we were exposing the instance of tonal being used by scribbletune, so an application could interact with the "state" of that instance of the library. The tonal dependency has since moved to https://github.com/scribbletune/harmonics

What do you think about harmonics exporting its instance of tonal is using to scribbletune, and scribbletune exporting the instance as well? It's a bit hacky, but this unlocks way more potential for different scales and chord shapes that an application wants to use (a requirement in my case). I'm definitely open to alternative/proper solutions of accessing the same instance of the library.

@mickmister
Copy link
Member Author

Previous issue/PR for context:

We were technically exposing only one function from tonal, but exposing the whole library seems cleaner and would be more future-proof. This would allow an application to access all of tonal's functionality, while being able to properly mutate the state of the instance of the library being used in scribbletune/harmonics.

@walmik
Copy link
Collaborator

walmik commented Jan 14, 2023

Hello @mickmister, apologies for the delay in responding here (I was a bit under the weather).

harmonics does not export the scale/chord methods of tonal. It uses tonal as a dev dependency to construct a similar but extremely lightweight method to expose scales and chords.

There were a coupla reasons for this,

  • tonal's scale method brings in a fixed set of scales, harmonics adds on to it (for eg it adds the melakarta raga system to the existing scales from tonal using the same interface)
  • tonal exposes a lot of other things as soon as you bring any method of it, most of which uses modern JS, which doesnt play too well with max for live's native JS object

As for bringing back tonal in either harmonics or Scribbletune, I believe this might not be necessary as Scribbletune will still recognize the scale as an array as before, hence if you simply use tonal as part of your project, you should be able to pass on arrays generated from tonal to Scribbletune.

@walmik
Copy link
Collaborator

walmik commented Jan 14, 2023

unlocks way more potential for different scales and chord shapes that an application wants to use 

@mickmister I almost missed this ^ but, I think it s a good idea and we should come up with an interface via harmonics to do this in a tonal agnostic way. harmonics already has a simplified mapper that accepts a string of 0s and 1s to construct scales. Later it uses this string to construct the scale from a chromatic scale. It does the same for chords too.

What are your thoughts on trying to augment a tonal agnostic way of adding on more scales/chords via harmonics?

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