Git Product home page Git Product logo

midi-clj's Introduction

midi-clj

A streamlined midi API for Clojure

midi-clj is being developed for Project Overtone, and it is meant to simplify the usage of midi devices and the midi system from within Clojure.

(use 'midi)

; Select midi input and output devices
; These functions bring up a GUI chooser window to select a midi port
(def keyboard (midi-in))
(def phat-synth (midi-out))

; Once you know the correct device names for your devices you can save the
; step of opening up the GUI chooser by putting a unique part of the name 
; as an argument to midi-in or midi-out.  The first device with a name that
; matches with lookup is returned.
(def ax (midi-in "axiom"))

; Connect ins and outs easily
(midi-route keyboard phat-synth)

; Trigger a note (note 40, velocity 100)
(midi-note-on phat-synth 40 100)
(Thread/sleep 500)
(midi-note-off phat-synth 0)

; Or the short-hand version to start and stop a note
(midi-note phat-synth 40 100 500)

; And the same thing with a sequence of notes
(midi-play phat-synth [40 47 40] [80 50 110] [250 500 250])

In Ubuntu Linux I use the snd-virmidi kernel module to provide software midi ports. USB midi devices should be pretty much plug and play.

Project Info:

Include in your project.clj like so:

[overtone/midi-clj "0.1"]

Source Repository

Downloads and the source repository can be found on GitHub:

http://github.com/rosejn/midi-clj

Eventually there will be more documentation for this library, but in the meantime you can see it in use within the context of Project Overtone, located here:

http://github.com/rosejn/overtone

Mailing List

For any questions, comments or patches, use the Overtone google group here:

http://groups.google.com/group/overtone

Authors

  • Jeff Rose

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.