ctford / leipzig

A music composition library for Clojure and Clojurescript.
Other
454 stars 26 forks source link

Allow to pass note play scheduling function #14

Open pjagielski opened 7 years ago

pjagielski commented 7 years ago

The current implementation of leipzig/live uses overtone/at to schedule playing a note, but this works only with OSC events. In my use case I want to schedule MIDI out events which uses Java MIDI API. I'm doing some research about the best options, for now I'm using overtone.at-at/at-at with fixed thread pool.

So in this PR I only make possible to pass own play-fn function to both leipzig.live/play and jam

ctford commented 7 years ago

That's an interesting way to handle it. I came across a similar portability problem when using Leipzig from Javascript in Klangmeister. In my case I was a little lazier and just wrote a separate play function.

I'm a little undecided about what the best way to resolve the issue is. If possible, it could be nice to remove the dependency on Overtone altogether from Leipzig, which would substantially lower its transitive dependencies. On the other hand, your strategy of adding an extra arity is nicely backwards compatible and still gives Overtone users a nice default.