hydra-synth / atom-hydra

78 stars 29 forks source link

eval whole file #25

Closed robertDurst closed 4 years ago

robertDurst commented 4 years ago

Hey @ojack! Hydra is awesome!

So I was thinking it may be useful to write some sort of library for shorthand effects, i.e. instead of:

if (tidal.s === "bd") {
     // do something
} else if (tidal.s === "sn") {
    // do something
}

something like:

increaseRotationOn("bd");
invertOn("sn");

I digress...

In exploring this, I noticed that it was clunky to make updates to a filewhere you wanted to import something, the import wasn't "remembered". Thus, it seemed useful to execute the whole file, which exists according to the main hydra repo. So, this PR adds that.

TLDR

This PR adds the ability to execute an entire file in atom. I kept with ctrl-alt-enter since in atom, ctrl-shift-enter is new line.

ojack commented 4 years ago

Oh this is great! Out of curiosity -- what operating system are you on? I have found that some people run into different issues with the key bindings. I can't remember specifics, but I think the CTRL-alt-enter for a block was included for osx users who were having issues with ctrl+enter. Worried that this might trip some people up. So might be necessary to find a different key combination! But going to merge anyway for now. I can test with Linux and windows to see whether there are any key binding issues.

robertDurst commented 4 years ago

Ah good call, I am currently on windows.