hydra-synth / hydra

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

implementing custom libraries #183

Open ghost opened 2 years ago

ghost commented 2 years ago

Hi

I use Hydra via Atom. I wanted to know if it was possible to implement libraries with custom functions in Hydra without having to rewrite them all the time?

ojack commented 2 years ago

Can you elaborate more? you can always edit the source code. Unfortunately "loadScript" doesn't work in atom because of permissions issues.

ghost commented 2 years ago

Ok...for example I would like to implement this function so that I don't have to rewrite it all the time:

rand = function(min=0,max=1,freq=1){ const d = new Date(); let time = Math.floor((d.getTime()/10)%freq+1); if(time == 1) { ris = Math.floor(Math.random() * max + min) } return ris }

where can I write it down? Exactly where can I implement it in the source code?

ghost commented 1 year ago

Ok...for example I would like to implement this function so that I don't have to rewrite it all the time:

rand = function(min=0,max=1,freq=1){ const d = new Date(); let time = Math.floor((d.getTime()/10)%freq+1); if(time == 1) { ris = Math.floor(Math.random() * max + min) } return ris }

where can I write it down? Exactly where can I implement it in the source code?


Da: Olivia Jack @.> Inviato: mercoledì 16 marzo 2022 17:20 A: hydra-synth/hydra @.> Cc: gabriele petrillo @.>; Author @.> Oggetto: Re: [hydra-synth/hydra] implementing custom libraries (Issue #183)

Can you elaborate more? you can always edit the source code. Unfortunately "loadScript" doesn't work in atom because of permissions issues.

— Reply to this email directly, view it on GitHubhttps://github.com/hydra-synth/hydra/issues/183#issuecomment-1069314392, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJBD3FSIA5RTI54FHVE2XDDVAIC4PANCNFSM5QTC6ONA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>