ffd8 / P5LIVE

p5.js collaborative live-coding vj environment!
https://p5live.org
GNU General Public License v3.0
226 stars 35 forks source link

Some Hydra examples are not working properly #87

Closed fmiramar closed 6 months ago

fmiramar commented 8 months ago

Hi!

I am on Windows 11 + Chrome and I was testing hydra examples but are not being rendered. I seems that it is a name conflict between hydra functions and javascript function names. For instance:

osc().sub(osc(6)).out(o0)
osc().shift(0.1,0.9,0.3).out(o0)

Would it be possible to avoid this?

Also, when doing the soft compile of some sorts of code I am getting a repetitive glitch and not the intended result. When doing the hard compilation it works fine. In this case, chaging the paremeters will lead to glitch:

src(o0).modulate(noise(1),0.005).blend(shape(4),0.01).out(o0)

Thanks a lot!

ffd8 commented 8 months ago

Hey @fmiramar – interesting you also have an issue with sub() and shift() on Windows, as I recall reading on the hydra-synth github that this is an issue on MacOS, which is solved by providing extra values.. just tested and the following works:

osc().sub(osc(6), .8).out(o0)
osc().shift(0.1,.9,.3, .1).out(o0)

As for your glitch and softcompiles, that's due to p5.js + hydra both having a noise() function = that first time you load the code with a hardcompile, the hydra code gets run BEFORE p5 is loaded = you get one hydra noise.. then p5's function overwrites it and is no longer a generator function. the quiiick fix, is to create an alias for hydras noise() spelled slightly differently, ie just after initializing hydra, add:

noize = noise

Theeen you'd just write:

src(o0).modulate(noize(1),0.005).blend(shape(4),0.01).out(o0)

and softcompiling and changes within the hydra sandbox should work smoothly.