hydra-synth / hydra

Livecoding networked visuals in the browser
https://hydra.ojack.xyz
GNU Affero General Public License v3.0
2.19k stars 269 forks source link

As a user I want to trigger a function that shuts down all the active renders. (ALA tidal Cycle's hush) #22

Closed rfpuyana closed 4 years ago

TheWispy commented 6 years ago

You could write a method within the editor which can do it for you. Something like these may do?

mute = (i) => {
  buffers = [o0, o1, o2, o3];
  solid(0,0,0).out(buffers[i]);
}

hush = () => {
  buffers = [o0, o1, o2, o3];
  buffers.map((b) => solid(0,0,0).out(b));
}

If you alt+Enter to initialise them, you can then call them with hush() or mute(2).

ojack commented 6 years ago

yes @TheWispy this is great and would be great to add to hydra-synth if you want to send a pull request! the only thing would be to use the internal array of output buffers in case there are more or less than four. Another thing I have been wondering is whether it makes sense to add other resets (such as deactivating source buffers and resetting audio settings) within this function or create another one. there should probably be another function that "restarts" hydra... whereas mute or hush is just for blacking out the screen. What do you think?

rfpuyana commented 5 years ago

hush() is already implemented.