Code Monkey home page Code Monkey logo

cm-incudine's Introduction

"cm-incudine" extends common music 2 (the common lisp port of common music) with realtime capabilities using the "incudine" realtime system by Tito Latini. Currently realtime midi, FUDI, OSC and any function call are supported. Note: incudine currently only works with sbcl.

The package depends on

  • cm
  • incudine
  • quicklisp (or asdf)
  • fudi-incudine

As all the code is evaluated within the "cm" package and exported from there, code evaluation should take place within the "cm" package as well.

Realtime processes can be invoked by either using the events function to an incudine-stream or the sprout function. The processes now also support realtime fudi messages in addition to osc and midi messages. To get this done first get the prerequisites:

Using a common lisp with quicklisp installed, copy all the folders of the prerequsites into the local-projects subfolder of your local quicklisp installation folder (default is ~/quicklisp/local-projects).

Then start sbcl and evaluate the following:

(ql:quickload "cm-incudine")

(progn
  (incudine:rt-start)
  (sleep 1)
  (midi-open-default :direction :input)
  (midi-open-default :direction :output)
  (osc-open-default :host "127.0.0.1" :port 3002 :direction :input)
  (osc-open-default :host "127.0.0.1" :port 3003 :direction :output)
  (fudi-open-default :host "127.0.0.1" :port 3011 :direction :input)
  (fudi-open-default :host "127.0.0.1" :port 3012 :direction :output)
  (setf *out* (new incudine-stream))
  (setf *rts-out* *out*))

Now you can send realtime midi messages to jackmidi output, tcp messages to pd listening on port 3012, or osc messages with udp to port 3003 like this:

(events (new midi :time 0 :keynum 60 :duration 1) *rts-out*)

(sprout
   (process
     repeat 2
     output (new fudi :time (now) :message '(1 2 3 4))
     wait 1) :at (now))

(sprout
   (process
     repeat 2
     output (new osc :time (now) :types "iiii" :message '(1 2 3 4))
     wait 1) :at (now))

The default time format is :sec but can also be set to :sample or :ms with the function #'set-time-format

The functions #'at and #'now are wrappers for the same incudine functions which automatically translate from/to the current time-format.

Receiving from fudi, osc and midi streams also works. Please refer to incudine's documentation for information how to set up receivers.

For other usage examples see the file "src/cm-incudine-examples.lisp".

Orm Finnendahl 2017

cm-incudine's People

Watchers

James Cloos avatar R. Mattes avatar

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.