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
Making Tone.js modular #402
Comments
I've considered doing something similar, with the goal of a more modular
Tone.js built with ES6 / TypeScript. If others are interested it could be
useful.
…On Wed, Nov 14, 2018, 3:57 PM Ricardo Matias ***@***.*** wrote:
@tambien <https://github.com/tambien>, are there plans to make the
library modular? F.ex separating it into multiple packages per domain.
Personally, I'm pondering externalising the part that it is related to the
Time domain. I think there are plenty of cases where it's not necessary
having an "audio engine". Another advantage would be as a lower barrier to
people wanting to contribute, since it's quite daunting right now to delve
into the code, even though it's well documented.
If there's an interest in doing so, then I'd draft some kind of roadmap.
Otherwise, I'll just probably anyhow hack it away for myself.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#402>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC7ifxQ-WPsItU_bUaYD06fihBFJ7ObYks5uvJHYgaJpZM4YeqN8>
.
|
In particular, I want to leverage Tone's timing and MIDI implementations
without having to incorporate the Tone wrappers for the Audio context. From
what I've seen this is very difficult currently.
On Wed, Nov 14, 2018, 4:00 PM Spencer Rudnick <spencerudnick@gmail.com
wrote:
… I've considered doing something similar, with the goal of a more modular
Tone.js built with ES6 / TypeScript. If others are interested it could be
useful.
On Wed, Nov 14, 2018, 3:57 PM Ricardo Matias ***@***.***
wrote:
> @tambien <https://github.com/tambien>, are there plans to make the
> library modular? F.ex separating it into multiple packages per domain.
>
> Personally, I'm pondering externalising the part that it is related to
> the Time domain. I think there are plenty of cases where it's not necessary
> having an "audio engine". Another advantage would be as a lower barrier to
> people wanting to contribute, since it's quite daunting right now to delve
> into the code, even though it's well documented.
>
> If there's an interest in doing so, then I'd draft some kind of roadmap.
> Otherwise, I'll just probably anyhow hack it away for myself.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#402>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AC7ifxQ-WPsItU_bUaYD06fihBFJ7ObYks5uvJHYgaJpZM4YeqN8>
> .
>
|
You can already import the AMD source files seperately. For example |
@Idicious I would be very interested to see this version you have! |
this multipackage approach is something i've been looking into recently as well. i've registered I looked into lerna a little, but i'm not sure that this is what i need exactly. i don't think i will move things into separate repos since they all rely on a common set of build tools and tests, but having a monorepo with multiple packages seems appealing. If anyone has experience with lerna or with monorepos, please chime in with how it might work in Tone.js. @ricardomatias: As @Idicious mentioned, you can deep require every module and it will pull in it's dependencies if you're using something like webpack, so it's possible to grab some of the timing components without pulling in the entire audio engine part. |
🔥
…On Thu, Nov 15, 2018, 8:34 AM Yotam Mann ***@***.*** wrote:
this multipackage approach is something i've been looking into recently as
well. i've registered @Tonejs organization on npm. i was thinking of
separating out @tonejs/shim and maybe @tonejs/core, but eventually could
also separate out @tonejs/time as you mentioned and some other packages
to make it easier to build more modular components on top of the library.
I looked into lerna <https://github.com/lerna/lerna> a little, but i'm
not sure that this is what i need exactly. i don't think i will move things
into separate repos since they all rely on a common set of build tools and
tests, but having a monorepo with multiple packages seems appealing. If
anyone has experience with lerna or with monorepos, please chime in with
how it might work in Tone.js.
@ricardomatias <https://github.com/ricardomatias>: As @Idicious
<https://github.com/Idicious> mentioned, you can deep require every
module and it will pull in it's dependencies if you're using something like
webpack, so it's possible to grab some of the timing components without
pulling in the entire audio engine part.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#402 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AC7ifzNS9Js3jnPorByZjFX7pxTM5geXks5uvXuMgaJpZM4YeqN8>
.
|
Maybe a related question on modularity: I imagine it might be desirable to use non-Tone.js AudioNodes inside of a project that uses Tone.js (or just its supposed timing/midi parts). These might be implemented without Tone.js in mind, and released as npm packages without a Tone.js dependency. They might be implemented in a way to be controlled with an interface of native AudioParams. If I got any concepts of Tone.js wrong, I‘m happy to learn more, I‘m just getting into this. |
@fabb You already can connect a Tone node to a native audio node, the reverse would require using the currently undocumented audionode.input property. |
Thaht‘s nice! But how would I trigger notes based on Tone.js‘ Transport in this native audio node synth? |
You would need to create a wrapper interface for the native node, perhaps
create a class which encompasses a gain and audio source. Then expose an
interface which handles the incoming midi commands to control gain and
frequency.
…On Thu, Dec 13, 2018, 12:50 AM fabb ***@***.*** wrote:
Thaht‘s nice! But how would I trigger notes based on Tone.js‘ Transport in
this native audio node synth?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#402 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AC7if2QfrHPJb21oMr64u6uihROeG0YGks5u4fijgaJpZM4YeqN8>
.
|
@spencerudnick This is ofcourse essentially what the Tone synths do. |
Exactly :)
…On Thu, Dec 13, 2018, 8:58 AM David Sherman ***@***.*** wrote:
@spencerudnick <https://github.com/spencerudnick> This is ofcourse
essentially what the Tone synths do.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#402 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AC7if_GLs1FnzkAPwelch_0eySO6sLJhks5u4msIgaJpZM4YeqN8>
.
|
So I would actually mimick the interface of Tone synths in my wrapper, right? So for Tone it‘s actually no more a native audio node but it thinks it‘s a Tone synth? |
If your class fulfills the same interface, Tone won't know the difference.
…On Thu, Dec 13, 2018, 9:51 AM fabb ***@***.*** wrote:
So I would actually mimick the interface of Tone synths in my wrapper,
right? So for Tone it‘s actually no more a native audio node but it thinks
it‘s a Tone synth?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#402 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AC7if3n3ybbjx5ISaMz-WVWWJMG538nIks5u4nd8gaJpZM4YeqN8>
.
|
The magic of javascript... Let‘s see how hard it is to fulfil that interface. It would be awesome to extract a Tone.js wrapper for the audio node part of the Viktor NV-1 synth. |
it shouldn't be a problem to mix native web audio nodes or other web audio modules as long as they share the same AudioContext. You don't need to mimic a Tone.js synth interface for it to be able to interoperate with Tone.Transport or any other Tone.js component. |
Ah ok, the creator of Viktor NV-1 synth already as extracted the non-UI synth part to a separate lib: https://github.com/nicroto/viktor-nv1-engine. It supports Web-MIDI messages, let's see how I can integrate this with Tone. |
Ok, when I want to play the external synth using Tone Patterns, I need to somehow sync the attack and release commands to the provided |
The time value returned from the event classes (like Tone.Pattern) is just the raw Web Audio clock time. A native or third party component that can be scheduled using the AudioContext time could take this time and use it to synchronize with the Tone.Transport. |
Going to close this issue since Tone currently has the ability to load individual modules, though i aspire to better grouping in the future and potentially releasing sub packages. I will reference this issue if/when that happens. |
@tambien, are there plans to make the library modular? F.ex separating it into multiple packages per domain.
Personally, I'm pondering externalising the part that it is related to the Time domain. I think there are plenty of cases where it's not necessary having an "audio engine". Another advantage would be as a lower barrier to people wanting to contribute, since it's quite daunting right now to delve into the code, even though it's well documented.
If there's an interest in doing so, then I'd draft some kind of roadmap. Otherwise, I'll just probably anyhow hack it away for myself.
The text was updated successfully, but these errors were encountered: