overtone / overtone

Collaborative Programmable Music
http://overtone.github.io
Other
5.87k stars 445 forks source link

Deploying Overtone #481

Open Folcon opened 2 years ago

Folcon commented 2 years ago

Hey,

I'd like to use overtone in one of my projects, deploying it to windows / mac / linux:

  1. Are there any issues doing this?
  2. Is there a way for me to only load the specific bits I need to synthesise sound or is using the live ns the recommended way?
  3. How would I go about doing this?

    1. I tried to lein uberjar my project, but according to #140, I should skip :aot via: :main ^{:skip-aot true} example-project.core in project.clj. Doing so creates a jar that seems to contain no main class:
    $  java -jar example-project/target/example-project-standalone.jar
    Error: Could not find or load main class example-project.core
    Caused by: java.lang.ClassNotFoundException: example-project.core
    
    $  java -jar example-project/target/example-project-standalone.jar --main-class clojure.main -m example-project.core 
    Error: Could not find or load main class example-project.core
    Caused by: java.lang.ClassNotFoundException: example-project.core
    1. Do I need to do anything specific to bundle SuperCollider, or will the internal SuperCollider server be enough?

Thanks!

plexus commented 6 months ago

Hi @Folcon , can you explain a bit more what the use case is in your case of running off an (uber)jar?

I'm going through old issues now that some of the more prominent issues have been fixed. I'd have to do some testing to figure out how to bundle Overtone in the best way, maybe we can gather up some tips in the wiki. Based on the above I can give you some input.

java -jar example-project/target/example-project-standalone.jar --main-class clojure.main -m example-project.core 
Error: Could not find or load main class example-project.core
Caused by: java.lang.ClassNotFoundException: example-project.core

I think what's happening here is that Java is interpreting -m example-project.core, overriding the preceding --main-class option. Try making it explicit that these are really options for clojure.main, by adding an --.

java -jar example-project/target/example-project-standalone.jar --main-class clojure.main -- -m example-project.core 
Folcon commented 6 months ago

can you explain a bit more what the use case is in your case of running off an (uber)jar?

Well I was trying to see if I could use overtone to author some dynamic soundtracks with the goal of bundling them in a game. IE depending on what action is happening in the game, create and play appropriate music.

Based on what you're saying this may not be workable?

dotinspace commented 2 months ago

I think something like FMOD is useful for game audio. Or, you could make use of Minim Java library via Clojure interop, depending on licensing requirements, that is. Never tried the latter, have used the former. Also, since Overtone depends on SuperCollider, you will possibly have an unnecessary hard time bundling it within your game. Other options are MaxMSP or PureData, but then Clojure is no longer relevant, I'd think. Just a couple of cents.