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

Play multiple graphs at the same time? #20

Open
WesleyAC opened this issue Mar 10, 2022 · 4 comments
Open

Play multiple graphs at the same time? #20

WesleyAC opened this issue Mar 10, 2022 · 4 comments
Assignees

Comments

@WesleyAC
Copy link

Hi! Genish looks really great — I started playing with it, and it looks almost exactly like what I want. However, I can't figure out how to play multiple different graphs at the same time.

Is this something that's supported?

Thanks!

@charlieroberts
Copy link
Owner

The easiest way is to just use add() and stick all the graphs you want to use in there. Or are you looking to have a different AudioWorklet for each graph?

@WesleyAC
Copy link
Author

I'm trying to overlay multiple synthesized sounds that are triggered at different times. Having a different worklet for each graph seemed like the simplest way to go about that, but if there's something easier, I'd be happy to hear about it :)

@raphaelbastide
Copy link

I tried to play multiple worklets at the same time, I am wondering in it would be the right way to do it, because it behaves strangely: it appears some ugens get the priority, other doesn’t.

window.onload = function() {
  genish.export( window )
  utilities.createContext( 2048 )
  speed = add( .5, phasor( .25, 0, { min:0, max:17 }) )
  const march = seq( [11025, 1050, 200], [220,330,440,550,660,880,1010] )
  const june  = seq( [5512, 11025], [220,330,440,550], speed )
  const sun  = seq( [11025], [140, 0] )
  window.onclick = ()=> {
    utilities.playWorklet(mul( cycle( march ), .2) )
    utilities.playWorklet(mul( cycle( june ), .2) )
    utilities.playWorklet(mul( cycle( sun ), .2) ) // comment that one and march and june will play
  }
}

@charlieroberts
Copy link
Owner

better handling of generated worklet(s) would be great to add in; I'll try and take a look soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants